[Tools][Expand/Collapse All]Note that automatic extraction of ActionScript 3 is still pretty much unsupported by swfchan. AS1/AS2 works okay most of the time.Frame 119 (25 B)
this.gotoAndStop("120");
Frame 162 (1.04 KiB) ●
scorenumber = 0;
highscorenumber = 0;
Explosions = new Array();
BadShots = new Array();
PlayerShots = new Array();
PShotID = 0;
BShotID = 0;
ExplosionID = 0;
PShotTimer = 0;
UniqueID = 10;
stop();
this.onEnterFrame = function () {
if (PShotTimer > 0) {
PShotTimer--;
}
if (Key.isDown(32)) {
if (PShotTimer < 1) {
PShotID = PShotID + 1;
UniqueID = UniqueID + 1;
if (PShotID == 10) {
PShotID = 1;
}
PlayerShots[PShotID] = MakeObject("PShot", PlayerShotT, UniqueID, PlayerShip._x, PlayerShip._y);
PShotTimer = 10;
}
}
};
md = function (x1, y1, x2, y2) {
x = x1 - x2;
y = y1 - y2;
var _local1 = Math.sqrt((x * x) + (y * y));
if (_local1 == 0) {
_local1 = 999;
}
return(_local1);
};
MakeObject = function (instname, template, id, x, y) {
var _local2;
var _local1 = instname + id;
_local2 = template.duplicateMovieClip(_local1, id);
setProperty(_local1, _x , x);
setProperty(_local1, _y , y);
return(_local2);
};
this.gotoAndStop("162");
o.addVariable("autoPlay", "yes");
Instance of Symbol 30 MovieClip "Alien" in Frame 162 (693 B)
onClipEvent (load) {
xmove = random(15) - random(15);
ymove = random(15) - random(15);
this._x = random(640);
this._y = random(480);
}
onClipEvent (enterFrame) {
this._x = this._x + xmove;
this._y = this._y + ymove;
if (this._x > 640) {
xmove = Math.abs(xmove) * -1;
}
if (this._x < 0) {
xmove = Math.abs(xmove);
}
if (this._y > 480) {
ymove = Math.abs(ymove) * -1;
}
if (this._y < 0) {
ymove = Math.abs(ymove);
}
fire = random(20);
if (fire == 1) {
_root.BShotID = _root.BShotID + 1;
_root.UniqueID = _root.UniqueID + 1;
_root.BadShots[_root.BShotID] = _root.MakeObject("BShot", _root.AlienShotT, _root.UniqueID, _root.Alien._x, _root.Alien._y);
}
}
Instance of Symbol 25 MovieClip "PlayerShip" in Frame 162 (180 B)
onClipEvent (enterFrame) {
if (Key.isDown(39) and (this._x < 640)) {
this._x = this._x + 15;
} else if (Key.isDown(37) and (this._x > 0)) {
this._x = this._x - 15;
}
}
Instance of Symbol 32 MovieClip "AlienShotT" in Frame 162 (797 B)
onClipEvent (load) {
xmove = random(5) - random(5);
ymove = random(5) + 15;
}
onClipEvent (enterFrame) {
this._x = this._x + xmove;
this._y = this._y + ymove;
if (this._y > 480) {
this.removeMovieClip();
}
col = _root.md(_x, _y, _root.PlayerShip._x, _root.PlayerShip._y);
if (col < 25) {
_root.UniqueID++;
_root.ExplosionID++;
_root.Explosions[_root.ExplosionID] = _root.MakeObject("Explosion", _root.ExplosionT, _root.UniqueID, _root.PlayerShip._x, _root.PlayerShip._y);
_root.PlayerShip._x = random(640);
if (_root.scorenumber > _root.highscorenumber) {
_root.highscorenumber = _root.scorenumber;
_root.highscore = "High Score: " + _root.highscorenumber;
}
_root.scorenumber = 0;
_root.score = "Score " + _root.scorenumber;
this.removeMovieClip();
}
}
Instance of Symbol 28 MovieClip "PlayerShotT" in Frame 162 (736 B)
onClipEvent (load) {
xmove = random(5) - random(5);
ymove = (random(5) + 15) * -1;
}
onClipEvent (enterFrame) {
this._x = this._x + xmove;
this._y = this._y + ymove;
if (this._y < 0) {
this.removeMovieClip();
}
col = _root.md(_x, _y, _root.Alien._x, _root.Alien._y);
if (col < 40) {
_root.UniqueID++;
_root.ExplosionID++;
_root.Explosions[_root.ExplosionID] = _root.MakeObject("Explosion", _root.ExplosionT, _root.UniqueID, _root.Alien._x, _root.Alien._y);
_root.Alien._x = random(640);
_root.Alien._y = random(480);
_root.Alien.xmove = random(15) - random(15);
_root.Alien.ymove = random(15) - random(15);
_root.scorenumber++;
_root.score = "Score " + _root.scorenumber;
this.removeMovieClip();
}
}
Frame 163 (1.06 KiB) ●
scorenumber = 0;
highscorenumber = 0;
Explosions = new Array();
BadShots = new Array();
PlayerShots = new Array();
PShotID = 0;
BShotID = 0;
ExplosionID = 0;
PShotTimer = 0;
UniqueID = 10;
stop();
this.onEnterFrame = function () {
if (PShotTimer > 0) {
PShotTimer--;
}
if (Key.isDown(32)) {
if (PShotTimer < 1) {
PShotID = PShotID + 1;
UniqueID = UniqueID + 1;
if (PShotID == 10) {
PShotID = 1;
}
PlayerShots[PShotID] = MakeObject("PShot", PlayerShotT, UniqueID, PlayerShip._x, PlayerShip._y);
PShotTimer = 10;
}
}
};
md = function (x1, y1, x2, y2) {
x = x1 - x2;
y = y1 - y2;
var _local1 = Math.sqrt((x * x) + (y * y));
if (_local1 == 0) {
_local1 = 999;
}
return(_local1);
};
MakeObject = function (instname, template, id, x, y) {
var _local2;
var _local1 = instname + id;
_local2 = template.duplicateMovieClip(_local1, id);
setProperty(_local1, _x , x);
setProperty(_local1, _y , y);
return(_local2);
};
this.gotoAndStop("163");
o.addVariable("autoPlay", "yes");
this.gotoAndStop("163");
Instance of Symbol 30 MovieClip "Alien" in Frame 163 (693 B)
onClipEvent (load) {
xmove = random(15) - random(15);
ymove = random(15) - random(15);
this._x = random(640);
this._y = random(480);
}
onClipEvent (enterFrame) {
this._x = this._x + xmove;
this._y = this._y + ymove;
if (this._x > 640) {
xmove = Math.abs(xmove) * -1;
}
if (this._x < 0) {
xmove = Math.abs(xmove);
}
if (this._y > 480) {
ymove = Math.abs(ymove) * -1;
}
if (this._y < 0) {
ymove = Math.abs(ymove);
}
fire = random(20);
if (fire == 1) {
_root.BShotID = _root.BShotID + 1;
_root.UniqueID = _root.UniqueID + 1;
_root.BadShots[_root.BShotID] = _root.MakeObject("BShot", _root.AlienShotT, _root.UniqueID, _root.Alien._x, _root.Alien._y);
}
}
Instance of Symbol 25 MovieClip "PlayerShip" in Frame 163 (180 B)
onClipEvent (enterFrame) {
if (Key.isDown(39) and (this._x < 640)) {
this._x = this._x + 15;
} else if (Key.isDown(37) and (this._x > 0)) {
this._x = this._x - 15;
}
}
Instance of Symbol 32 MovieClip "AlienShotT" in Frame 163 (797 B)
onClipEvent (load) {
xmove = random(5) - random(5);
ymove = random(5) + 15;
}
onClipEvent (enterFrame) {
this._x = this._x + xmove;
this._y = this._y + ymove;
if (this._y > 480) {
this.removeMovieClip();
}
col = _root.md(_x, _y, _root.PlayerShip._x, _root.PlayerShip._y);
if (col < 25) {
_root.UniqueID++;
_root.ExplosionID++;
_root.Explosions[_root.ExplosionID] = _root.MakeObject("Explosion", _root.ExplosionT, _root.UniqueID, _root.PlayerShip._x, _root.PlayerShip._y);
_root.PlayerShip._x = random(640);
if (_root.scorenumber > _root.highscorenumber) {
_root.highscorenumber = _root.scorenumber;
_root.highscore = "High Score: " + _root.highscorenumber;
}
_root.scorenumber = 0;
_root.score = "Score " + _root.scorenumber;
this.removeMovieClip();
}
}
Instance of Symbol 28 MovieClip "PlayerShotT" in Frame 163 (736 B)
onClipEvent (load) {
xmove = random(5) - random(5);
ymove = (random(5) + 15) * -1;
}
onClipEvent (enterFrame) {
this._x = this._x + xmove;
this._y = this._y + ymove;
if (this._y < 0) {
this.removeMovieClip();
}
col = _root.md(_x, _y, _root.Alien._x, _root.Alien._y);
if (col < 40) {
_root.UniqueID++;
_root.ExplosionID++;
_root.Explosions[_root.ExplosionID] = _root.MakeObject("Explosion", _root.ExplosionT, _root.UniqueID, _root.Alien._x, _root.Alien._y);
_root.Alien._x = random(640);
_root.Alien._y = random(480);
_root.Alien.xmove = random(15) - random(15);
_root.Alien.ymove = random(15) - random(15);
_root.scorenumber++;
_root.score = "Score " + _root.scorenumber;
this.removeMovieClip();
}
}
Instance of Symbol 30 MovieClip "Alien" in Frame 163 (693 B)
onClipEvent (load) {
xmove = random(15) - random(15);
ymove = random(15) - random(15);
this._x = random(640);
this._y = random(480);
}
onClipEvent (enterFrame) {
this._x = this._x + xmove;
this._y = this._y + ymove;
if (this._x > 640) {
xmove = Math.abs(xmove) * -1;
}
if (this._x < 0) {
xmove = Math.abs(xmove);
}
if (this._y > 480) {
ymove = Math.abs(ymove) * -1;
}
if (this._y < 0) {
ymove = Math.abs(ymove);
}
fire = random(20);
if (fire == 1) {
_root.BShotID = _root.BShotID + 1;
_root.UniqueID = _root.UniqueID + 1;
_root.BadShots[_root.BShotID] = _root.MakeObject("BShot", _root.AlienShotT, _root.UniqueID, _root.Alien._x, _root.Alien._y);
}
}
Instance of Symbol 30 MovieClip "Alien" in Frame 163 (693 B)
onClipEvent (load) {
xmove = random(15) - random(15);
ymove = random(15) - random(15);
this._x = random(640);
this._y = random(480);
}
onClipEvent (enterFrame) {
this._x = this._x + xmove;
this._y = this._y + ymove;
if (this._x > 640) {
xmove = Math.abs(xmove) * -1;
}
if (this._x < 0) {
xmove = Math.abs(xmove);
}
if (this._y > 480) {
ymove = Math.abs(ymove) * -1;
}
if (this._y < 0) {
ymove = Math.abs(ymove);
}
fire = random(20);
if (fire == 1) {
_root.BShotID = _root.BShotID + 1;
_root.UniqueID = _root.UniqueID + 1;
_root.BadShots[_root.BShotID] = _root.MakeObject("BShot", _root.AlienShotT, _root.UniqueID, _root.Alien._x, _root.Alien._y);
}
}
Instance of Symbol 30 MovieClip "Alien" in Frame 163 (693 B)
onClipEvent (load) {
xmove = random(15) - random(15);
ymove = random(15) - random(15);
this._x = random(640);
this._y = random(480);
}
onClipEvent (enterFrame) {
this._x = this._x + xmove;
this._y = this._y + ymove;
if (this._x > 640) {
xmove = Math.abs(xmove) * -1;
}
if (this._x < 0) {
xmove = Math.abs(xmove);
}
if (this._y > 480) {
ymove = Math.abs(ymove) * -1;
}
if (this._y < 0) {
ymove = Math.abs(ymove);
}
fire = random(20);
if (fire == 1) {
_root.BShotID = _root.BShotID + 1;
_root.UniqueID = _root.UniqueID + 1;
_root.BadShots[_root.BShotID] = _root.MakeObject("BShot", _root.AlienShotT, _root.UniqueID, _root.Alien._x, _root.Alien._y);
}
}
Frame 164 (0.98 KiB)
scorenumber = 0;
highscorenumber = 0;
Explosions = new Array();
BadShots = new Array();
PlayerShots = new Array();
PShotID = 0;
BShotID = 0;
ExplosionID = 0;
PShotTimer = 0;
UniqueID = 10;
stop();
this.onEnterFrame = function () {
if (PShotTimer > 0) {
PShotTimer--;
}
if (Key.isDown(32)) {
if (PShotTimer < 1) {
PShotID = PShotID + 1;
UniqueID = UniqueID + 1;
if (PShotID == 10) {
PShotID = 1;
}
PlayerShots[PShotID] = MakeObject("PShot", PlayerShotT, UniqueID, PlayerShip._x, PlayerShip._y);
PShotTimer = 10;
}
}
};
md = function (x1, y1, x2, y2) {
x = x1 - x2;
y = y1 - y2;
var _local1 = Math.sqrt((x * x) + (y * y));
if (_local1 == 0) {
_local1 = 999;
}
return(_local1);
};
MakeObject = function (instname, template, id, x, y) {
var _local2;
var _local1 = instname + id;
_local2 = template.duplicateMovieClip(_local1, id);
setProperty(_local1, _x , x);
setProperty(_local1, _y , y);
return(_local2);
};
Instance of Symbol 30 MovieClip "Alien" in Frame 164 (679 B)
onClipEvent (enterFrame) {
if (Key.isDown(20) and (this._x < 640)) {
this._x = this._x + 15;
} else if (Key.isDown(16) and (this._x > 0)) {
this._x = this._x - 15;
}
}
onClipEvent (enterFrame) {
if (this._x > 640) {
xmove = Math.abs(xmove) * -1;
}
if (this._x < 0) {
xmove = Math.abs(xmove);
}
if (this._y > 480) {
ymove = Math.abs(ymove) * -1;
}
if (this._y < 0) {
ymove = Math.abs(ymove);
}
fire = random(10);
if (fire == 2) {
_root.BShotID = _root.BShotID + 1;
_root.UniqueID = _root.UniqueID + 1;
_root.BadShots[_root.BShotID] = _root.MakeObject("BShot", _root.AlienShotT, _root.UniqueID, _root.Alien._x, _root.Alien._y);
}
}
Instance of Symbol 25 MovieClip "PlayerShip" in Frame 164 (180 B)
onClipEvent (enterFrame) {
if (Key.isDown(39) and (this._x < 640)) {
this._x = this._x + 15;
} else if (Key.isDown(37) and (this._x > 0)) {
this._x = this._x - 15;
}
}
Instance of Symbol 32 MovieClip "AlienShotT" in Frame 164 (797 B)
onClipEvent (load) {
xmove = random(5) - random(5);
ymove = random(5) + 15;
}
onClipEvent (enterFrame) {
this._x = this._x + xmove;
this._y = this._y + ymove;
if (this._y > 480) {
this.removeMovieClip();
}
col = _root.md(_x, _y, _root.PlayerShip._x, _root.PlayerShip._y);
if (col < 25) {
_root.UniqueID++;
_root.ExplosionID++;
_root.Explosions[_root.ExplosionID] = _root.MakeObject("Explosion", _root.ExplosionT, _root.UniqueID, _root.PlayerShip._x, _root.PlayerShip._y);
_root.PlayerShip._x = random(640);
if (_root.scorenumber > _root.highscorenumber) {
_root.highscorenumber = _root.scorenumber;
_root.highscore = "High Score: " + _root.highscorenumber;
}
_root.scorenumber = 0;
_root.score = "Score " + _root.scorenumber;
this.removeMovieClip();
}
}
Instance of Symbol 28 MovieClip "PlayerShotT" in Frame 164 (736 B)
onClipEvent (load) {
xmove = random(5) - random(5);
ymove = (random(5) + 15) * -1;
}
onClipEvent (enterFrame) {
this._x = this._x + xmove;
this._y = this._y + ymove;
if (this._y < 0) {
this.removeMovieClip();
}
col = _root.md(_x, _y, _root.Alien._x, _root.Alien._y);
if (col < 40) {
_root.UniqueID++;
_root.ExplosionID++;
_root.Explosions[_root.ExplosionID] = _root.MakeObject("Explosion", _root.ExplosionT, _root.UniqueID, _root.Alien._x, _root.Alien._y);
_root.Alien._x = random(640);
_root.Alien._y = random(480);
_root.Alien.xmove = random(15) - random(15);
_root.Alien.ymove = random(15) - random(15);
_root.scorenumber++;
_root.score = "Score " + _root.scorenumber;
this.removeMovieClip();
}
}
Symbol 13 Button (65 B)
on (release) {
getURL ("http://www.newgrounds.com", "_blank");
}
Symbol 19 MovieClip Frame 1 (1.53 KiB) ●
function timerHandler() {
if (!loadingComplete) {
var _local4 = _root.getBytesLoaded() / _root.getBytesTotal();
bar._yscale = 100 * _local4;
if (_local4 == 1) {
loadingComplete = true;
if (AUTO_PLAY) {
startMovie();
} else {
gotoAndStop ("loaded");
}
return(undefined);
}
}
dt = getTimer() - time;
time = time + dt;
frameAccum = frameAccum + dt;
var _local3 = 0;
while ((frameAccum >= FRAME_TIME) && (_local3 < MAX_FRAME_SKIP)) {
advanceFrame(tankLogo, true, true);
advanceFrame(loadingText, false, true);
advanceFrame(barGfx, false, true);
if (loadingComplete) {
advanceFrame(this, false, false);
}
(frameAccum = frameAccum - FRAME_TIME);
_local3++;
}
updateAfterEvent();
}
function advanceFrame(clip, recurse, loop) {
if (!clip) {
return(undefined);
}
clip.stop();
if (clip._currentframe == clip._totalframes) {
if (loop) {
clip.gotoAndStop(1);
}
} else {
clip.nextFrame();
}
if (recurse) {
for (childName in clip) {
if (typeof(clip[childName]) == "movieclip") {
advanceFrame(clip[childName], recurse, loop);
}
}
}
}
function startMovie() {
clearInterval(intervalId);
_root.play();
}
_root.stop();
stop();
var FRAME_TIME = 33.3333333333333;
var AUTO_PLAY = false;
var MAX_FRAME_SKIP = 5;
var loadingComplete;
var intervalId;
var time;
var frameAccum;
loadingComplete = false;
intervalId = setInterval(this, "timerHandler", FRAME_TIME / 2);
frameAccum = 0;
time = getTimer();
timerHandler();
Symbol 19 MovieClip Frame 72 (14 B)
startMovie();
Symbol 35 Button (42 B)
on (release) {
this.gotoAndStop("162");
}
Symbol 39 Button (42 B)
on (release) {
this.gotoAndStop("163");
}
Symbol 43 Button (42 B)
on (release) {
this.gotoAndStop("164");
}
Symbol 47 MovieClip Frame 10 (64 B)
this.onEnterFrame = function () {
this.removeMovieClip();
};
Symbol 53 Button (42 B)
on (release) {
this.gotoAndPlay("119");
}