Frame 1
fscommand ("allowscale", "false");
fscommand ("showmenu", "false");
stop();
Instance of Symbol 19 MovieClip in Frame 1
onClipEvent (enterFrame) {
text = ((int(_parent.getBytesLoaded() / 1000) add " KBYTES OF ") add int(_parent.getBytesTotal() / 1000)) add " LOADED ...";
if (_parent.getBytesTotal() == _parent.getBytesLoaded()) {
_parent.gotoAndStop(2);
}
}
Frame 2
function setupgame() {
game = {};
game.sw = 400;
game.sh = 400;
game.enemy_speed = 4;
game.enemy_num = 1;
game.enemy_size = 10;
game.mysize = 15;
game.myspeed = 10;
game.bonusspeed = 2;
game.bonus = false;
game.lvl = 0;
game.time = 0;
game.lvltime = 0;
}
function rungame() {
mc = gamemc.me;
if (game.time == 0) {
game.time = getTimer();
}
if (getTimer() >= game.lvltime) {
game.lvltime = getTimer() + 5000;
game.lvl++;
game.mysize = game.mysize + 4;
mc._width = game.mysize;
mc._height = game.mysize;
mc.me.gotoAndPlay(30);
}
border.lvl = game.lvl;
border.time = Math.round((getTimer() - game.time) / 1000);
if (gamemc._xmouse < (game.mysize / 2)) {
gamemc.xmouse = game.mysize / 2;
} else if ((game.sw - (game.mysize / 2)) < gamemc._xmouse) {
gamemc.xmouse = game.sw - (game.mysize / 2);
} else {
gamemc.xmouse = gamemc._xmouse;
}
if (gamemc._ymouse < (game.mysize / 2)) {
gamemc.ymouse = game.mysize / 2;
} else if ((game.sh - (game.mysize / 2)) < gamemc._ymouse) {
gamemc.ymouse = game.sh - (game.mysize / 2);
} else {
gamemc.ymouse = gamemc._ymouse;
}
if (gamemc.xmouse != mc._x) {
mc._x = mc._x + ((gamemc.xmouse - mc._x) / game.myspeed);
}
if (gamemc.ymouse != mc._y) {
mc._y = mc._y + ((gamemc.ymouse - mc._y) / game.myspeed);
}
for (var name in gamemc:en) {
var _local1 = gamemc.en[name];
if ((_local1.stopTime < getTimer()) && (_local1.stopped != undefined)) {
if (_local1.stopped) {
_local1.stopped = false;
_local1.legs.gotoAndStop(1);
if (_local1.smart) {
rotateTowards(_local1, mc._x, mc._y, _local1.enemy_speed);
}
_local1.stopTime = (getTimer() + 1000) + random(5000);
} else {
_local1.stopped = true;
_local1.legs.gotoAndStop(2);
_local1.stopTime = getTimer() + random(3000);
}
}
if (_local1.stopped != true) {
_local1._x = _local1._x + _local1.xmov;
_local1._y = _local1._y + _local1.ymov;
}
if (((((game.sw + 40) < _local1._x) || (_local1._x < -40)) || ((game.sh + 40) < _local1._y)) || (_local1._y < -40)) {
removeMovieClip(_local1);
}
var _local2 = _local1._y - mc._y;
var _local3 = _local1._x - mc._x;
var dist = (game.enemy_size + (game.mysize / 2));
if ((((_local2 * _local2) + (_local3 * _local3)) < (dist * dist)) && (!game.ending)) {
if (!_local1.bonus) {
game.lvltime = getTimer() + 50000;
mc.me.gotoAndPlay(2);
mc.shadow._visible = false;
game.ending = true;
continue;
}
game.mysize = game.mysize - 8;
mc._width = game.mysize;
mc._height = game.mysize;
mc.me.gotoAndPlay(30);
removeMovieClip(_local1);
game.bonus = false;
}
}
if ((970 - game.lvl) < random(1000)) {
startEnemy(game.enemy_num);
}
if (((random(1000) > 995) && (!game.bonus)) && (game.mysize > 23)) {
addBonus(game.enemy_num);
}
}
function startEnemy(num) {
var _local3 = num;
gamemc.en.attachMovie("enemy", "enemy" + _local3, _local3);
var _local1 = gamemc.en["enemy" + _local3];
var _local2 = random(4);
if (_local2 == 0) {
_local1._x = -40;
_local1._y = random(game.sh);
} else if (_local2 == 1) {
_local1._x = game.sw + 40;
_local1._y = random(game.sh);
} else if (_local2 == 2) {
_local1._x = random(game.sw);
_local1._y = game.sh + 40;
} else if (_local2 == 3) {
_local1._x = random(game.sw);
_local1._y = -40;
}
_local2 = random(Math.round(game.lvl / 3));
if (_local2 > 2) {
_local2 = 2;
}
if (_local2 == 0) {
_local1.body.gotoAndStop(1);
_local1.enemy_speed = game.enemy_speed;
} else if (_local2 == 1) {
_local1.body.gotoAndStop(2);
_local1.enemy_speed = game.enemy_speed + 1;
_local1.stopTime = (getTimer() + 1000) + random(5000);
_local1.stopped = false;
} else if (_local2 == 2) {
_local1.body.gotoAndStop(3);
_local1.enemy_speed = game.enemy_speed - 1;
_local1.stopTime = (getTimer() + 1000) + random(5000);
_local1.stopped = false;
_local1.smart = true;
}
rotateTowards(_local1, mc._x, mc._y, _local1.enemy_speed);
game.enemy_num++;
if (game.enemy_num > 100) {
game.enemy_num = 1;
}
soundmc.play();
}
function addBonus(num) {
gamemc.en.attachMovie("bonus", "bonus", num);
var _local1 = gamemc.en.bonus;
var _local2 = random(4);
if (_local2 == 0) {
_local1._x = -40;
_local1._y = random(game.sh);
_local1.xmov = game.bonusspeed;
_local1.ymov = 0;
} else if (_local2 == 1) {
_local1._x = game.sw + 40;
_local1._y = random(game.sh);
_local1.xmov = -game.bonusspeed;
_local1.ymov = 0;
} else if (_local2 == 2) {
_local1._x = random(game.sw);
_local1._y = game.sh + 40;
_local1.ymov = -game.bonusspeed;
_local1.xmov = 0;
} else if (_local2 == 3) {
_local1._x = random(game.sw);
_local1._y = -40;
_local1.ymov = game.bonusspeed;
_local1.xmov = 0;
}
_local1.bonus = true;
game.bonus = true;
game.enemy_num++;
if (game.enemy_num > 100) {
game.enemy_num = 1;
}
_local1.play();
}
function rotateTowards(clip, targetX, targetY, speed) {
var _local1 = clip;
var _local2 = {x:_local1._x, y:_local1._y};
_local1._parent.localToGlobal(_local2);
var deltaX = (targetX - _local2.x);
var deltaY = (targetY - _local2.y);
var _local3 = Math.atan2(deltaY, deltaX);
var rotationAngle = radiansToDegrees(_local3);
_local1.xmov = speed * Math.cos(_local3);
_local1.ymov = speed * Math.sin(_local3);
_local1._rotation = rotationAngle;
}
function radiansToDegrees(radians) {
return((radians / 3.141593) * 180);
}
border.lvl = 0;
border.time = 0;
Instance of Symbol 43 MovieClip in Frame 3
onClipEvent (load) {
_root.setupgame();
}
onClipEvent (enterFrame) {
_root.rungame();
}
Symbol 5 MovieClip Frame 1
stop();
Symbol 16 MovieClip [bonus] Frame 5
stop();
Symbol 24 Button
on (release) {
gotoAndStop (3);
}
Symbol 41 MovieClip Frame 1
stop();
Symbol 51 MovieClip Frame 1
stop();
Symbol 51 MovieClip Frame 25
_root.gotoAndStop(4);
stop();
Symbol 54 Button
on (release) {
gotoAndStop (2);
}