Frame 1
stop();
gr_game = "20728FB1";
_root.gr_game = "20728FB1";
play();
Frame 2
trace("WHAD");
stop();
Instance of Symbol 69 MovieClip "hi" in Frame 2
onClipEvent (enterFrame) {
trace("worked");
if (_root._framesloaded >= _root._totalframes) {
_root.gotoAndStop("start");
} else {
this.bar._xscale = (_root._framesloaded / _root._totalframes) * 100;
}
}
Frame 4
gotoAndPlay (1);
Frame 5
function clear() {
var _local2 = this;
for (var _local1 in shipArray) {
shipArray[_local1].clip.removeMovieClip();
}
for (var _local1 in shipCompArray) {
shipCompArray[_local1].clip.removeMovieClip();
}
var _local1 = 0;
while (_local1 < 500) {
name = "exp" + _local1;
_local2[name].removeMovieClip();
_local1++;
}
_local1 = 0;
while (_local1 < 300) {
name = "n" + _local1;
_local2[name].removeMovieClip();
name = "p" + _local1;
_local2[name].removeMovieClip();
_local1++;
}
_local1 = 0;
while (_local1 < numShip) {
name = "pShipCount" + _local1;
_local2[name].removeMovieClip();
name = "cShipCount" + _local1;
_local2[name].removeMovieClip();
_local1++;
}
if (sp_weapon) {
sp_weapon.removeMovieClip();
}
}
function startGame() {
difficulty = [25, 10, 3];
gridSize = 15;
numShip = 7;
level = 0;
score = 0;
lost = false;
}
function shakeScreen() {
seered._visible = true;
shakeInterval = setInterval(moveBy, 8);
shake = 0;
}
function moveBy() {
var _local1 = _root;
_local1._x = random(20) - 10;
_local1._y = random(20) - 10;
shake++;
if (shake > 10) {
_local1._x = 0;
_local1._y = 0;
seered._visible = false;
clearInterval(shakeInterval);
}
}
stop();
if (ambient == null) {
ambient = new Sound();
ambient.attachSound("ambientMusic");
ambient.start(0, 9999);
}
var developer = false;
var loadLocalTest = new LoadVars();
loadLocalTest.load("local.ecf");
loadLocalTest.onLoad = function (success) {
if (Number(this.local) == 52) {
trace("developer movie");
developer = true;
}
};
Instance of Symbol 77 MovieClip in Frame 5
onClipEvent (load) {
function shakeScreen() {
seered._visible = true;
_root.shakeInterval = setInterval(moveBy, 8);
shake = 0;
}
}
Frame 8
play();
_root.clear();
if (lost) {
stop();
_root.billboard.gotoAndStop(4);
} else {
score = score + 1000;
_root.billboard.gotoAndStop(level);
}
Frame 15
function cinPlay() {
if (level >= 3) {
gotoAndStop ("start");
} else {
gotoAndStop ("makemap");
}
}
stop();
Frame 16
function layout_map() {
var _local1 = this;
gridArray = new Array();
i = 0;
while (i < gridSize) {
gridArray[i] = new Array();
r = 0;
while (r < gridSize) {
num = (i * gridSize) + r;
name = "n" + num;
hit_dummy.duplicateMovieClip(name, num + 10);
_local1[name]._x = (map._x + 0.2) + (19.1 * r);
_local1[name]._y = (map._y + 0.2) + (19.1 * i);
_local1[name].num = num;
_local1[name].xNum = r;
_local1[name].yNum = i;
_local1[name].hit.enabled = false;
gridArray[i][r] = {name:_local1[name], x:r, y:i, hit:0};
r++;
}
i++;
}
}
function newLevel() {
switch (level) {
case 0 :
armement = [2, 1, 2];
powerUpCount = 10;
break;
case 1 :
armement = [3, 2, 2];
powerUpCount = 9;
break;
case 2 :
armement = [3, 3, 3];
powerUpCount = 8;
}
ctotalHit = 0;
totalHit = 0;
numHit = 0;
gotShip = false;
point = 10;
hit = "";
turn = "me";
weapon = 0;
levelD = level + 1;
}
function newMapArray() {
tempArray = new Array();
i = 0;
while (i < 15) {
tempArray[i] = new Array();
r = 0;
while (r < 15) {
tempArray[i][r] = 0;
r++;
}
i++;
}
return(tempArray.slice());
}
function checkBoard() {
hitArray = newMapArray();
i = 0;
while (i < numShip) {
shipObj = shipArray["ship" + i];
if (shipObj.cord == false) {
direction = "please place all of the ships";
return(false);
}
dir = shipObj.rotate;
size = shipObj.size;
r = 0;
while (r <= shipObj.size) {
xtemp = ((dir == "hor") ? (r) : 0);
ytemp = ((dir == "ver") ? (r) : 0);
sX = shipObj.cord[0] + xTemp;
sY = shipObj.cord[1] + yTemp;
if (hitArray[sY][sX] == 0) {
hitArray[sY][sX] = shipObj;
} else {
shipObj.clip.back();
direction = "you can not over lap the ships";
return(false);
}
r++;
}
i++;
}
return(true);
}
function placePowerUps() {
var _local1 = 0;
while (_local1 < powerUpCount) {
loop = true;
while (loop) {
y = random(gridSize);
x = random(gridSize);
if (hitCompArray[y][x] == 0) {
hitCompArray[y][x] = "bonus";
loop = false;
}
}
_local1++;
}
}
function playerMap() {
if (checkBoard()) {
clearAllships();
gotoAndPlay ("board");
}
}
function clearAllships() {
var _local1 = this;
i = 0;
while (i < numShip) {
_local1["ship" + i].removeMovieClip();
i++;
}
}
function findPlace(i) {
var _local1 = i;
var _local2 = this;
who = "ship" + _local1;
size = cship[_local1] + 1;
y = random(gridSize);
x = random(gridSize);
if (random(2) == 0) {
if (x > ((gridSize - size) - 1)) {
x = (gridSize - size) - 1;
}
shipArray[who].cord = [x, y];
shipArray[who].rotate = "hor";
shipArray[who].size = cship[_local1];
} else {
if (y > ((gridSize - size) - 1)) {
y = (gridSize - size) - 1;
}
shipArray[who].cord = [x, y];
shipArray[who].rotate = "ver";
shipArray[who].size = cship[_local1];
}
_local2[who].size = cship[_local1];
_local2[who].cord = [x, y];
_local2[who].rotate = shipArray[who].rotate;
_local2[who].place();
}
function autoPlace() {
var _local1 = this;
i = 0;
while (i < numShip) {
findPlace(i);
i++;
}
if (checkAutoBoard()) {
i = 0;
while (i < numShip) {
ship = _local1["ship" + i];
ship.swapDepths(900 + i);
who = "ship" + i;
dir = shipArray[who].rotate;
if (dir == "hor") {
ship._x = (map._x + 0.2) + (19.1 * shipArray[who].cord[0]);
ship._y = (map._y + 0.2) + (19.1 * shipArray[who].cord[1]);
ship._rotation = 0;
} else {
ship._x = ((map._x + 0.2) + (19.1 * shipArray[who].cord[0])) + 19.1;
ship._y = (map._y + 0.2) + (19.1 * shipArray[who].cord[1]);
ship._rotation = 90;
}
ship.size = cship[i];
ship.cord = [x, y];
ship.rotate = shipArray[who].rotate;
ship.place();
i++;
}
return(true);
}
autoPlace();
return(undefined);
}
function checkAutoBoard() {
hitArray = newMapArray();
i = 0;
while (i < numShip) {
shipObj = shipArray["ship" + i];
dir = shipObj.rotate;
size = shipObj.size;
r = 0;
while (r <= shipObj.size) {
xtemp = ((dir == "hor") ? (r) : 0);
ytemp = ((dir == "ver") ? (r) : 0);
sX = shipObj.cord[0] + xTemp;
sY = shipObj.cord[1] + yTemp;
if (hitArray[sY][sX] == 0) {
hitArray[sY][sX] = shipObj;
} else {
shipObj.size = 0;
return(false);
}
r++;
}
i++;
}
return(true);
}
stop();
direction = "Press start when ready.";
setProperty("/prot", _alpha , 0);
shipArray = new Array();
shipCompArray = new Array();
cship = [1, 1, 2, 2, 3, 3, 4];
layout_map();
shipName = ["frigate", "frigate", "submarine", "crusier", "destroyer", "destroyer", "aircraft carrier"];
i = 0;
while (i < numShip) {
who = "ship" + i;
name = this[who];
name.swapDepths(900 + i);
shipArray[who] = {clip:name, cord:0, rotate:0, size:0, hit:0, sunk:false, type:shipName[i]};
shipCompArray[who] = {clip:name, cord:0, rotate:0, size:0, hit:0, name:"fship" + i, sunk:false, type:shipName[i]};
i++;
}
Instance of Symbol 153 MovieClip "plane" in Frame 16
onClipEvent (load) {
}
Instance of Symbol 155 MovieClip "bbomb" in Frame 16
onClipEvent (load) {
}
Instance of Symbol 161 MovieClip "sbomb" in Frame 16
onClipEvent (load) {
}
Instance of Symbol 183 MovieClip "ship6" in Frame 16
onClipEvent (load) {
function rotateMe() {
if (rotate == "hor") {
rotate = "ver";
this._rotation = 90;
} else {
rotate = "hor";
this._rotation = 0;
}
place();
stamp();
}
function place() {
getClip = this._droptarget;
clipNum = eval (getClip).num;
clip = _root.gridArray[eval (getClip).yNum][eval (getClip).xNum];
_root.getClip = getClip;
if ((getClip == "/prot") || (getClip == "/")) {
oldGetClip = "";
} else if (clip != undefined) {
if ((getClip == "") || (getClip == "/ship")) {
getClip = oldGetClip;
oldGetClip = "";
}
if (rotate == "hor") {
if ((clip.x + size) < _root.gridSize) {
Xpos = eval (getClip)._x;
Ypos = eval (getClip)._y;
} else if ((clip.x + size) >= _root.gridSize) {
clipX = (_root.gridSize - size) - 1;
clipY = eval (getClip).yNum;
newClip = _root.gridArray[clipY][clipX];
clip = newClip;
Xpos = eval (newClip.name)._x;
Ypos = eval (newClip.name)._y;
}
this._x = Xpos;
this._y = Ypos;
} else {
if ((clip.y + size) < _root.gridSize) {
Xpos = eval (getClip)._x + clip.name._width;
Ypos = eval (getClip)._y;
} else if ((clip.y + size) >= _root.gridSize) {
clipX = eval (getClip).xNum;
clipY = (_root.gridSize - size) - 1;
newClip = _root.gridArray[clipY][clipX];
clip = newClip;
Xpos = eval (newClip.name)._x + _root.hit_dummy._width;
Ypos = eval (newClip.name)._y;
}
this._x = Xpos;
this._y = Ypos;
}
_root.shipArray[this._name].cord = [clip.x, clip.y];
_root.shipArray[this._name].rotate = rotate;
_root.shipArray[this._name].size = size;
oldGetClip = getClip;
}
}
function stamp() {
exit = false;
if (((getClip == "/prot") || (getClip == "/")) || ((substring(getClip, 1, 5)) == "/ship")) {
exit = true;
}
if (Number(exit) == Number(true)) {
_root.shipArray[this._name].cord = false;
getClip = "";
oldGetClip = "";
_x = orgX;
_y = orgY;
_rotation = 0;
rotate = "hor";
}
pickUp = false;
}
function back() {
_root.shipArray[this._name].cord = false;
getClip = "";
oldGetClip = "";
_x = orgX;
_y = orgY;
_rotation = 0;
rotate = "hor";
pickUp = false;
gotoAndStop ("stop");
}
size = 4;
rotate = "hor";
orgX = _x;
orgY = _y;
oldGetClip = "";
getClip = "";
placed = "";
pickUp = false;
}
onClipEvent (enterFrame) {
if (pickUp) {
place();
}
}
Instance of Symbol 187 MovieClip "ship3" in Frame 16
onClipEvent (load) {
function rotateMe() {
if (rotate == "hor") {
rotate = "ver";
this._rotation = 90;
} else {
rotate = "hor";
this._rotation = 0;
}
place();
}
function place() {
getClip = this._droptarget;
clipNum = eval (getClip).num;
clip = _root.gridArray[eval (getClip).yNum][eval (getClip).xNum];
_root.getClip = getClip;
if ((getClip == "/prot") || (getClip == "/")) {
oldGetClip = "";
} else if (clip != undefined) {
if ((getClip == "") || (getClip == "/ship")) {
getClip = oldGetClip;
oldGetClip = "";
}
if (rotate == "hor") {
if ((clip.x + size) < _root.gridSize) {
Xpos = eval (getClip)._x;
Ypos = eval (getClip)._y;
} else if ((clip.x + size) >= _root.gridSize) {
clipX = (_root.gridSize - size) - 1;
clipY = eval (getClip).yNum;
newClip = _root.gridArray[clipY][clipX];
clip = newClip;
Xpos = eval (newClip.name)._x;
Ypos = eval (newClip.name)._y;
}
this._x = Xpos;
this._y = Ypos;
} else {
if ((clip.y + size) < _root.gridSize) {
Xpos = eval (getClip)._x + clip.name._width;
Ypos = eval (getClip)._y;
} else if ((clip.y + size) >= _root.gridSize) {
clipX = eval (getClip).xNum;
clipY = (_root.gridSize - size) - 1;
newClip = _root.gridArray[clipY][clipX];
clip = newClip;
Xpos = eval (newClip.name)._x + _root.hit_dummy._width;
Ypos = eval (newClip.name)._y;
}
this._x = Xpos;
this._y = Ypos;
}
_root.shipArray[this._name].cord = [clip.x, clip.y];
_root.shipArray[this._name].rotate = rotate;
_root.shipArray[this._name].size = size;
oldGetClip = getClip;
}
}
function stamp() {
exit = false;
if (((getClip == "/prot") || (getClip == "/")) || ((substring(getClip, 1, 5)) == "/ship")) {
exit = true;
}
if (Number(exit) == Number(true)) {
_root.shipArray[this._name].cord = false;
getClip = "";
oldGetClip = "";
_x = orgX;
_y = orgY;
_rotation = 0;
rotate = "hor";
}
pickUp = false;
}
function back() {
_root.shipArray[this._name].cord = false;
getClip = "";
oldGetClip = "";
_x = orgX;
_y = orgY;
_rotation = 0;
rotate = "hor";
pickUp = false;
gotoAndStop ("stop");
}
size = 2;
rotate = "hor";
orgX = _x;
orgY = _y;
oldGetClip = "";
getClip = "";
placed = "";
pickUp = false;
}
onClipEvent (enterFrame) {
if (pickUp) {
place();
}
}
Instance of Symbol 196 MovieClip "ship5" in Frame 16
onClipEvent (load) {
function rotateMe() {
if (rotate == "hor") {
rotate = "ver";
this._rotation = 90;
} else {
rotate = "hor";
this._rotation = 0;
}
place();
}
function place() {
getClip = this._droptarget;
clipNum = eval (getClip).num;
clip = _root.gridArray[eval (getClip).yNum][eval (getClip).xNum];
_root.getClip = getClip;
if ((getClip == "/prot") || (getClip == "/")) {
oldGetClip = "";
} else if (clip != undefined) {
if ((getClip == "") || (getClip == "/ship")) {
getClip = oldGetClip;
oldGetClip = "";
}
if (rotate == "hor") {
if ((clip.x + size) < _root.gridSize) {
Xpos = eval (getClip)._x;
Ypos = eval (getClip)._y;
} else if ((clip.x + size) >= _root.gridSize) {
clipX = (_root.gridSize - size) - 1;
clipY = eval (getClip).yNum;
newClip = _root.gridArray[clipY][clipX];
clip = newClip;
Xpos = eval (newClip.name)._x;
Ypos = eval (newClip.name)._y;
}
this._x = Xpos;
this._y = Ypos;
} else {
if ((clip.y + size) < _root.gridSize) {
Xpos = eval (getClip)._x + clip.name._width;
Ypos = eval (getClip)._y;
} else if ((clip.y + size) >= _root.gridSize) {
clipX = eval (getClip).xNum;
clipY = (_root.gridSize - size) - 1;
newClip = _root.gridArray[clipY][clipX];
clip = newClip;
Xpos = eval (newClip.name)._x + _root.hit_dummy._width;
Ypos = eval (newClip.name)._y;
}
this._x = Xpos;
this._y = Ypos;
}
_root.shipArray[this._name].cord = [clip.x, clip.y];
_root.shipArray[this._name].rotate = rotate;
_root.shipArray[this._name].size = size;
oldGetClip = getClip;
}
}
function stamp() {
exit = false;
if (((getClip == "/prot") || (getClip == "/")) || ((substring(getClip, 1, 5)) == "/ship")) {
exit = true;
}
if (Number(exit) == Number(true)) {
_root.shipArray[this._name].cord = false;
getClip = "";
oldGetClip = "";
_x = orgX;
_y = orgY;
_rotation = 0;
rotate = "hor";
}
pickUp = false;
}
function back() {
_root.shipArray[this._name].cord = false;
getClip = "";
oldGetClip = "";
_x = orgX;
_y = orgY;
_rotation = 0;
rotate = "hor";
pickUp = false;
gotoAndStop ("stop");
}
size = 3;
rotate = "hor";
orgX = _x;
orgY = _y;
oldGetClip = "";
getClip = "";
placed = "";
pickUp = false;
}
onClipEvent (enterFrame) {
if (pickUp) {
place();
}
}
Instance of Symbol 199 MovieClip "ship0" in Frame 16
onClipEvent (load) {
function rotateMe() {
if (rotate == "hor") {
rotate = "ver";
this._rotation = 90;
} else {
rotate = "hor";
this._rotation = 0;
}
place();
}
function place() {
getClip = this._droptarget;
clipNum = eval (getClip).num;
clip = _root.gridArray[eval (getClip).yNum][eval (getClip).xNum];
_root.getClip = getClip;
if ((getClip == "/prot") || (getClip == "/")) {
oldGetClip = "";
} else if (clip != undefined) {
if ((getClip == "") || (getClip == "/ship")) {
getClip = oldGetClip;
oldGetClip = "";
}
if (rotate == "hor") {
if ((clip.x + size) < _root.gridSize) {
Xpos = eval (getClip)._x;
Ypos = eval (getClip)._y;
} else if ((clip.x + size) >= _root.gridSize) {
clipX = (_root.gridSize - size) - 1;
clipY = eval (getClip).yNum;
newClip = _root.gridArray[clipY][clipX];
clip = newClip;
Xpos = eval (newClip.name)._x;
Ypos = eval (newClip.name)._y;
}
this._x = Xpos;
this._y = Ypos;
} else {
if ((clip.y + size) < _root.gridSize) {
Xpos = eval (getClip)._x + clip.name._width;
Ypos = eval (getClip)._y;
} else if ((clip.y + size) >= _root.gridSize) {
clipX = eval (getClip).xNum;
clipY = (_root.gridSize - size) - 1;
newClip = _root.gridArray[clipY][clipX];
clip = newClip;
Xpos = eval (newClip.name)._x + _root.hit_dummy._width;
Ypos = eval (newClip.name)._y;
}
this._x = Xpos;
this._y = Ypos;
}
_root.shipArray[this._name].cord = [clip.x, clip.y];
_root.shipArray[this._name].rotate = rotate;
_root.shipArray[this._name].size = size;
oldGetClip = getClip;
}
}
function stamp() {
exit = false;
if (((getClip == "/prot") || (getClip == "/")) || ((substring(getClip, 1, 5)) == "/ship")) {
exit = true;
}
if (Number(exit) == Number(true)) {
_root.shipArray[this._name].cord = false;
getClip = "";
oldGetClip = "";
_x = orgX;
_y = orgY;
_rotation = 0;
rotate = "hor";
}
pickUp = false;
}
function back() {
_root.shipArray[this._name].cord = false;
getClip = "";
oldGetClip = "";
_x = orgX;
_y = orgY;
_rotation = 0;
rotate = "hor";
pickUp = false;
gotoAndStop ("stop");
}
size = 1;
rotate = "hor";
orgX = _x;
orgY = _y;
oldGetClip = "";
getClip = "";
placed = "";
pickUp = false;
}
onClipEvent (enterFrame) {
if (pickUp) {
place();
}
}
Instance of Symbol 187 MovieClip "ship2" in Frame 16
onClipEvent (load) {
function rotateMe() {
if (rotate == "hor") {
rotate = "ver";
this._rotation = 90;
} else {
rotate = "hor";
this._rotation = 0;
}
place();
}
function place() {
getClip = this._droptarget;
clipNum = eval (getClip).num;
clip = _root.gridArray[eval (getClip).yNum][eval (getClip).xNum];
_root.getClip = getClip;
if ((getClip == "/prot") || (getClip == "/")) {
oldGetClip = "";
} else if (clip != undefined) {
if ((getClip == "") || (getClip == "/ship")) {
getClip = oldGetClip;
oldGetClip = "";
}
if (rotate == "hor") {
if ((clip.x + size) < _root.gridSize) {
Xpos = eval (getClip)._x;
Ypos = eval (getClip)._y;
} else if ((clip.x + size) >= _root.gridSize) {
clipX = (_root.gridSize - size) - 1;
clipY = eval (getClip).yNum;
newClip = _root.gridArray[clipY][clipX];
clip = newClip;
Xpos = eval (newClip.name)._x;
Ypos = eval (newClip.name)._y;
}
this._x = Xpos;
this._y = Ypos;
} else {
if ((clip.y + size) < _root.gridSize) {
Xpos = eval (getClip)._x + clip.name._width;
Ypos = eval (getClip)._y;
} else if ((clip.y + size) >= _root.gridSize) {
clipX = eval (getClip).xNum;
clipY = (_root.gridSize - size) - 1;
newClip = _root.gridArray[clipY][clipX];
clip = newClip;
Xpos = eval (newClip.name)._x + _root.hit_dummy._width;
Ypos = eval (newClip.name)._y;
}
this._x = Xpos;
this._y = Ypos;
}
_root.shipArray[this._name].cord = [clip.x, clip.y];
_root.shipArray[this._name].rotate = rotate;
_root.shipArray[this._name].size = size;
oldGetClip = getClip;
}
}
function stamp() {
exit = false;
if (((getClip == "/prot") || (getClip == "/")) || ((substring(getClip, 1, 5)) == "/ship")) {
exit = true;
}
if (Number(exit) == Number(true)) {
_root.shipArray[this._name].cord = false;
getClip = "";
oldGetClip = "";
_x = orgX;
_y = orgY;
_rotation = 0;
rotate = "hor";
}
pickUp = false;
}
function back() {
_root.shipArray[this._name].cord = false;
getClip = "";
oldGetClip = "";
_x = orgX;
_y = orgY;
_rotation = 0;
rotate = "hor";
pickUp = false;
gotoAndStop ("stop");
}
size = 2;
rotate = "hor";
orgX = _x;
orgY = _y;
oldGetClip = "";
getClip = "";
placed = "";
pickUp = false;
}
onClipEvent (enterFrame) {
if (pickUp) {
place();
}
}
Instance of Symbol 199 MovieClip "ship1" in Frame 16
onClipEvent (load) {
function rotateMe() {
if (rotate == "hor") {
rotate = "ver";
this._rotation = 90;
} else {
rotate = "hor";
this._rotation = 0;
}
place();
}
function place() {
getClip = this._droptarget;
clipNum = eval (getClip).num;
clip = _root.gridArray[eval (getClip).yNum][eval (getClip).xNum];
_root.getClip = getClip;
if ((getClip == "/prot") || (getClip == "/")) {
oldGetClip = "";
} else if (clip != undefined) {
if ((getClip == "") || (getClip == "/ship")) {
getClip = oldGetClip;
oldGetClip = "";
}
if (rotate == "hor") {
if ((clip.x + size) < _root.gridSize) {
Xpos = eval (getClip)._x;
Ypos = eval (getClip)._y;
} else if ((clip.x + size) >= _root.gridSize) {
clipX = (_root.gridSize - size) - 1;
clipY = eval (getClip).yNum;
newClip = _root.gridArray[clipY][clipX];
clip = newClip;
Xpos = eval (newClip.name)._x;
Ypos = eval (newClip.name)._y;
}
this._x = Xpos;
this._y = Ypos;
} else {
if ((clip.y + size) < _root.gridSize) {
Xpos = eval (getClip)._x + clip.name._width;
Ypos = eval (getClip)._y;
} else if ((clip.y + size) >= _root.gridSize) {
clipX = eval (getClip).xNum;
clipY = (_root.gridSize - size) - 1;
newClip = _root.gridArray[clipY][clipX];
clip = newClip;
Xpos = eval (newClip.name)._x + _root.hit_dummy._width;
Ypos = eval (newClip.name)._y;
}
this._x = Xpos;
this._y = Ypos;
}
_root.shipArray[this._name].cord = [clip.x, clip.y];
_root.shipArray[this._name].rotate = rotate;
_root.shipArray[this._name].size = size;
oldGetClip = getClip;
}
}
function stamp() {
exit = false;
if (((getClip == "/prot") || (getClip == "/")) || ((substring(getClip, 1, 5)) == "/ship")) {
exit = true;
}
if (Number(exit) == Number(true)) {
_root.shipArray[this._name].cord = false;
getClip = "";
oldGetClip = "";
_x = orgX;
_y = orgY;
_rotation = 0;
rotate = "hor";
}
pickUp = false;
}
function back() {
_root.shipArray[this._name].cord = false;
getClip = "";
oldGetClip = "";
_x = orgX;
_y = orgY;
_rotation = 0;
rotate = "hor";
pickUp = false;
gotoAndStop ("stop");
}
size = 1;
rotate = "hor";
orgX = _x;
orgY = _y;
oldGetClip = "";
getClip = "";
placed = "";
pickUp = false;
}
onClipEvent (enterFrame) {
if (pickUp) {
place();
}
}
Instance of Symbol 196 MovieClip "ship4" in Frame 16
onClipEvent (load) {
function rotateMe() {
if (rotate == "hor") {
rotate = "ver";
this._rotation = 90;
} else {
rotate = "hor";
this._rotation = 0;
}
place();
}
function place() {
getClip = this._droptarget;
clipNum = eval (getClip).num;
clip = _root.gridArray[eval (getClip).yNum][eval (getClip).xNum];
_root.getClip = getClip;
if ((getClip == "/prot") || (getClip == "/")) {
oldGetClip = "";
} else if (clip != undefined) {
if ((getClip == "") || (getClip == "/ship")) {
getClip = oldGetClip;
oldGetClip = "";
}
if (rotate == "hor") {
if ((clip.x + size) < _root.gridSize) {
Xpos = eval (getClip)._x;
Ypos = eval (getClip)._y;
} else if ((clip.x + size) >= _root.gridSize) {
clipX = (_root.gridSize - size) - 1;
clipY = eval (getClip).yNum;
newClip = _root.gridArray[clipY][clipX];
clip = newClip;
Xpos = eval (newClip.name)._x;
Ypos = eval (newClip.name)._y;
}
this._x = Xpos;
this._y = Ypos;
} else {
if ((clip.y + size) < _root.gridSize) {
Xpos = eval (getClip)._x + clip.name._width;
Ypos = eval (getClip)._y;
} else if ((clip.y + size) >= _root.gridSize) {
clipX = eval (getClip).xNum;
clipY = (_root.gridSize - size) - 1;
newClip = _root.gridArray[clipY][clipX];
clip = newClip;
Xpos = eval (newClip.name)._x + _root.hit_dummy._width;
Ypos = eval (newClip.name)._y;
}
this._x = Xpos;
this._y = Ypos;
}
_root.shipArray[this._name].cord = [clip.x, clip.y];
_root.shipArray[this._name].rotate = rotate;
_root.shipArray[this._name].size = size;
oldGetClip = getClip;
}
}
function stamp() {
exit = false;
if (((getClip == "/prot") || (getClip == "/")) || ((substring(getClip, 1, 5)) == "/ship")) {
exit = true;
}
if (Number(exit) == Number(true)) {
_root.shipArray[this._name].cord = false;
getClip = "";
oldGetClip = "";
_x = orgX;
_y = orgY;
_rotation = 0;
rotate = "hor";
}
pickUp = false;
}
function back() {
_root.shipArray[this._name].cord = false;
getClip = "";
oldGetClip = "";
_x = orgX;
_y = orgY;
_rotation = 0;
rotate = "hor";
pickUp = false;
gotoAndStop ("stop");
}
size = 3;
rotate = "hor";
orgX = _x;
orgY = _y;
oldGetClip = "";
getClip = "";
placed = "";
pickUp = false;
}
onClipEvent (enterFrame) {
if (pickUp) {
place();
}
}
Frame 35
function puterPlace() {
i = 0;
while (i < numShip) {
who = "ship" + i;
size = cship[i] + 1;
if (shipCompArray[who].size == 0) {
y = random(gridSize);
x = random(gridSize);
if (random(2) == 0) {
if (x > ((gridSize - size) - 1)) {
x = (gridSize - size) - 1;
}
shipCompArray[who].cord = [x, y];
shipCompArray[who].rotate = "hor";
shipCompArray[who].size = cship[i];
} else {
if (y > ((gridSize - size) - 1)) {
y = (gridSize - size) - 1;
}
shipCompArray[who].cord = [x, y];
shipCompArray[who].rotate = "ver";
shipCompArray[who].size = cship[i];
}
}
i++;
}
if (checkCompBoard()) {
placePowerUps();
return(true);
}
}
function checkCompBoard() {
hitCompArray = newMapArray();
i = 0;
while (i < numShip) {
shipObj = shipCompArray["ship" + i];
dir = shipObj.rotate;
size = shipObj.size;
r = 0;
while (r <= shipObj.size) {
xtemp = ((dir == "hor") ? (r) : 0);
ytemp = ((dir == "ver") ? (r) : 0);
sX = shipObj.cord[0] + xTemp;
sY = shipObj.cord[1] + yTemp;
if (hitCompArray[sY][sX] == 0) {
hitCompArray[sY][sX] = shipObj;
} else {
shipObj.size = 0;
puterPlace();
}
r++;
}
i++;
}
return(true);
}
puterPlace();
i = 0;
while (i < numShip) {
who = "ship" + i;
name = this[who];
name._x = -100;
i++;
}
gotoAndPlay ("goFrame");
stop();
Frame 37
function gameMaps() {
var _local1 = this;
i = 0;
while (i < 15) {
r = 0;
while (r < 15) {
num = (i * 15) + r;
name = "n" + num;
_local1[name]._x = (map0._x + 0.2) + (19.1 * r);
_local1[name]._y = (map0._y + 0.2) + (19.1 * i);
_local1[name].num = num;
_local1[name].xNum = r;
_local1[name].yNum = i;
_local1[name].hit.enabled = false;
name = "p" + num;
hit_dummy.duplicateMovieClip(name, num + 250);
_local1[name]._x = (map1._x + 0.2) + (19.1 * r);
_local1[name]._y = (map1._y + 0.2) + (19.1 * i);
_local1[name].num = num;
_local1[name].xNum = r;
_local1[name].yNum = i;
r++;
}
i++;
}
}
function endGame() {
var _local1 = this;
n = 0;
while (n < numShip) {
name = "qShip" + n;
if (!_local1[name]) {
_local1[temp.name].duplicateMovieClip(name, 1500 + n);
if (temp.rotate == "hor") {
_local1[name]._x = (map1._x + 0.2) + (19.1 * temp.cord[0]);
_local1[name]._y = (map1._y + 0.2) + (19.1 * temp.cord[1]);
_local1[name]._rotation = 0;
} else {
_local1[name]._x = ((map1._x + 0.2) + (19.1 * temp.cord[0])) + 19.1;
_local1[name]._y = (map1._y + 0.2) + (19.1 * temp.cord[1]);
_local1[name]._rotation = 90;
}
} else {
_local1[name].swapDepths(1500 + n);
}
shipCompArray["ship" + n].clip = _local1[name];
n++;
}
if (lost == true) {
lost = true;
Direction = "You have been defeated!";
} else {
Direction = "You Won";
}
score = Number(score) + 100;
gotShip = false;
turn = "lock";
gotoAndPlay ("endFrame");
}
gameMaps();
seered._visible = false;
var i = 0;
while (i < armement.length) {
if (armement[i] > 0) {
this["w_picker" + i].gotoAndStop(2);
}
this["w_picker" + i].num = armement[i];
i++;
}
i = 0;
while (i < numShip) {
name = "mship" + i;
this["fship" + i].duplicateMovieClip(name, 1200 + i);
who = "ship" + i;
dir = shipArray[who].rotate;
if (dir == "hor") {
this[name]._x = (map0._x + 0.2) + (19.1 * shipArray[who].cord[0]);
this[name]._y = (map0._y + 0.2) + (19.1 * shipArray[who].cord[1]);
this[name]._rotation = 0;
} else {
this[name]._x = ((map0._x + 0.2) + (19.1 * shipArray[who].cord[0])) + 19.1;
this[name]._y = (map0._y + 0.2) + (19.1 * shipArray[who].cord[1]);
this[name]._rotation = 90;
}
shipArray[who].clip = this[name];
pShipCount.duplicateMovieClip("pShipCount" + i, 2000 + i);
this["pShipCount" + i]._x = this.pShipCount._x + ((this.pShipCount._width + 5) * i);
this["pShipCount" + i]._y = this.pShipCount._y;
cShipCount.duplicateMovieClip("cShipCount" + i, 2010 + i);
this["cShipCount" + i]._x = this.cShipCount._x + ((this.cShipCount._width + 5) * i);
this["cShipCount" + i]._y = this.cShipCount._y;
i++;
}
turn = "me";
numHit = 0;
gotoAndStop ("hold");
Instance of Symbol 219 MovieClip "hitSpot" in Frame 37
/* no clip actions */
Instance of Symbol 240 MovieClip "fship5" in Frame 37
/* no clip actions */
Instance of Symbol 240 MovieClip "fship4" in Frame 37
/* no clip actions */
Frame 39
play();
Frame 73
stop();
level = level + 1;
gotoAndStop ("newLevel");
Frame 76
function directionBox(n) {
if (turn == "me") {
switch (n) {
case 1 :
direction = "Air Attack";
return;
case 2 :
direction = "Missile Strike";
return;
case 3 :
direction = "Guided Torpedo";
return;
default :
direction = "your turn";
}
}
}
function singleHit(obj, x, y) {
var _local1 = _root;
hitObj = _local1.hitCompArray[y][x];
_local1.placeHitMark(x, y, hitObj);
_local1.play();
}
function pickShip() {
for (i in shipArray) {
if ((shipArray[i].sunk == false) && (i != "ship6")) {
return(i);
}
}
_root.armement = [0, 0, 0];
_root.weaponReset();
}
function planeHit(obj, x, y) {
var _local1 = this;
var _local2 = _root;
plane.duplicateMovieClip("sp_weapon", 1600);
shipw = ((shipArray.ship6.rotate == "hor") ? 95 : 9);
shiph = ((shipArray.ship6.rotate == "hor") ? 9 : 95);
sp_weapon.startX = ((map0._x + 0.2) + (19.1 * shipArray.ship6.cord[0])) + shipw;
sp_weapon.startY = ((map0._y + 0.2) + (19.1 * shipArray.ship6.cord[1])) + shiph;
sp_weapon._x = sp_weapon.startX;
sp_weapon._y = sp_weapon.startY;
sp_weapon.cord = [x, y];
sp_weapon.targetX = (map1._x + 0.2) + (19.1 * x);
sp_weapon.targetY = (map1._y + 0.2) + (19.1 * y);
sp_weapon.stopMe = true;
sp_sound = new Sound();
sp_sound.attachSound("flyby");
sp_sound.start(0, 1);
trace("call sound please = " + sp_sound);
sp_weapon.flightPlan = function () {
var _local1 = this;
distx = _local1.targetX - _local1.startX;
disty = _local1.startY - _local1.targetY;
distance = Math.sqrt(Number(distx * distx) + Number(disty * disty)) / 20;
movex = distx / distance;
movey = disty / distance;
ratio = disty / distx;
if (Number(distx) > 0) {
if (Number(ratio) > 1) {
angle = 90 - ((Math.atan(1 / ratio) * 180) / Math.PI);
} else if ((Number(ratio) > 0) and (Number(ratio) < 1)) {
angle = (Math.atan(ratio) * 180) / Math.PI;
} else if ((Number(ratio) < 0) and (Number(ratio) > Number(-1))) {
angle = 360 + Number((Math.atan(ratio) * 180) / Math.PI);
} else if (Number(ratio) < Number(-1)) {
angle = 270 - ((Math.atan(1 / ratio) * 180) / Math.PI);
}
} else if (Number(distx) < 0) {
if (Number(ratio) > 1) {
angle = 270 - ((Math.atan(1 / ratio) * 180) / Math.PI);
} else if ((Number(ratio) > 0) and (Number(ratio) < 1)) {
angle = 180 + Number((Math.atan(ratio) * 180) / Math.PI);
} else if ((Number(ratio) < 0) and (Number(ratio) > Number(-1))) {
angle = 180 + Number((Math.atan(ratio) * 180) / Math.PI);
} else if (Number(ratio) < Number(-1)) {
angle = 90 - ((Math.atan(1 / ratio) * 180) / Math.PI);
}
} else if (Number(distx) == 0) {
if (Number(disty) > 0) {
angle = -90;
} else if (Number(disty) < 0) {
angle = 90;
} else if (Number(disty) == 0) {
angle = 0;
}
}
_local1._rotation = 0;
_local1._rotation = _local1._rotation + (-angle);
};
sp_weapon.hitMap = function () {
var _local1 = _root;
var _local2 = this;
var _local3 = 0;
while (_local3 < 6) {
look = 0;
while (look < 100) {
findX = _local2.cord[0] + (random(6) - 3);
findY = _local2.cord[1] + (random(6) - 3);
findX = Math.max(0, Math.min(findX, _local1.gridsize - 1));
findY = Math.max(0, Math.min(findY, _local1.gridsize - 1));
hitObj = _local1.hitCompArray[findY][findX];
if (hitObj != 9) {
look = 100;
}
look++;
}
_local1.placeHitMark(findX, findY, hitObj);
_local3++;
}
};
sp_weapon.flyBack = function () {
var _local1 = this;
_local1.nextMove = function () {
sp_sound.stop("flyby");
_root.gotoAndPlay("putertime");
this.removeMovieClip();
stopMe = true;
};
_local1.targetX = _local1.startX;
_local1.targetY = _local1.startY;
_local1.startX = _local1._x;
_local1.startY = _local1._y;
_local1.flightPlan();
stopMe = false;
};
sp_weapon.nextMove = function () {
this.gotoAndPlay("bomb");
stopMe = true;
};
sp_weapon.onEnterFrame = function () {
var _local1 = this;
if (!stopMe) {
if (Number(distance) <= 0) {
_local1.nextMove();
} else {
newx = _local1._x + Number(movex);
newy = _local1._y - movey;
_local1._x = newx;
_local1._y = newy;
distance = distance - 1;
}
}
};
sp_weapon.onLoad = function () {
var _local1 = this;
_local1.gotoAndPlay(2);
_local1._x = _local1.startX;
_local1._y = _local1.startY;
_local1.flightPlan();
stopMe = false;
};
}
function bigBomb(obj, x, y) {
var _local2 = _root;
var _local3 = this;
shipPicked = pickShip();
shipw = ((shipArray[shipPicked].rotate == "hor") ? ((shipArray[shipPicked].size * 19) / 2) : 9);
shiph = ((shipArray[shipPicked].rotate == "hor") ? 9 : ((shipArray[shipPicked].size * 19) / 2));
bbomb.duplicateMovieClip("sp_weapon", 1600);
sp_weapon.startX = ((map0._x + 0.2) + (19.1 * shipArray[shipPicked].cord[0])) + shipw;
sp_weapon.startY = ((map0._y + 0.2) + (19.1 * shipArray[shipPicked].cord[1])) + shiph;
sp_weapon._x = sp_weapon.startX;
sp_weapon._y = sp_weapon.startY;
sp_weapon._rotation = 0;
sp_weapon.cord = [x, y];
sp_weapon.targetX = (map1._x + 0.2) + (19.1 * x);
sp_weapon.targetY = (map1._y + 0.2) + (19.1 * y);
sp_weapon.stopMe = true;
sp_sound = new Sound();
sp_sound.attachSound("missle");
sp_sound.start(0, 1);
sp_weapon.flightPlan = function () {
var _local1 = this;
distx = _local1.targetX - _local1.startX;
disty = _local1.startY - _local1.targetY;
distance = Math.sqrt(Number(distx * distx) + Number(disty * disty)) / 10;
movex = distx / distance;
movey = disty / distance;
ratio = disty / distx;
if (Number(distx) > 0) {
if (Number(ratio) > 1) {
angle = 90 - ((Math.atan(1 / ratio) * 180) / Math.PI);
} else if ((Number(ratio) > 0) and (Number(ratio) < 1)) {
angle = (Math.atan(ratio) * 180) / Math.PI;
} else if ((Number(ratio) < 0) and (Number(ratio) > Number(-1))) {
angle = 360 + Number((Math.atan(ratio) * 180) / Math.PI);
} else if (Number(ratio) < Number(-1)) {
angle = 270 - ((Math.atan(1 / ratio) * 180) / Math.PI);
}
} else if (Number(distx) < 0) {
if (Number(ratio) > 1) {
angle = 270 - ((Math.atan(1 / ratio) * 180) / Math.PI);
} else if ((Number(ratio) > 0) and (Number(ratio) < 1)) {
angle = 180 + Number((Math.atan(ratio) * 180) / Math.PI);
} else if ((Number(ratio) < 0) and (Number(ratio) > Number(-1))) {
angle = 180 + Number((Math.atan(ratio) * 180) / Math.PI);
} else if (Number(ratio) < Number(-1)) {
angle = 90 - ((Math.atan(1 / ratio) * 180) / Math.PI);
}
} else if (Number(distx) == 0) {
if (Number(disty) > 0) {
angle = -90;
} else if (Number(disty) < 0) {
angle = 90;
} else if (Number(disty) == 0) {
angle = 0;
}
}
_local1._rotation = 0;
_local1._rotation = _local1._rotation + (-angle);
};
sp_weapon.hitMap = function () {
var _local2 = _root;
sp_sound.stop("missle");
var _local3 = 0;
while (_local3 < 3) {
var _local1 = 0;
while (_local1 < 3) {
findX = this.cord[0] + (_local1 - 1);
findY = this.cord[1] + (_local3 - 1);
findX = Math.max(0, Math.min(findX, _local2.gridsize - 1));
findY = Math.max(0, Math.min(findY, _local2.gridsize - 1));
hitObj = _local2.hitCompArray[findY][findX];
if (hitObj != 9) {
_local2.placeHitMark(findX, findY, hitObj);
}
_local1++;
}
_local3++;
}
_local2.play();
this.removeMovieClip();
};
sp_weapon.onEnterFrame = function () {
var _local1 = this;
if (Number(distance) <= 0) {
_local1.hitMap();
} else {
newx = _local1._x + Number(movex);
newy = _local1._y - movey;
_local1._x = newx;
_local1._y = newy;
distance = distance - 1;
}
};
sp_weapon.onLoad = function () {
var _local1 = this;
_local1.gotoAndPlay(2);
_local1._x = _local1.startX;
_local1._y = _local1.startY;
_local1.flightPlan();
};
}
function smartBomb(obj, x, y) {
var _local1 = _root;
var _local2 = y;
var _local3 = x;
sbomb.duplicateMovieClip("sp_weapon", 1120);
shipPicked = pickShip();
shipw = ((shipArray[shipPicked].rotate == "hor") ? ((shipArray[shipPicked].size * 19) / 2) : 9);
shiph = ((shipArray[shipPicked].rotate == "hor") ? 9 : ((shipArray[shipPicked].size * 19) / 2));
sp_weapon.startX = ((map0._x + 0.2) + (19.1 * shipArray[shipPicked].cord[0])) + shipw;
sp_weapon.startY = ((map0._y + 0.2) + (19.1 * shipArray[shipPicked].cord[1])) + shiph;
sp_weapon._x = sp_weapon.startX;
sp_weapon._y = sp_weapon.startY;
sp_weapon._rotation = 0;
sp_sound = new Sound();
sp_sound.attachSound("torpedo");
sp_sound.start(0, 1);
hitObj = _local1.hitCompArray[_local2][_local3];
if (typeof(hitObj) != "object") {
for (var i in _local1.shipCompArray) {
if (_local1.shipCompArray[i].sunk == false) {
_local3 = _local1.shipCompArray[i].cord[0];
_local2 = _local1.shipCompArray[i].cord[1];
var t = 0;
while (t < (_local1.shipCompArray[i].size + 1)) {
hitObj = _local1.hitCompArray[_local2][_local3];
if (typeof(hitObj) == "object") {
break;
}
_local3 = ((_local1.shipCompArray[i].rotate == "hor") ? (_local3 + 1) : (_local3));
_local2 = ((_local1.shipCompArray[i].rotate == "ver") ? (_local2 + 1) : (_local2));
t++;
}
break;
}
}
}
sp_weapon.cord = [_local3, _local2];
sp_weapon.targetX = ((map1._x + 0.2) + (19.1 * _local3)) + 9;
sp_weapon.targetY = ((map1._y + 0.2) + (19.1 * _local2)) + 9;
sp_weapon.stopMe = true;
sp_weapon.flightPlan = function () {
var _local1 = this;
distx = _local1.targetX - _local1.startX;
disty = _local1.startY - _local1.targetY;
distance = Math.sqrt(Number(distx * distx) + Number(disty * disty)) / 10;
movex = distx / distance;
movey = disty / distance;
ratio = disty / distx;
if (Number(distx) > 0) {
if (Number(ratio) > 1) {
angle = 90 - ((Math.atan(1 / ratio) * 180) / Math.PI);
} else if ((Number(ratio) > 0) and (Number(ratio) < 1)) {
angle = (Math.atan(ratio) * 180) / Math.PI;
} else if ((Number(ratio) < 0) and (Number(ratio) > Number(-1))) {
angle = 360 + Number((Math.atan(ratio) * 180) / Math.PI);
} else if (Number(ratio) < Number(-1)) {
angle = 270 - ((Math.atan(1 / ratio) * 180) / Math.PI);
}
} else if (Number(distx) < 0) {
if (Number(ratio) > 1) {
angle = 270 - ((Math.atan(1 / ratio) * 180) / Math.PI);
} else if ((Number(ratio) > 0) and (Number(ratio) < 1)) {
angle = 180 + Number((Math.atan(ratio) * 180) / Math.PI);
} else if ((Number(ratio) < 0) and (Number(ratio) > Number(-1))) {
angle = 180 + Number((Math.atan(ratio) * 180) / Math.PI);
} else if (Number(ratio) < Number(-1)) {
angle = 90 - ((Math.atan(1 / ratio) * 180) / Math.PI);
}
} else if (Number(distx) == 0) {
if (Number(disty) > 0) {
angle = -90;
} else if (Number(disty) < 0) {
angle = 90;
} else if (Number(disty) == 0) {
angle = 0;
}
}
_local1._rotation = 0;
_local1._rotation = _local1._rotation + (-angle);
};
sp_weapon.hitMap = function () {
var _local1 = this;
var _local2 = _root;
sp_sound.stop("torpedo");
hitObj = _local2.hitCompArray[_local1.cord[1]][_local1.cord[0]];
if (hitObj != 9) {
_local2.placeHitMark(_local1.cord[0], _local1.cord[1], hitObj);
}
_local2.play();
_local1.removeMovieClip();
};
sp_weapon.onEnterFrame = function () {
var _local1 = this;
if (Number(distance) <= 0) {
_local1.hitMap();
} else {
newx = _local1._x + Number(movex);
newy = _local1._y - movey;
_local1._x = newx;
_local1._y = newy;
distance = distance - 1;
}
};
sp_weapon.onLoad = function () {
var _local1 = this;
_local1.num = 0;
_local1.gotoAndPlay(2);
_local1._x = _local1.startX;
_local1._y = _local1.startY;
_local1.flightPlan();
};
}
function pmove(obj, x, y) {
var _local1 = y;
var _local2 = x;
var _local3 = obj;
temp = hitCompArray[_local1][_local2];
if (temp != 9) {
turn = "lock";
switch (weapon) {
case 0 :
singleHit(_local3, _local2, _local1);
break;
case 1 :
planeHit(_local3, _local2, _local1);
break;
case 2 :
bigBomb(_local3, _local2, _local1);
break;
case 3 :
smartBomb(_local3, _local2, _local1);
}
}
if (weapon > 0) {
armement[weapon - 1] = armement[weapon - 1] - 1;
}
weaponReset();
}
function weaponReset() {
var _local2 = this;
var _local1 = 0;
while (_local1 < armement.length) {
if (armement[_local1] > 0) {
_local2["w_picker" + _local1].gotoAndStop(2);
} else {
_local2["w_picker" + _local1].gotoAndStop(1);
}
_local2["w_picker" + _local1].num = armement[_local1];
_local1++;
}
weapon = 0;
}
function placeHitMark(hitX, hitY, mark) {
var _local1 = this;
var _local2 = mark;
var _local3 = hitY;
if (_local2 != 9) {
name = "exp" + numHit;
_root.hitSpot.duplicateMovieClip(name, 600 + numHit);
_local1[name]._x = (map1._x + 0.2) + (19.1 * hitX);
_local1[name]._y = (map1._y + 0.2) + (19.1 * _local3);
if (typeof(_local2) == "object") {
direction = "Hit";
snd.gotoAndStop("exp");
_local1[name].gotoAndStop(2);
score = score + 100;
_local2.hit = _local2.hit + 1;
if (_local2.hit >= (_local2.size + 1)) {
score = score + 25;
_local2.sunk = true;
name = "qShip" + totalHit;
_local1[_local2.name].duplicateMovieClip(name, 1500 + totalHit);
_local2.clip = _local1[name];
if (_local2.rotate == "hor") {
_local1[name]._x = (map1._x + 0.2) + (19.1 * _local2.cord[0]);
_local1[name]._y = (map1._y + 0.2) + (19.1 * _local2.cord[1]);
_local1[name]._rotation = 0;
} else {
_local1[name]._x = ((map1._x + 0.2) + (19.1 * _local2.cord[0])) + 19.1;
_local1[name]._y = (map1._y + 0.2) + (19.1 * _local2.cord[1]);
_local1[name]._rotation = 90;
}
_local1["cShipCount" + totalHit].gotoAndStop(2);
_local1[name].bs_.gotoAndPlay("sink");
score = score + 1000;
totalHit = totalHit + 1;
}
} else if (_local2 == "bonus") {
name = "bonusHit" + numHit;
_root.bonusSpot.duplicateMovieClip(name, 3122 + numHit);
_local1[name]._x = (map1._x + 0.2) + (19.1 * hitX);
_local1[name]._y = (map1._y + 0.2) + (19.1 * _local3);
_local1[name].gotoAndStop(pickBonus() + 1);
snd.gotoAndStop("miss");
score = score + 1000;
direction = "Bonus";
bonusSound = new Sound();
bonusSound.attachSound("bonusSound");
bonusSound.start();
} else {
score = score - 10;
score = ((score < 0) ? 0 : (score));
snd.gotoAndStop("miss");
direction = "Miss";
}
hitCompArray[_local3][hitX] = 9;
numHit = numHit + 1;
turn = "comp";
if (totalHit == numShip) {
endGame();
}
return(true);
}
return(false);
}
function cmove() {
var _local1 = this;
if (typeof(gotShip) == "object") {
size = gotShip.size + 1;
x = gotShip.cord[0];
y = gotShip.cord[1];
if (gotShip.rotate == "hor") {
t = 0;
while (t < size) {
if (hitArray[y][x + t] != 9) {
hitX = x + t;
hitY = y;
temp = hitArray[y][x + t];
break;
}
t++;
}
} else {
t = 0;
while (t < size) {
if (hitArray[y + t][x] != 9) {
hitX = x;
hitY = y + t;
temp = hitArray[y + t][x];
break;
}
t++;
}
}
} else if (random(difficulty[level]) == 1) {
for (var temp in shipArray) {
if ((shipArray[temp].sunk == false) && (typeof(shipArray[temp]) != "function")) {
hitX = shipArray[temp].cord[0];
hitY = shipArray[temp].cord[1];
temp = hitArray[hitY][hitX];
break;
}
}
} else {
attempt = 0;
last = false;
find = true;
while (find == true) {
hitX = random(gridSize);
hitY = random(gridSize);
temp = hitArray[hitY][hitX];
if (temp != 9) {
find = false;
}
if (attempt == 100) {
find = false;
last = true;
}
attempt = attempt + 1;
}
if (last == true) {
i = 0;
while (i < gridSize) {
r = 0;
while (r < gridSize) {
temp = hitArray[i][r];
if (temp != 9) {
hitX = r;
hitY = i;
break;
}
r++;
}
i++;
}
}
}
if (temp != 9) {
name = "exp" + numHit;
_root.hitSpot.duplicateMovieClip(name, 600 + numHit);
_local1[name]._x = (map0._x + 0.2) + (19.1 * hitX);
_local1[name]._y = (map0._y + 0.2) + (19.1 * hitY);
if (typeof(temp) == "object") {
direction = "Hit";
snd.gotoAndStop("exp");
miss = 1;
_local1[name].gotoAndStop(2);
if (!gotShip) {
gotShip = temp;
}
temp.hit = temp.hit + 1;
temp.clip.bs_.gotoAndStop(temp.hit + 1);
if (temp.hit >= (temp.size + 1)) {
temp.sunk = true;
score = score - 500;
score = ((score < 0) ? 0 : (score));
temp.clip.bs_.gotoAndPlay("sink");
if (temp.type == "aircraft carrier") {
armement[0] = 0;
_root.weaponReset();
}
_local1["pShipCount" + ctotalHit].gotoAndStop(2);
ctotalHit = ctotalHit + 1;
gotShip = false;
}
shakeScreen();
} else {
snd.gotoAndStop("miss");
direction = "Miss";
}
hitArray[hitY][hitX] = 9;
numHit = numHit + 1;
}
if (ctotalHit == numShip) {
turn = "comp";
lost = true;
endGame();
}
}
function pickBonus() {
loop = true;
while (loop) {
p = random(3);
if (!(p === 0)) {
} else {
if (shipArray.ship6.hit == 0) {
armement[0] = armement[0] + 1;
weaponReset();
loop = false;
return(p);
}
continue;
}
armement[p] = armement[p] + 1;
weaponReset();
loop = false;
return(p);
}
}
direction = "your turn";
directionBox(weapon);
stop();
Frame 88
play();
Frame 94
direction = "computer turn";
Frame 101
cmove();
Frame 106
turn = "me";
gotoAndStop ("hold");
Symbol 10 MovieClip [Defaults] Frame 1
#initclip 1
Object.registerClass("Defaults", mx.skins.halo.Defaults);
#endinitclip
Symbol 11 MovieClip [UIObjectExtensions] Frame 1
#initclip 2
Object.registerClass("UIObjectExtensions", mx.core.ext.UIObjectExtensions);
#endinitclip
Symbol 12 MovieClip [UIObject] Frame 1
#initclip 3
Object.registerClass("UIObject", mx.core.UIObject);
#endinitclip
stop();
Symbol 16 MovieClip [FocusRect] Frame 1
#initclip 4
Object.registerClass("FocusRect", mx.skins.halo.FocusRect);
#endinitclip
Symbol 15 Button
on (keyPress "<Tab>") {
this.tabHandler();
}
Symbol 17 MovieClip [FocusManager] Frame 1
#initclip 5
Object.registerClass("FocusManager", mx.managers.FocusManager);
#endinitclip
stop();
Symbol 18 MovieClip [UIComponentExtensions] Frame 1
#initclip 6
Object.registerClass("UIComponentExtensions", mx.core.ext.UIComponentExtensions);
#endinitclip
Symbol 19 MovieClip [UIComponent] Frame 1
#initclip 7
Object.registerClass("UIComponent", mx.core.UIComponent);
#endinitclip
stop();
Symbol 22 MovieClip [ProgBarCapThemeColor] Frame 1
mx.skins.ColoredSkinElement.setColorStyle(this, "themeColor");
Symbol 30 MovieClip [ProgBarMiddleThemeColor] Frame 1
mx.skins.ColoredSkinElement.setColorStyle(this, "themeColor");
Symbol 35 MovieClip [ProgBarIndThemeColor] Frame 1
mx.skins.ColoredSkinElement.setColorStyle(this, "themeColor");
Symbol 36 MovieClip [ProgBarIndMiddleThemeColor] Frame 1
mx.skins.ColoredSkinElement.setColorStyle(this, "themeColor");
Symbol 46 MovieClip [ProgressBar] Frame 1
#initclip 8
Object.registerClass("ProgressBar", mx.controls.ProgressBar);
#endinitclip
stop();
Symbol 77 MovieClip Frame 1
play();
Symbol 77 MovieClip Frame 9
_root.shakeScreen();
Symbol 77 MovieClip Frame 13
gotoAndPlay(this._currentframe + random(45));
Symbol 85 Button
on (release) {
_root.startGame();
gotoAndStop ("makemap");
}
Symbol 93 Button
on (release) {
_root.gotoAndStop("makemap");
}
Symbol 104 MovieClip Frame 1
play();
Symbol 104 MovieClip Frame 69
stop();
_root.cinPlay();
Symbol 109 MovieClip Frame 1
play();
Symbol 109 MovieClip Frame 51
stop();
_root.cinPlay();
Symbol 110 Button
on (release) {
_root.gotoAndStop("start");
}
Symbol 115 MovieClip Frame 31
stop();
gcode = _root.gcode;
gr_game = _root.gr_game;
Score = _root.score;
if (Score < 5) {
Score = 5;
}
getURL ("game.cfm", "_self", "POST");
Symbol 123 MovieClip Frame 15
stop();
Symbol 124 MovieClip Frame 1
i = 2;
while (Number(i) < 50) {
duplicateMovieClip ("isk1", "isk" add i, i);
setProperty("isk" add i, _rotation , random(360));
scalefactor = 40 + Number(random(60));
setProperty("isk" add i, _xscale , scalefactor);
setProperty("isk" add i, _yscale , scalefactor);
i = Number(i) + 1;
}
Symbol 126 MovieClip Frame 15
stop();
Symbol 127 MovieClip Frame 1
i = 2;
while (Number(i) < 50) {
duplicateMovieClip ("isk1", "isk" add i, i);
setProperty("isk" add i, _rotation , random(360));
scalefactor = 40 + Number(random(60));
setProperty("isk" add i, _xscale , scalefactor);
setProperty("isk" add i, _yscale , scalefactor);
i = Number(i) + 1;
}
Symbol 128 MovieClip Frame 34
stop();
Symbol 129 MovieClip Frame 1
i = 2;
while (Number(i) < 50) {
duplicateMovieClip ("isk1", "isk" add i, i);
setProperty("isk" add i, _rotation , random(360));
scalefactor = 40 + Number(random(60));
setProperty("isk" add i, _xscale , scalefactor);
setProperty("isk" add i, _yscale , scalefactor);
tellTarget ("isk" add i) {
gotoAndPlay(random(5));
};
i = Number(i) + 1;
}
Instance of Symbol 121 MovieClip in Symbol 130 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 132 MovieClip Frame 145
stop();
Symbol 133 MovieClip Frame 1
play();
Symbol 133 MovieClip Frame 69
stop();
Instance of Symbol 135 MovieClip "smoke" in Symbol 136 MovieClip Frame 1
onClipEvent (enterFrame) {
this._x = this._x + movx;
this._y = this._y + movy;
if ((((this._x > 80) || (this._x < -80)) || (this._y > 80)) || (this._y < -80)) {
_x = 0;
_y = 0;
_rotation = random(360);
use++;
if ((use > 2) && (num > 15)) {
}
if (use > 8) {
}
}
}
onClipEvent (load) {
use = 0;
}
Symbol 140 MovieClip Frame 1
play();
Instance of Symbol 136 MovieClip "smoke_nachine" in Symbol 140 MovieClip Frame 1
onClipEvent (load) {
var i = 0;
while (i < 50) {
var name = ("smoke" + i);
this.smoke.duplicateMovieClip(name, i);
this[name]._alpha = random(30) + 20;
this[name].movx = random(4) - 4;
this[name].movy = -random(4);
this[name].num = i;
this[name]._x = random(20) - 10;
this[name]._y = random(20) - 10;
i++;
}
}
Instance of Symbol 136 MovieClip "smoke_nachine" in Symbol 140 MovieClip Frame 1
onClipEvent (load) {
var i = 0;
while (i < 50) {
var name = ("smoke" + i);
this.smoke.duplicateMovieClip(name, i);
this[name]._alpha = random(30) + 20;
this[name].movx = random(4) - 4;
this[name].movy = -random(4);
this[name].num = i;
this[name]._x = random(20) - 10;
this[name]._y = random(20) - 10;
i++;
}
}
Instance of Symbol 136 MovieClip "smoke_nachine" in Symbol 140 MovieClip Frame 1
onClipEvent (load) {
var i = 0;
while (i < 50) {
var name = ("smoke" + i);
this.smoke.duplicateMovieClip(name, i);
this[name]._alpha = random(30) + 20;
this[name].movx = random(4) - 4;
this[name].movy = -random(4);
this[name].num = i;
this[name]._x = random(40) - 20;
this[name]._y = random(40) - 20;
i++;
}
}
Instance of Symbol 136 MovieClip "smoke_nachine" in Symbol 140 MovieClip Frame 1
onClipEvent (load) {
var i = 0;
while (i < 50) {
var name = ("smoke" + i);
this.smoke.duplicateMovieClip(name, i);
this[name]._alpha = random(30) + 20;
this[name].movx = random(4) - 4;
this[name].movy = -random(4);
this[name].num = i;
this[name]._x = random(20) - 10;
this[name]._y = random(20) - 10;
i++;
}
}
Instance of Symbol 136 MovieClip "smoke_nachine" in Symbol 140 MovieClip Frame 1
onClipEvent (load) {
var i = 0;
while (i < 50) {
var name = ("smoke" + i);
this.smoke.duplicateMovieClip(name, i);
this[name]._alpha = random(30) + 20;
this[name].movx = random(4) - 4;
this[name].movy = -random(4);
this[name].num = i;
this[name]._x = random(40) - 20;
this[name]._y = random(40) - 20;
i++;
}
}
Instance of Symbol 136 MovieClip "smoke_nachine" in Symbol 140 MovieClip Frame 1
onClipEvent (load) {
var i = 0;
while (i < 50) {
var name = ("smoke" + i);
this.smoke.duplicateMovieClip(name, i);
this[name]._alpha = random(30) + 20;
this[name].movx = random(4) - 4;
this[name].movy = -random(4);
this[name].num = i;
this[name]._x = random(40) - 20;
this[name]._y = random(40) - 20;
i++;
}
}
Symbol 140 MovieClip Frame 69
stop();
Symbol 148 MovieClip Frame 1
stop();
Symbol 148 MovieClip Frame 3
gotoAndStop (1);
Symbol 148 MovieClip Frame 10
gotoAndStop (1);
Symbol 148 MovieClip Frame 13
gotoAndStop (1);
Symbol 153 MovieClip Frame 1
stop();
Symbol 153 MovieClip Frame 2
play();
Symbol 153 MovieClip Frame 8
stop();
Symbol 153 MovieClip Frame 9
hitMap();
play();
Symbol 153 MovieClip Frame 37
flyBack();
Symbol 153 MovieClip Frame 47
stop();
Symbol 155 MovieClip Frame 1
stop();
Symbol 155 MovieClip Frame 2
play();
Symbol 155 MovieClip Frame 44
stop();
Instance of Symbol 159 MovieClip "bub" in Symbol 161 MovieClip Frame 1
onClipEvent (load) {
this._yscale = random(50) + 50;
this._xscale = random(50) + 50;
this.gotoAndPlay(random(this._totalframes + 1));
this.play();
}
Instance of Symbol 159 MovieClip "bub" in Symbol 161 MovieClip Frame 1
onClipEvent (load) {
this._yscale = random(50) + 50;
this._xscale = random(50) + 50;
this.gotoAndPlay(random(this._totalframes + 1));
this.play();
}
Instance of Symbol 159 MovieClip "bub" in Symbol 161 MovieClip Frame 1
onClipEvent (load) {
this._yscale = random(50) + 50;
this._xscale = random(50) + 50;
this.gotoAndPlay(random(this._totalframes + 1));
this.play();
}
Instance of Symbol 159 MovieClip "bub" in Symbol 161 MovieClip Frame 1
onClipEvent (load) {
this._yscale = random(50) + 50;
this._xscale = random(50) + 50;
this.gotoAndPlay(random(this._totalframes + 1));
this.play();
}
Instance of Symbol 159 MovieClip "bub" in Symbol 161 MovieClip Frame 1
onClipEvent (load) {
this._yscale = random(50) + 50;
this._xscale = random(50) + 50;
this.gotoAndPlay(random(this._totalframes + 1));
this.play();
}
Instance of Symbol 159 MovieClip "bub" in Symbol 161 MovieClip Frame 1
onClipEvent (load) {
this._yscale = random(50) + 50;
this._xscale = random(50) + 50;
this.gotoAndPlay(random(this._totalframes + 1));
this.play();
}
Instance of Symbol 159 MovieClip "bub" in Symbol 161 MovieClip Frame 1
onClipEvent (load) {
this._yscale = random(50) + 50;
this._xscale = random(50) + 50;
this.gotoAndPlay(random(this._totalframes + 1));
this.play();
}
Instance of Symbol 159 MovieClip "bub" in Symbol 161 MovieClip Frame 1
onClipEvent (load) {
this._yscale = random(50) + 50;
this._yscale = random(50) + 50;
this.gotoAndPlay(random(this._totalframes + 1));
this.play();
}
Instance of Symbol 159 MovieClip "bub" in Symbol 161 MovieClip Frame 1
onClipEvent (load) {
this._yscale = random(50) + 50;
this._xscale = random(50) + 50;
this.gotoAndPlay(random(this._totalframes + 1));
this.play();
}
Instance of Symbol 159 MovieClip "bub" in Symbol 161 MovieClip Frame 1
onClipEvent (load) {
this._yscale = random(50) + 50;
this._xscale = random(50) + 50;
this.gotoAndPlay(random(this._totalframes + 1));
this.play();
}
Instance of Symbol 159 MovieClip "bub" in Symbol 161 MovieClip Frame 1
onClipEvent (load) {
this._yscale = random(50) + 50;
this._xscale = random(50) + 50;
this.gotoAndPlay(random(this._totalframes + 1));
this.play();
}
Instance of Symbol 159 MovieClip "bub" in Symbol 161 MovieClip Frame 1
onClipEvent (load) {
this._yscale = random(50) + 50;
this._xscale = random(50) + 50;
this.gotoAndPlay(random(this._totalframes + 1));
this.play();
}
Instance of Symbol 159 MovieClip "bub" in Symbol 161 MovieClip Frame 1
onClipEvent (load) {
this._yscale = random(50) + 50;
this._xscale = random(50) + 50;
this.gotoAndPlay(random(this._totalframes + 1));
this.play();
}
Instance of Symbol 159 MovieClip "bub" in Symbol 161 MovieClip Frame 1
onClipEvent (load) {
this._yscale = random(50) + 50;
this._xscale = random(50) + 50;
this.gotoAndPlay(random(this._totalframes + 1));
this.play();
}
Instance of Symbol 159 MovieClip "bub" in Symbol 161 MovieClip Frame 1
onClipEvent (load) {
this._yscale = random(50) + 50;
this._xscale = random(50) + 50;
this.gotoAndPlay(random(this._totalframes + 1));
this.play();
}
Instance of Symbol 159 MovieClip "bub" in Symbol 161 MovieClip Frame 1
onClipEvent (load) {
this._yscale = random(50) + 50;
this._xscale = random(50) + 50;
this.gotoAndPlay(random(this._totalframes + 1));
this.play();
}
Instance of Symbol 159 MovieClip "bub" in Symbol 161 MovieClip Frame 1
onClipEvent (load) {
this._yscale = random(50) + 50;
this._xscale = random(50) + 50;
this.gotoAndPlay(random(this._totalframes + 1));
this.play();
}
Instance of Symbol 159 MovieClip "bub" in Symbol 161 MovieClip Frame 1
onClipEvent (load) {
this._yscale = random(50) + 50;
this._xscale = random(50) + 50;
this.gotoAndPlay(random(this._totalframes + 1));
this.play();
}
Instance of Symbol 159 MovieClip "bub" in Symbol 161 MovieClip Frame 1
onClipEvent (load) {
this._yscale = random(50) + 50;
this._xscale = random(50) + 50;
this.gotoAndPlay(random(this._totalframes + 1));
this.play();
}
Instance of Symbol 159 MovieClip "bub" in Symbol 161 MovieClip Frame 1
onClipEvent (load) {
this._yscale = random(50) + 50;
this._xscale = random(50) + 50;
this.gotoAndPlay(random(this._totalframes + 1));
this.play();
}
Instance of Symbol 159 MovieClip "bub" in Symbol 161 MovieClip Frame 1
onClipEvent (load) {
this._yscale = random(50) + 50;
this._xscale = random(50) + 50;
this.gotoAndPlay(random(this._totalframes + 1));
this.play();
}
Instance of Symbol 159 MovieClip "bub" in Symbol 161 MovieClip Frame 1
onClipEvent (load) {
this._yscale = random(50) + 50;
this._xscale = random(50) + 50;
this.gotoAndPlay(random(this._totalframes + 1));
this.play();
}
Instance of Symbol 159 MovieClip "bub" in Symbol 161 MovieClip Frame 1
onClipEvent (load) {
this._yscale = random(50) + 50;
this._xscale = random(50) + 50;
this.gotoAndPlay(random(this._totalframes + 1));
this.play();
}
Instance of Symbol 159 MovieClip "bub" in Symbol 161 MovieClip Frame 1
onClipEvent (load) {
this._yscale = random(50) + 50;
this._xscale = random(50) + 50;
this.gotoAndPlay(random(this._totalframes + 1));
this.play();
}
Instance of Symbol 159 MovieClip "bub" in Symbol 161 MovieClip Frame 1
onClipEvent (load) {
this._yscale = random(50) + 50;
this._xscale = random(50) + 50;
this.gotoAndPlay(random(this._totalframes + 1));
this.play();
}
Instance of Symbol 159 MovieClip "bub" in Symbol 161 MovieClip Frame 1
onClipEvent (load) {
this._yscale = random(50) + 50;
this._xscale = random(50) + 50;
this.gotoAndPlay(random(this._totalframes + 1));
this.play();
}
Instance of Symbol 159 MovieClip "bub" in Symbol 161 MovieClip Frame 1
onClipEvent (load) {
this._yscale = random(50) + 50;
this._xscale = random(50) + 50;
this.gotoAndPlay(random(this._totalframes + 1));
this.play();
}
Symbol 166 MovieClip Frame 20
_parent.removeMovieClip();
Symbol 168 MovieClip Frame 20
_parent.removeMovieClip();
Symbol 170 MovieClip Frame 21
_parent.removeMovieClip();
Symbol 171 MovieClip Frame 1
stop();
Instance of Symbol 177 MovieClip in Symbol 179 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(this._totalframes) + 1);
}
Instance of Symbol 177 MovieClip in Symbol 179 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(this._totalframes) + 1);
}
Instance of Symbol 177 MovieClip in Symbol 179 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(this._totalframes) + 1);
}
Symbol 182 Button
on (press) {
this.swapDepths(950);
getClip = this._droptarget;
Xpos = _x;
Ypos = _y;
if (Number(fclick) < Number(getTimer())) {
fclick = Number(getTimer()) + 500;
first = true;
} else if (Number(fclick) > Number(getTimer())) {
first = false;
}
startDrag ("", true);
stopDrag();
startDrag ("");
pickUp = true;
}
on (release, releaseOutside) {
stopDrag();
(direction = "Press start when ready.");
if ((Number(fclick) > Number(getTimer())) and (Number(first) == Number(false))) {
rotateMe();
first = true;
} else {
tellTarget ("/snd") {
gotoAndStop ("smack");
};
}
place();
stamp();
}
Symbol 186 Button
on (press) {
this.swapDepths(950);
getClip = this._droptarget;
Xpos = _x;
Ypos = _y;
if (Number(fclick) < Number(getTimer())) {
fclick = Number(getTimer()) + 500;
first = true;
} else if (Number(fclick) > Number(getTimer())) {
first = false;
}
startDrag ("", true);
stopDrag();
startDrag ("");
pickUp = true;
}
on (release, releaseOutside) {
stopDrag();
(direction = "Press start when ready.");
if ((Number(fclick) > Number(getTimer())) and (Number(first) == Number(false))) {
rotateMe();
first = true;
} else {
tellTarget ("/snd") {
gotoAndStop ("smack");
};
}
place();
stamp();
}
Symbol 188 Button
on (release) {
newLevel();
direction = "";
playerMap();
}
Symbol 193 MovieClip Frame 1
stop();
Symbol 193 MovieClip Frame 14
stop();
Symbol 193 MovieClip Frame 30
stop();
Symbol 195 Button
on (press) {
this.swapDepths(950);
getClip = this._droptarget;
Xpos = _x;
Ypos = _y;
if (Number(fclick) < Number(getTimer())) {
fclick = Number(getTimer()) + 500;
first = true;
} else if (Number(fclick) > Number(getTimer())) {
first = false;
}
startDrag ("", true);
stopDrag();
startDrag ("");
pickUp = true;
}
on (release, releaseOutside) {
stopDrag();
(direction = "Press start when ready.");
if ((Number(fclick) > Number(getTimer())) and (Number(first) == Number(false))) {
rotateMe();
first = true;
} else {
tellTarget ("/snd") {
gotoAndStop ("smack");
};
}
place();
stamp();
}
Symbol 198 Button
on (press) {
this.swapDepths(950);
getClip = this._droptarget;
Xpos = _x;
Ypos = _y;
if (Number(fclick) < Number(getTimer())) {
fclick = Number(getTimer()) + 500;
first = true;
} else if (Number(fclick) > Number(getTimer())) {
first = false;
}
startDrag ("", true);
stopDrag();
startDrag ("");
pickUp = true;
}
on (release, releaseOutside) {
stopDrag();
(direction = "Press start when ready.");
if ((Number(fclick) > Number(getTimer())) and (Number(first) == Number(false))) {
rotateMe();
first = true;
} else {
tellTarget ("/snd") {
gotoAndStop ("smack");
};
}
place();
stamp();
}
Symbol 202 Button
on (release) {
if (_root.turn == "me") {
_root.pmove(num, xNum, yNum);
}
}
Symbol 203 MovieClip Frame 1
stop();
Symbol 204 Button
on (release) {
autoPlace();
}
Symbol 215 MovieClip Frame 18
stop();
Symbol 218 MovieClip Frame 17
stop();
Symbol 219 MovieClip Frame 1
stop();
Symbol 219 MovieClip Frame 2
stop();
Instance of Symbol 220 MovieClip "smoke" in Symbol 221 MovieClip Frame 1
onClipEvent (enterFrame) {
this._x = this._x + movx;
this._y = this._y + movy;
if ((((this._x > 30) || (this._x < -30)) || (this._y > 30)) || (this._y < -30)) {
_x = 0;
_y = 0;
use++;
if ((use > 2) && (num > 15)) {
this.removeMovieClip();
}
if (use > 8) {
this.removeMovieClip();
}
}
}
onClipEvent (load) {
use = 0;
}
Symbol 222 MovieClip Frame 1
stop();
Instance of Symbol 221 MovieClip "smoke_nachine" in Symbol 222 MovieClip Frame 2
onClipEvent (load) {
var i = 0;
while (i < 40) {
var name = ("smoke" + i);
this.smoke.duplicateMovieClip(name, i);
this[name]._alpha = random(30) + 20;
this[name].movx = random(4) - 4;
this[name].movy = random(4) - random(4);
this[name].num = i;
this[name]._x = random(20) - 10;
this[name]._y = random(20) - 10;
i++;
}
}
Instance of Symbol 221 MovieClip "smoke_nachine" in Symbol 222 MovieClip Frame 3
onClipEvent (load) {
var i = 0;
while (i < 40) {
var name = ("smoke" + i);
this.smoke.duplicateMovieClip(name, i);
this[name]._alpha = random(30) + 20;
this[name].movx = random(4) - 4;
this[name].movy = random(4) - random(4);
this[name].num = i;
this[name]._x = random(20) - 10;
this[name]._y = random(20) - 10;
i++;
}
}
Instance of Symbol 221 MovieClip "smoke_nachine" in Symbol 222 MovieClip Frame 4
onClipEvent (load) {
var i = 0;
while (i < 40) {
var name = ("smoke" + i);
this.smoke.duplicateMovieClip(name, i);
this[name]._alpha = random(30) + 20;
this[name].movx = random(4) - 4;
this[name].movy = random(4) - random(4);
this[name].num = i;
this[name]._x = random(20) - 10;
this[name]._y = random(20) - 10;
i++;
}
}
Instance of Symbol 221 MovieClip "smoke_nachine" in Symbol 222 MovieClip Frame 5
onClipEvent (load) {
var i = 0;
while (i < 40) {
var name = ("smoke" + i);
this.smoke.duplicateMovieClip(name, i);
this[name]._alpha = random(30) + 20;
this[name].movx = random(4) - 4;
this[name].movy = random(4) - random(4);
this[name].num = i;
this[name]._x = random(20) - 10;
this[name]._y = random(20) - 10;
i++;
}
}
Symbol 222 MovieClip Frame 6
play();
Instance of Symbol 221 MovieClip "smoke_nachine" in Symbol 222 MovieClip Frame 6
onClipEvent (load) {
var i = 0;
while (i < 40) {
var name = ("smoke" + i);
this.smoke.duplicateMovieClip(name, i);
this[name]._alpha = random(30) + 20;
this[name].movx = random(4) - 4;
this[name].movy = random(4) - random(4);
this[name].num = i;
this[name]._x = random(20) - 10;
this[name]._y = random(20) - 10;
i++;
}
}
Instance of Symbol 221 MovieClip "smoke_nachine" in Symbol 222 MovieClip Frame 6
onClipEvent (load) {
var i = 0;
while (i < 40) {
var name = ("smoke" + i);
this.smoke.duplicateMovieClip(name, i);
this[name]._alpha = random(30) + 20;
this[name].movx = random(4) - 4;
this[name].movy = random(4) - random(4);
this[name].num = i;
this[name]._x = random(20) - 10;
this[name]._y = random(20) - 10;
i++;
}
}
Symbol 222 MovieClip Frame 14
stop();
Symbol 224 MovieClip Frame 1
stop();
Instance of Symbol 221 MovieClip "smoke_nachine" in Symbol 224 MovieClip Frame 2
onClipEvent (load) {
var i = 0;
while (i < 40) {
var name = ("smoke" + i);
this.smoke.duplicateMovieClip(name, i);
this[name]._alpha = random(30) + 20;
this[name].movx = random(4) - 4;
this[name].movy = random(4) - random(4);
this[name].num = i;
this[name]._x = random(20) - 10;
this[name]._y = random(20) - 10;
i++;
}
}
Instance of Symbol 221 MovieClip "smoke_nachine" in Symbol 224 MovieClip Frame 3
onClipEvent (load) {
var i = 0;
while (i < 40) {
var name = ("smoke" + i);
this.smoke.duplicateMovieClip(name, i);
this[name]._alpha = random(30) + 20;
this[name].movx = random(4) - 4;
this[name].movy = random(4) - random(4);
this[name].num = i;
this[name]._x = random(20) - 10;
this[name]._y = random(20) - 10;
i++;
}
}
Symbol 224 MovieClip Frame 4
play();
Symbol 224 MovieClip Frame 9
stop();
Symbol 235 MovieClip Frame 1
stop();
interval = (getTimer() + 10000) + random(15000);
Symbol 235 MovieClip Frame 20
stop();
interval = (getTimer() + 10000) + random(15000);
Symbol 236 MovieClip Frame 1
stop();
Instance of Symbol 235 MovieClip "ship" in Symbol 236 MovieClip Frame 1
onClipEvent (load) {
interval = (getTimer() + 10000) + random(15000);
}
onClipEvent (enterFrame) {
if (getTimer() > interval) {
this.play();
}
}
Instance of Symbol 221 MovieClip "smoke_nachine" in Symbol 236 MovieClip Frame 2
onClipEvent (load) {
var i = 0;
while (i < 40) {
var name = ("smoke" + i);
this.smoke.duplicateMovieClip(name, i);
this[name]._alpha = random(30) + 20;
this[name].movx = random(4) - 4;
this[name].movy = random(4) - random(4);
this[name].num = i;
this[name]._x = random(20) - 10;
this[name]._y = random(20) - 10;
i++;
}
}
Instance of Symbol 221 MovieClip "smoke_nachine" in Symbol 236 MovieClip Frame 3
onClipEvent (load) {
var i = 0;
while (i < 40) {
var name = ("smoke" + i);
this.smoke.duplicateMovieClip(name, i);
this[name]._alpha = random(30) + 20;
this[name].movx = random(4) - 4;
this[name].movy = random(4) - random(4);
this[name].num = i;
this[name]._x = random(20) - 10;
this[name]._y = random(20) - 10;
i++;
}
}
Instance of Symbol 221 MovieClip "smoke_nachine" in Symbol 236 MovieClip Frame 4
onClipEvent (load) {
var i = 0;
while (i < 40) {
var name = ("smoke" + i);
this.smoke.duplicateMovieClip(name, i);
this[name]._alpha = random(30) + 20;
this[name].movx = random(4) - 4;
this[name].movy = random(4) - random(4);
this[name].num = i;
this[name]._x = random(20) - 10;
this[name]._y = random(20) - 10;
i++;
}
}
Instance of Symbol 221 MovieClip "smoke_nachine" in Symbol 236 MovieClip Frame 5
onClipEvent (load) {
var i = 0;
while (i < 40) {
var name = ("smoke" + i);
this.smoke.duplicateMovieClip(name, i);
this[name]._alpha = random(30) + 20;
this[name].movx = random(4) - 4;
this[name].movy = random(4) - random(4);
this[name].num = i;
this[name]._x = random(20) - 10;
this[name]._y = random(20) - 10;
i++;
}
}
Symbol 236 MovieClip Frame 7
play();
Symbol 236 MovieClip Frame 13
stop();
Symbol 239 MovieClip Frame 1
stop();
Instance of Symbol 238 MovieClip in Symbol 239 MovieClip Frame 1
onClipEvent (load) {
interval = (getTimer() + 3000) + random(5000);
}
onClipEvent (enterFrame) {
if (getTimer() > interval) {
var i = 0;
while (i < 4) {
if (random(2) == 1) {
name = "t" + i;
this[name].play();
}
i++;
}
interval = (getTimer() + 3000) + random(5000);
}
}
Instance of Symbol 221 MovieClip "smoke_nachine" in Symbol 239 MovieClip Frame 2
onClipEvent (load) {
var i = 0;
while (i < 40) {
var name = ("smoke" + i);
this.smoke.duplicateMovieClip(name, i);
this[name]._alpha = random(30) + 20;
this[name].movx = random(4) - 4;
this[name].movy = random(4) - random(4);
this[name].num = i;
this[name]._x = random(20) - 10;
this[name]._y = random(20) - 10;
i++;
}
}
Instance of Symbol 221 MovieClip "smoke_nachine" in Symbol 239 MovieClip Frame 3
onClipEvent (load) {
var i = 0;
while (i < 40) {
var name = ("smoke" + i);
this.smoke.duplicateMovieClip(name, i);
this[name]._alpha = random(30) + 20;
this[name].movx = random(4) - 4;
this[name].movy = random(4) - random(4);
this[name].num = i;
this[name]._x = random(20) - 10;
this[name]._y = random(20) - 10;
i++;
}
}
Instance of Symbol 221 MovieClip "smoke_nachine" in Symbol 239 MovieClip Frame 4
onClipEvent (load) {
var i = 0;
while (i < 40) {
var name = ("smoke" + i);
this.smoke.duplicateMovieClip(name, i);
this[name]._alpha = random(30) + 20;
this[name].movx = random(4) - 4;
this[name].movy = random(4) - random(4);
this[name].num = i;
this[name]._x = random(20) - 10;
this[name]._y = random(20) - 10;
i++;
}
}
Symbol 239 MovieClip Frame 5
play();
Instance of Symbol 221 MovieClip "smoke_nachine" in Symbol 239 MovieClip Frame 5
onClipEvent (load) {
var i = 0;
while (i < 40) {
var name = ("smoke" + i);
this.smoke.duplicateMovieClip(name, i);
this[name]._alpha = random(30) + 20;
this[name].movx = random(4) - 4;
this[name].movy = random(4) - random(4);
this[name].num = i;
this[name]._x = random(20) - 10;
this[name]._y = random(20) - 10;
i++;
}
}
Instance of Symbol 221 MovieClip "smoke_nachine" in Symbol 239 MovieClip Frame 5
onClipEvent (load) {
var i = 0;
while (i < 40) {
var name = ("smoke" + i);
this.smoke.duplicateMovieClip(name, i);
this[name]._alpha = random(30) + 20;
this[name].movx = random(4) - 4;
this[name].movy = random(4) - random(4);
this[name].num = i;
this[name]._x = random(20) - 10;
this[name]._y = random(20) - 10;
i++;
}
}
Symbol 239 MovieClip Frame 13
stop();
Symbol 243 MovieClip Frame 1
stop();
Symbol 243 MovieClip Frame 2
stop();
Symbol 251 Button
on (release) {
_root.weaponReset();
gotoAndStop (3);
_root.weapon = 1;
_root.directionBox(_root.weapon);
}
Symbol 258 Button
on (release) {
_root.weaponReset();
}
Symbol 259 MovieClip Frame 1
stop();
Symbol 262 Button
on (release) {
_root.weaponReset();
gotoAndStop (3);
_root.weapon = 2;
_root.directionBox(_root.weapon);
}
Symbol 265 MovieClip Frame 1
stop();
Symbol 268 Button
on (release) {
_root.weaponReset();
gotoAndStop (3);
_root.weapon = 3;
_root.directionBox(_root.weapon);
}
Symbol 271 MovieClip Frame 1
stop();
Symbol 280 Button
on (release) {
_root.clear();
lost = true;
gotoAndPlay ("newLevel");
}