Frame 3
stop();
Instance of Symbol 56 MovieClip "player" in Frame 3
onClipEvent (load) {
gravity = 10;
walkSpeed = 5;
maxJump = 20;
scale = _xscale;
}
onClipEvent (enterFrame) {
if (Key.isDown(37)) {
_xscale = (-scale);
_x = (_x - walkSpeed);
this.gotoAndStop(2);
}
if (Key.isDown(39)) {
_xscale = scale;
_x = (_x + walkSpeed);
this.gotoAndStop(2);
}
if (air == true) {
_y = (_y + gravity);
state = 3;
}
if (_root.platforms.hitTest(_x, _y, true)) {
air = false;
} else {
air = true;
}
if (Key.isDown(38) && (jump == true)) {
_y = (_y - jumpSpeed);
gotoAndStop (5);
}
if (air == false) {
jump = true;
jumpcount = 1;
jumpSpeed = 15;
}
if (Key.isDown(38)) {
jumpcount = jumpcount + 1;
this.gotoAndStop(3);
}
if ((jumpcount > maxjump) && (jumpSpeed > -2)) {
jumpSpeed = jumpSpeed - 2;
}
}
onClipEvent (keyUp) {
this.gotoAndStop(1);
walkSpeed = 5;
}
onClipEvent (enterFrame) {
if (this._x >= 550) {
this._x = 545;
}
if (this._x <= 10) {
this._x = 15;
}
while (_root.walls.hitTest(_x, _y + radius, true)) {
_y = (_y-1);
}
while (_root.walls.hitTest(_x, _y - radius, true)) {
_y = (_y+1);
}
while (_root.walls.hitTest(_x - radius, _y, true)) {
_x = (_x+1);
}
while (_root.walls.hitTest(_x + radius, _y, true)) {
_x = (_x-1);
}
}
Frame 4
stop();
Symbol 41 Button
on (release) {
getURL ("http://www.newgrounds.com", "_blank");
}
Symbol 50 Button
on (release) {
startMovie();
}
Symbol 52 MovieClip Frame 1
function timerHandler() {
if (!loadingComplete) {
var loaded = (_root.getBytesLoaded() / _root.getBytesTotal());
bar._xscale = 100 * loaded;
if (loaded == 1) {
loadingComplete = true;
if (AUTO_PLAY) {
startMovie();
} else {
gotoAndStop (2);
}
return(undefined);
}
}
dt = getTimer() - time;
time = time + dt;
frameAccum = frameAccum + dt;
var i = 0;
while ((frameAccum >= FRAME_TIME) && (i < 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);
i++;
}
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 52 MovieClip Frame 2
stop();