Frame 1
Stage.scaleMode = "noScale";
var resizeL = new Object();
resizeL.onResize = function () {
trace((("Stage size is now " + Stage.width) + " by ") + Stage.height);
trace(_root.button_inst._root.btn_hit_mc._width);
};
Stage.addListener(resizeL);
Frame 180
_quality = "MEDIUM";
stop();
var goMCX = goMC._x;
var instructionsBtnX = go2MC._x;
Mouse.show();
startBtn.onRollOver = function () {
var _local1 = new Sound();
_local1.attachSound("rolloverWav");
_local1.start(0, 0);
var _local2 = new mx.transitions.Tween(goMC, "_x", mx.transitions.easing.Elastic.easeOut, goMC._x, goMCX + 60, 1, true);
};
startBtn.onRollOut = function () {
var _local1 = new mx.transitions.Tween(goMC, "_x", mx.transitions.easing.Regular.easeOut, goMC._x, goMCX, 1, true);
};
startBtn.onRelease = function () {
nextFrame();
};
instructionsBtn.onRollOver = function () {
var _local1 = new Sound();
_local1.attachSound("rolloverWav");
_local1.start(0, 0);
var _local2 = new mx.transitions.Tween(go2MC, "_x", mx.transitions.easing.Elastic.easeOut, go2MC._x, instructionsBtnX + 130, 1, true);
};
instructionsBtn.onRollOut = function () {
var _local1 = new mx.transitions.Tween(go2MC, "_x", mx.transitions.easing.Regular.easeOut, go2MC._x, instructionsBtnX, 1, true);
};
playMoreBtn.onRollOver = function () {
var _local1 = new Sound();
_local1.attachSound("rolloverWav");
_local1.start(0, 0);
var _local2 = new mx.transitions.Tween(go3MC, "_x", mx.transitions.easing.Elastic.easeOut, go3MC._x, playMoreBtn._x + 135, 1, true);
};
playMoreBtn.onRollOut = function () {
var _local1 = new mx.transitions.Tween(go3MC, "_x", mx.transitions.easing.Regular.easeOut, go3MC._x, playMoreBtn._x, 1, true);
};
playMoreBtn.onRelease = function () {
getURL ("http://www.thatvideogamesite.com", "blank");
};
gf = new flash.filters.GlowFilter(255, 100, 8, 8, 8, 1, false, false);
var gfBX = (new mx.transitions.Tween(gf, "blurX", mx.transitions.easing.Regular.easeOut, 5, 15, 2, true));
var gfBY = (new mx.transitions.Tween(gf, "blurY", mx.transitions.easing.Regular.easeOut, 5, 15, 2, true));
ichiBan.filters = [gf];
blurFilter = new flash.filters.BlurFilter(8, 8, 1);
ichiBan.filters = [blurFilter, gf];
gfBX.onMotionChanged = function () {
ichiBan.filters = [blurFilter, gf];
};
gfBX.onMotionFinished = function () {
this.yoyo();
};
gfBY.onMotionFinished = function () {
this.yoyo();
};
gf2 = new flash.filters.GlowFilter(16711680, 100, 2, 2, 8, 3, true, true);
var gfBX2 = (new mx.transitions.Tween(gf2, "blurX", mx.transitions.easing.Regular.easeInOut, 0, 8, 2, true));
var gfBY2 = (new mx.transitions.Tween(gf2, "blurY", mx.transitions.easing.Regular.easeInOut, 0, 8, 2, true));
ichiGo.filters = [gf2];
blurFilter2 = new flash.filters.BlurFilter(4, 4, 1);
ichiGo.filters = [blurFilter2, gf2];
gfBX2.onMotionChanged = function () {
ichiGo.filters = [blurFilter, gf2];
};
gfBX2.onMotionFinished = function () {
this.yoyo();
};
gfBY2.onMotionFinished = function () {
this.yoyo();
};
instructionsBtn.onRelease = function () {
instructionsMC._visible = !instructionsMC._visible;
};
instructionsMC._visible = false;
clip = this;
instructionsMC.highBtn.onRelease = function () {
clip._quality = "HIGH";
};
instructionsMC.mediumBtn.onRelease = function () {
clip._quality = "MEDIUM";
};
instructionsMC.lowBtn.onRelease = function () {
clip._quality = "LOW";
};
Frame 181
Mouse.hide();
var engine = new Engine();
var player = new PlayerShip(player_mc, this);
engine.setPlayer(player);
bg_mc.onMouseDown = player.OnMousePress;
_root.useHandCursor = false;
var frames = 0;
var lastSecond = getTimer();
onMouseUp = function () {
player.CanWeFire = false;
};
onEnterFrame = function () {
player.Update();
engine.Update();
};
var numRows = 9;
var numCols = 7;
var gap = 80;
var i = 0;
while (i < numRows) {
var j = 0;
while (j < numCols) {
stars1.attachMovie("node", "node" + ((i * numCols) + j), stars1.getNextHighestDepth());
stars1["node" + ((i * numCols) + j)]._x = (i * gap) + 80;
stars1["node" + ((i * numCols) + j)]._y = (j * gap) + 60;
stars1["node" + ((i * numCols) + j)].origX = stars1["node" + ((i * numCols) + j)]._x;
stars1["node" + ((i * numCols) + j)].origY = stars1["node" + ((i * numCols) + j)]._y;
j++;
}
i++;
}
backBtn._visible = false;
backBtn.onRelease = function () {
removeMovieClip(cursor_mc);
removeMovieClip(score_mc);
_root.prevFrame();
};
engine.StartGameEffect();
Symbol 25 MovieClip [explosion] Frame 13
removeMovieClip(this);
Symbol 86 Button
on (release) {
getURL ("http://www.thatvideogamesite.com/", "_blank");
}
Symbol 158 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 159 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 160 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 161 MovieClip [__Packages.mx.transitions.easing.Elastic] Frame 0
class mx.transitions.easing.Elastic
{
function Elastic () {
}
static function easeIn(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / d;
if (t == 1) {
return(b + c);
}
if (!p) {
p = d * 0.3;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
t = t - 1;
return((-((a * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p))) + b);
}
static function easeOut(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / d;
if (t == 1) {
return(b + c);
}
if (!p) {
p = d * 0.3;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
return((((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p)) + c) + b);
}
static function easeInOut(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / (d / 2);
if (t == 2) {
return(b + c);
}
if (!p) {
p = d * 0.45;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
if (t < 1) {
t = t - 1;
return((-0.5 * ((a * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p))) + b);
}
t = t - 1;
return(((((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p)) * 0.5) + c) + b);
}
static var version = "1.1.0.52";
}
Symbol 162 MovieClip [__Packages.mx.transitions.easing.Regular] Frame 0
class mx.transitions.easing.Regular
{
function Regular () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
static var version = "1.1.0.52";
}
Symbol 163 MovieClip [__Packages.PlayerShip] Frame 0
class PlayerShip
{
var MainMC, mc, enabled, gf, blurFilter, cursorMC, BulletNumber, bullets, weapon, dx, dy, SPEED, FRICTION, CurState, NumTweens, TotalKills, KillGoal, gridWarpID, fireTimer, fireRate, CanWeFire, BulletSpeed, lives, RADTODEG;
function PlayerShip (MC, MMC) {
MainMC = MMC;
mc = MC;
enabled = true;
gf = new flash.filters.GlowFilter(255, 100, 8, 8, 8, 1, false, false);
var _local2 = this;
blurFilter = new flash.filters.BlurFilter(8, 8, 1);
mc.filters = [blurFilter, gf];
MainMC.attachMovie("cursor", "cursor_mc", MainMC.getNextHighestDepth());
cursorMC = MainMC.cursor_mc;
cursorMC.cacheAsBitmap = true;
BulletNumber = 0;
bullets = new Array();
weapon = "lazer";
dx = (dy = 0);
SPEED = 1;
FRICTION = 0.25;
CurState = "IDLE";
NumTweens = 0;
TotalKills = 0;
KillGoal = 10;
gridWarpID = -1;
fireTimer = getTimer();
fireRate = 140;
CanWeFire = false;
BulletSpeed = 15;
lives = 3;
RADTODEG = 57.29577951;
MainMC.playerLives.text = lives;
}
function Update() {
MouseUpdate();
KeyBoardUpdate();
UpdateBullets();
}
function MouseUpdate() {
cursorMC._x = MainMC._xmouse;
cursorMC._y = MainMC._ymouse;
var _local2 = MainMC._xmouse - mc._x;
var _local3 = MainMC._ymouse - mc._y;
var _local7 = Math.sqrt(Math.pow(_local2, 2) + Math.pow(_local3, 2));
_local2 = _local2 / _local7;
_local3 = _local3 / _local7;
var _local4 = 1;
if (_local3 > 0) {
_local2 = _local2 * -1;
_local4 = -1;
if (mc._xscale > 0) {
mc._yscale = mc._yscale * -1;
mc._xscale = mc._xscale * -1;
}
} else if (mc._xscale < 0) {
mc._yscale = mc._yscale * -1;
mc._xscale = mc._xscale * -1;
}
mc._rotation = _local2 * 90;
cursorMC.swapDepths(MainMC.getNextHighestDepth());
mc.swapDepths(MainMC.getNextHighestDepth());
if (!enabled) {
return(undefined);
}
if (CanWeFire) {
if ((getTimer() - fireTimer) > fireRate) {
fireTimer = getTimer();
switch (weapon) {
case "lazer" :
var _local6 = new Sound();
_local6.attachSound("lazerWav");
_local6.start(0, 0);
var _local5 = new CBullet(mc, _level, BulletNumber++, BulletSpeed, _local2 * 8, _local3 * 8, weapon);
_local5.MC._yscale = _local5.MC._yscale * _local4;
_local5.MC._rotation = _local2 * 90;
mc._rotation = _local5.MC._rotation;
var _local8 = new flash.filters.GlowFilter(255, 70, 16, 16, 2, 2, false, false);
_local5.MC.filters = [_local8];
bullets.push(_local5);
break;
case "spread" :
_local6 = new Sound();
_local6.attachSound("spreadWav");
_local6.start(0, 0);
_local5 = new CBullet(mc, _level, BulletNumber++, BulletSpeed, _local2 * 8, _local3 * 8, weapon);
_local5.MC._yscale = _local5.MC._yscale * _local4;
_local5.MC._rotation = _local2 * 90;
mc._rotation = _local5.MC._rotation;
bullets.push(_local5);
_local5 = new CBullet(mc, _level, BulletNumber++, BulletSpeed, _local2 * 8, _local3 * 8, weapon);
_local5.MC._yscale = _local5.MC._yscale * _local4;
_local5.MC._rotation = _local2 * 90;
mc._rotation = _local5.MC._rotation;
bullets.push(_local5);
_local5 = new CBullet(mc, _level, BulletNumber++, BulletSpeed, _local2 * 8, _local3 * 8, weapon);
_local5.MC._yscale = _local5.MC._yscale * _local4;
_local5.MC._rotation = _local2 * 90;
mc._rotation = _local5.MC._rotation;
bullets.push(_local5);
break;
case "rapidFire" :
_local6 = new Sound();
_local6.attachSound("rapidFireWav");
_local6.start(0, 0);
_local5 = new CBullet(mc, _level, BulletNumber++, BulletSpeed, _local2 * 8, _local3 * 8, weapon);
_local5.MC._yscale = _local5.MC._yscale * _local4;
_local5.MC._rotation = _local2 * 90;
mc._rotation = _local5.MC._rotation;
_local8 = new flash.filters.GlowFilter(16776960, 70, 16, 16, 2, 2, false, false);
_local5.MC.filters = [_local8];
bullets.push(_local5);
}
}
}
}
function OnMousePress() {
_level.player.CanWeFire = true;
}
function UpdateBullets() {
var _local2 = 0;
while (_local2 < bullets.length) {
if (bullets[_local2].Update()) {
bullets.splice(_local2, 1);
}
_local2++;
}
GridWarping();
}
function KeyBoardUpdate() {
if (!enabled) {
return(undefined);
}
var _local3 = true;
if (Key.isDown(37) || (Key.isDown(65))) {
CurState = "MOVE";
dx = dx - SPEED;
if (dx < -5) {
dx = -5;
}
_local3 = false;
} else if (Key.isDown(39) || (Key.isDown(68))) {
CurState = "MOVE";
dx = dx + SPEED;
if (dx > 5) {
dx = 5;
}
_local3 = false;
}
var _local2 = true;
if (Key.isDown(38) || (Key.isDown(87))) {
CurState = "MOVE";
dy = dy - SPEED;
if (dy < -5) {
dy = -5;
}
_local2 = false;
} else if (Key.isDown(40) || (Key.isDown(83))) {
CurState = "MOVE";
dy = dy + SPEED;
if (dy > 5) {
dy = 5;
}
_local2 = false;
}
if (_local3) {
CurState = "IDLE";
if (dx < 0) {
dx = dx + (SPEED * FRICTION);
} else if (dx > 0) {
dx = dx - (SPEED * FRICTION);
}
}
if (_local2) {
CurState = "IDLE";
if (dy < 0) {
dy = dy + (SPEED * FRICTION);
} else if (dy > 0) {
dy = dy - (SPEED * FRICTION);
}
}
blurFilter.blurX = Math.abs(dx * 1);
blurFilter.blurY = Math.abs(dy * 1);
mc.filters = [blurFilter, gf];
if (((mc._x + dx) > 0) && ((mc._x + dx) < 550)) {
mc._x = mc._x + dx;
MainMC.stars1._x = MainMC.stars1._x - (dx * 0.1);
MainMC.stars2._x = MainMC.stars2._x - (dx * 0.075);
MainMC.stars3._x = MainMC.stars3._x - (dx * 0.01);
}
if (((mc._y + dy) > 0) && ((mc._y + dy) < 400)) {
mc._y = mc._y + dy;
MainMC.stars1._y = MainMC.stars1._y - (dy * 0.1);
MainMC.stars2._y = MainMC.stars2._y - (dy * 0.075);
MainMC.stars3._y = MainMC.stars3._y - (dy * 0.01);
}
}
function GridWarping() {
if (gridWarpID == -1) {
var thisMC = this;
gridWarpID = setInterval(function () {
if (thisMC.NumTweens < 40) {
var _local7 = 1;
if (thisMC.weapon == "lazer") {
_local7 = 2;
}
if (thisMC.weapon == "spread") {
_local7 = 8;
}
if (thisMC.weapon == "rapidFire") {
_local7 = 8;
}
var _local3 = 0;
while (_local3 < thisMC.bullets.length) {
var _local2 = 0;
while (_local2 < (thisMC.MainMC.numRows * thisMC.MainMC.numCols)) {
if (thisMC.MainMC.stars1["node" + _local2].hitTest(thisMC.bullets[_local3].MC)) {
var _local4 = new mx.transitions.Tween(thisMC.MainMC.stars1["node" + _local2], "_x", mx.transitions.easing.Bounce.easeOut, thisMC.MainMC.stars1["node" + _local2]._x + ((thisMC.bullets[_local3].dx * 40) * thisMC.MainMC.engine.BulletSize), thisMC.MainMC.stars1["node" + _local2].origX, 1 * thisMC.MainMC.engine.EnemySPEED, true);
var _local5 = new mx.transitions.Tween(thisMC.MainMC.stars1["node" + _local2], "_y", mx.transitions.easing.Bounce.easeOut, thisMC.MainMC.stars1["node" + _local2]._y + ((thisMC.bullets[_local3].dy * 40) * thisMC.MainMC.engine.BulletSize), thisMC.MainMC.stars1["node" + _local2].origY, 1 * thisMC.MainMC.engine.EnemySPEED, true);
thisMC.NumTweens++;
var _local6 = this;
_local4.onMotionFinished = function () {
thisMC.NumTweens--;
};
}
_local2++;
}
_local3 = _local3 + _local7;
}
}
}, 150);
}
}
}
Symbol 164 MovieClip [__Packages.CBullet] Frame 0
class CBullet
{
var PlayerMC, MainMC, MC, dx, dy, SPEED;
function CBullet (PMC, MMC, number, speed, xOffset, yOffset, Type) {
PlayerMC = PMC;
MainMC = MMC;
MainMC.attachMovie(Type, "Bullet" + number, MainMC.getNextHighestDepth());
MC = MainMC["Bullet" + number];
MC.cacheAsBitmap = true;
MC._x = PlayerMC._x + xOffset;
MC._y = PlayerMC._y + yOffset;
dx = MainMC._xmouse - PlayerMC._x;
dy = MainMC._ymouse - PlayerMC._y;
var _local2 = Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2));
dx = dx / _local2;
dy = dy / _local2;
if (Type == "spread") {
dx = dx + ((random(100) - 50) * 0.01);
dy = dy + ((random(100) - 50) * 0.01);
}
MC._xscale = MC._xscale * MainMC.engine.BulletSize;
MC._yscale = MC._yscale * MainMC.engine.BulletSize;
MC._x = MC._x - dx;
MC._y = MC._y - dy;
SPEED = speed;
}
function Update() {
MC._x = MC._x + (dx * SPEED);
MC._y = MC._y + (dy * SPEED);
if ((((MC._x > (550 + MC._width)) || (MC._x < (-MC._width))) || (MC._y < (-MC._height))) || (MC._y > (400 + MC._height))) {
removeMovieClip(MC);
return(true);
}
return(false);
}
}
Symbol 165 MovieClip [__Packages.mx.transitions.easing.Bounce] Frame 0
class mx.transitions.easing.Bounce
{
function Bounce () {
}
static function easeOut(t, b, c, d) {
t = t / d;
if (t < 0.363636363636364) {
return((c * ((7.5625 * t) * t)) + b);
}
if (t < 0.727272727272727) {
t = t - 0.545454545454545;
return((c * (((7.5625 * t) * t) + 0.75)) + b);
}
if (t < 0.909090909090909) {
t = t - 0.818181818181818;
return((c * (((7.5625 * t) * t) + 0.9375)) + b);
}
t = t - 0.954545454545455;
return((c * (((7.5625 * t) * t) + 0.984375)) + b);
}
static function easeIn(t, b, c, d) {
return((c - easeOut(d - t, 0, c, d)) + b);
}
static function easeInOut(t, b, c, d) {
if (t < (d / 2)) {
return((easeIn(t * 2, 0, c, d) * 0.5) + b);
}
return(((easeOut((t * 2) - d, 0, c, d) * 0.5) + (c * 0.5)) + b);
}
static var version = "1.1.0.52";
}
Symbol 166 MovieClip [__Packages.Engine] Frame 0
class Engine
{
var watch, GreenBaddys, Loners, Blinkys, Breakables, Snakes, Particles, EnemySPEED, StartWaveID, waveComplete, NumGreenBaddys, NumLoners, NumBlinkys, NumSnakes, NumBreakables, Multiplyer, GREENSCORE, LONERSCORE, BLINKYSCORE, BREAKABLESCORE, SNAKESCORE, PwrUpNumber, BulletSize, MainMC, Drawing, PowerUpLife, DEG2RAD, Difficulty, DifficultyNum, DifficultySpeed, DifficultyTimer, DifficultySpawn, StartTime, ExtraLifeCounter, eDeathSound, PlayerRef;
function Engine () {
watch("waveComplete", function () {
this.StartWaveID = -1;
});
GreenBaddys = new Array();
Loners = new Array();
Blinkys = new Array();
Breakables = new Array();
Snakes = new Array();
Particles = new Array();
EnemySPEED = 1;
StartWaveID = 0;
waveComplete = false;
NumGreenBaddys = (NumLoners = (NumBlinkys = (NumSnakes = (NumBreakables = 0))));
Multiplyer = 1;
GREENSCORE = 50;
LONERSCORE = 50;
BLINKYSCORE = 75;
BREAKABLESCORE = 75;
SNAKESCORE = 100;
PwrUpNumber = 10;
BulletSize = 1;
MainMC = _level;
MainMC.stars1.createEmptyMovieClip("drawin", MainMC.getNextHighestDepth());
Drawing = MainMC.stars1.drawin;
var _local3 = new flash.filters.GlowFilter(65535, 100, 8, 8, 8, 1, false, false);
PowerUpLife = 10000;
DEG2RAD = 0.01745329;
Difficulty = 1;
DifficultyNum = 1;
DifficultySpeed = 1;
DifficultyTimer = getTimer();
DifficultySpawn = 0;
StartTime = getTimer();
ExtraLifeCounter = 100000 /* 0x0186A0 */;
eDeathSound = new Sound();
eDeathSound.attachSound("enemyDeathWav");
var _local2 = new Sound();
_local2.attachSound("playerSpawnWav");
_local2.start(0, 0);
}
function StartGameEffect() {
var _local2 = 0;
while (_local2 < (MainMC.numRows * MainMC.numCols)) {
var _local3 = new mx.transitions.Tween(MainMC.stars1["node" + _local2], "_x", mx.transitions.easing.Bounce.easeOut, 400, MainMC.stars1["node" + _local2].origX, 3, true);
var _local4 = new mx.transitions.Tween(MainMC.stars1["node" + _local2], "_y", mx.transitions.easing.Bounce.easeOut, 300, MainMC.stars1["node" + _local2].origY, 3, true);
_local2++;
}
}
function setPlayer(p) {
PlayerRef = p;
}
function Update() {
if ((getTimer() - DifficultyTimer) > 6000) {
if (Difficulty <= 120) {
Difficulty++;
}
if (DifficultyNum < 9) {
DifficultyNum = DifficultyNum + 0.2;
}
if (DifficultySpeed < 5.75) {
DifficultySpeed = DifficultySpeed + 0.04;
}
if (DifficultySpawn < 4.5) {
DifficultySpawn = DifficultySpawn + 0.09;
}
DifficultyTimer = getTimer();
trace("NumSpawns: " + Difficulty);
trace("WaveTypeAllowed: " + DifficultyNum);
trace("EnemySpeed: " + DifficultySpeed);
trace("MinimumWaveType: " + DifficultySpawn);
trace("Seconds Played: " + ((getTimer() - StartTime) / 1000));
trace("Score Multiplyer: " + Multiplyer);
}
DrawLevel();
GreenBaddyUpdate();
LonerUpdate();
BlinkyUpdate();
BreakableUpdate();
SnakeUpdate();
ParticleUpdate();
if (StartWaveID == -1) {
SpawnWave();
}
}
function SpawnWave() {
var _local2 = random(DifficultyNum) + Math.floor(DifficultySpawn);
if (_local2 > 15) {
_local2 = 15;
}
switch (_local2) {
case 0 :
switch (random(6)) {
case 0 :
var _local8 = new Wave("Loner", "MaryGoRoundSlow", this);
break;
case 1 :
var _local7 = new Wave("Loner", "FourCornersSlowSpawn", this, Difficulty);
break;
case 2 :
var _local6 = new Wave("Loner", "FourCornersRapidSpawn", this, Difficulty * 2);
break;
case 3 :
var _local5 = new Wave("Loner", "FourCornersSmallSpawn", this);
break;
case 4 :
var _local4 = new Wave("Loner", "DeathSpawnFast", this, Difficulty * 2);
break;
case 5 :
var _local3 = new Wave("Loner", "DeathSpawnSlow", this, Difficulty);
}
break;
case 1 :
switch (random(6)) {
case 1 :
_local8 = new Wave("GreenBaddy", "MaryGoRoundSlow", this);
break;
case 2 :
_local7 = new Wave("GreenBaddy", "FourCornersSlowSpawn", this, Difficulty);
break;
case 3 :
_local6 = new Wave("GreenBaddy", "FourCornersRapidSpawn", this, Difficulty * 2);
break;
case 4 :
_local5 = new Wave("GreenBaddy", "FourCornersSmallSpawn", this);
break;
case 5 :
_local4 = new Wave("GreenBaddy", "DeathSpawnFast", this, Difficulty * 2);
break;
case 0 :
_local3 = new Wave("GreenBaddy", "DeathSpawnSlow", this, Difficulty);
}
break;
case 2 :
switch (random(2)) {
case 0 :
var _local9 = new Wave("Blinky", "MaryGoRoundSlow", this);
break;
case 1 :
_local7 = new Wave("Blinky", "FourCornersSmallSpawn", this);
}
break;
case 3 :
switch (random(4)) {
case 0 :
_local9 = new Wave("Breakable", "MaryGoRoundSlow", this);
break;
case 1 :
_local8 = new Wave("Breakable", "FourCornersSlowSpawn", this, Difficulty);
break;
case 2 :
_local7 = new Wave("Breakable", "FourCornersSmallSpawn", this);
break;
case 3 :
_local6 = new Wave("Breakable", "DeathSpawnSlow", this, Difficulty);
}
break;
case 4 :
switch (random(5)) {
case 0 :
_local9 = new Wave("Snake", "MaryGoRoundSlow", this);
break;
case 1 :
_local9 = new Wave("Snake", "MaryGoRoundFast", this);
break;
case 2 :
_local8 = new Wave("Snake", "FourCornersSlowSpawn", this, Difficulty / 2);
break;
case 3 :
_local7 = new Wave("Snake", "FourCornersSmallSpawn", this);
break;
case 4 :
_local6 = new Wave("Snake", "DeathSpawnSlow", this, Difficulty / 2);
}
break;
case 5 :
switch (random(5)) {
case 0 :
_local9 = new Wave("GreenBaddy/Loner", "FourCornersRapidSpawn", this, Difficulty * 2);
break;
case 1 :
_local8 = new Wave("GreenBaddy/Loner", "FourCornersSlowSpawn", this, Difficulty);
break;
case 2 :
_local7 = new Wave("GreenBaddy/Loner", "FourCornersSmallSpawn", this);
break;
case 3 :
_local6 = new Wave("GreenBaddy/Loner", "DeathSpawnFast", this, Difficulty * 2);
break;
case 4 :
_local5 = new Wave("GreenBaddy/Loner", "DeathSpawnSlow", this, Difficulty);
}
break;
case 6 :
switch (random(3)) {
case 0 :
_local8 = new Wave("GreenBaddy/Breakable", "FourCornersSmallSpawn", this);
break;
case 1 :
_local7 = new Wave("GreenBaddy/Breakable", "DeathSpawnSlow", this, Difficulty);
break;
case 2 :
_local7 = new Wave("GreenBaddy/Breakable", "DeathSpawnFast", this, Difficulty * 2);
}
break;
case 7 :
switch (random(2)) {
case 0 :
_local8 = new Wave("Blinky/Loner", "FourCornersSmallSpawn", this);
break;
case 1 :
_local7 = new Wave("Blinky/Loner", "DeathSpawnFast", this, Difficulty * 2);
}
break;
case 8 :
switch (random(2)) {
case 0 :
_local8 = new Wave("Blinky/GreenBaddy", "FourCornersSmallSpawn", this);
break;
case 1 :
_local7 = new Wave("Blinky/GreenBaddy", "DeathSpawnFast", this, Difficulty);
}
break;
case 9 :
switch (random(3)) {
case 0 :
_local8 = new Wave("Snake/GreenBaddy", "FourCornersSmallSpawn", this);
break;
case 1 :
_local7 = new Wave("Snake/GreenBaddy", "DeathSpawnSlow", this, Difficulty);
break;
case 2 :
_local7 = new Wave("Snake/GreenBaddy", "DeathSpawnFast", this, Difficulty);
}
break;
case 10 :
switch (random(2)) {
case 0 :
_local6 = new Wave("GreenBaddy", "FourCornersRapidSpawn", this, Difficulty);
break;
case 1 :
_local4 = new Wave("GreenBaddy", "DeathSpawnFast", this, Difficulty);
}
break;
case 11 :
switch (random(3)) {
case 0 :
_local9 = new Wave("Snake/GreenBaddy/Loner", "FourCornersRapidSpawn", this, Difficulty);
break;
case 1 :
_local8 = new Wave("Snake/GreenBaddy/Loner", "FourCornersSmallSpawn", this);
break;
case 2 :
_local7 = new Wave("Snake/GreenBaddy/Loner", "DeathSpawnFast", this, Difficulty);
}
break;
case 12 :
switch (random(3)) {
case 0 :
_local9 = new Wave("Snake/GreenBaddy/Blinky/Loner", "FourCornersRapidSpawn", this, Difficulty);
break;
case 1 :
_local8 = new Wave("Snake/GreenBaddy/Blinky/Loner", "FourCornersSmallSpawn", this);
break;
case 2 :
_local7 = new Wave("Snake/GreenBaddy/Blinky/Loner", "DeathSpawnFast", this, Difficulty);
}
break;
case 13 :
switch (random(3)) {
case 0 :
_local9 = new Wave("Snake/GreenBaddy/Breakable", "FourCornersRapidSpawn", this, Difficulty);
break;
case 1 :
_local8 = new Wave("Snake/GreenBaddy/Breakable", "FourCornersSmallSpawn", this);
break;
case 2 :
_local7 = new Wave("Snake/GreenBaddy/Breakable", "DeathSpawnFast", this, Difficulty);
}
break;
case 14 :
switch (random(2)) {
case 0 :
_local9 = new Wave("Snake/GreenBaddy/Breakable/Blinky/Loner", "FourCornersRapidSpawn", this, Difficulty);
break;
case 1 :
_local7 = new Wave("Snake/GreenBaddy/Breakable/Blinky/Loner", "DeathSpawnFast", this, Difficulty);
}
break;
case 15 :
switch (random(3)) {
case 0 :
_local9 = new Wave("GreenBaddy", "UberDeath", this, Difficulty / 2);
break;
case 1 :
_local9 = new Wave("Breakable", "UberDeath", this, Difficulty / 2);
break;
case 2 :
_local9 = new Wave("Loner", "UberDeath", this, Difficulty / 2);
}
}
StartWaveID = 0;
}
function CreateBlinky() {
var _local1 = new Blinky(_level.player.mc, _level, _level.engine.NumBlinkys++, 3, random(10));
if (_local1.MC) {
_level.engine.Blinkys.push(_local1);
} else {
trace("ERROR CREATING BLINKY");
}
}
function CreateLoner() {
var _local1 = new Loner(_level.player.mc, _level, _level.engine.NumLoners++, 2.5, random(10));
if (_local1.MC) {
_level.engine.Loners.push(_local1);
} else {
trace("ERROR CREATING LONER");
}
}
function CreateGreenBaddy() {
var _local1 = new GreenBaddy(_level.player.mc, _level, _level.engine.NumGreenBaddys++, 2.5, random(10));
if (_local1.MC) {
_level.engine.GreenBaddys.push(_local1);
} else {
trace("ERROR CREATING GREENY");
}
}
function DrawLevel() {
_level.player_mc.swapDepths(_level.getNextHighestDepth());
_level.score_mc.swapDepths(_level.getNextHighestDepth());
Drawing.clear();
Drawing.lineStyle(8, 65535);
var _local5 = _level.numRows;
var _local2 = _level.numCols;
var _local3 = 0;
while (_local3 < _local5) {
Drawing.moveTo(MainMC.stars1["node" + (_local3 * _local2)]._x, MainMC.stars1["node" + (_local3 * _local2)]._y);
var _local4 = 1;
while (_local4 < _local2) {
Drawing.lineTo(MainMC.stars1["node" + ((_local3 * _local2) + _local4)]._x, MainMC.stars1["node" + ((_local3 * _local2) + _local4)]._y);
_local4++;
}
_local3++;
}
var _local4 = 0;
while (_local4 < _local2) {
Drawing.moveTo(MainMC.stars1["node" + _local4]._x, MainMC.stars1["node" + _local4]._y);
_local3 = 1;
while (_local3 < _local5) {
Drawing.lineTo(MainMC.stars1["node" + ((_local3 * _local2) + _local4)]._x, MainMC.stars1["node" + ((_local3 * _local2) + _local4)]._y);
_local3++;
}
_local4++;
}
}
function GreenBaddyUpdate() {
var _local3 = 0;
while (_local3 < GreenBaddys.length) {
GreenBaddys[_local3].Update(EnemySPEED);
if (PlayerRef.mc._visible && (GreenBaddys[_local3].MC.hitTest(PlayerRef.mc.collisionBox))) {
KillPlayer();
KillAll();
}
var _local2 = 0;
while (_local2 < PlayerRef.bullets.length) {
if (GreenBaddys[_local3].MC.hitTest(PlayerRef.bullets[_local2].MC)) {
_level.score_mc.score.text = Number(Number(_level.score_mc.score.text) + (GREENSCORE * Multiplyer));
PowerUPLovin();
KillEnemy(GreenBaddys, 65280, _local3);
if (BulletSize == 1) {
removeMovieClip(PlayerRef.bullets[_local2].MC);
PlayerRef.bullets.splice(_local2--, 1);
}
}
_local2++;
}
_local3++;
}
}
function LonerUpdate() {
var _local3 = 0;
while (_local3 < Loners.length) {
Loners[_local3].Update(EnemySPEED);
if (PlayerRef.mc._visible && (Loners[_local3].MC.hitTest(PlayerRef.mc.collisionBox))) {
KillPlayer();
KillAll();
}
var _local2 = 0;
while (_local2 < PlayerRef.bullets.length) {
if (Loners[_local3].MC.hitTest(PlayerRef.bullets[_local2].MC)) {
_level.score_mc.score.text = Number(Number(_level.score_mc.score.text) + (LONERSCORE * Multiplyer));
PowerUPLovin();
KillEnemy(Loners, 16711935, _local3);
if (BulletSize == 1) {
removeMovieClip(PlayerRef.bullets[_local2].MC);
PlayerRef.bullets.splice(_local2--, 1);
}
}
_local2++;
}
_local3++;
}
}
function BlinkyUpdate() {
var _local3 = 0;
while (_local3 < Blinkys.length) {
Blinkys[_local3].Update(EnemySPEED);
if (PlayerRef.mc._visible && (Blinkys[_local3].MC.hitTest(PlayerRef.mc.collisionBox))) {
KillPlayer();
KillAll();
}
var _local2 = 0;
while (_local2 < PlayerRef.bullets.length) {
if (Blinkys[_local3].MC.hitTest(PlayerRef.bullets[_local2].MC)) {
_level.score_mc.score.text = Number(Number(_level.score_mc.score.text) + (BLINKYSCORE * Multiplyer));
PowerUPLovin();
KillEnemy(Blinkys, 255, _local3);
if (BulletSize == 1) {
removeMovieClip(PlayerRef.bullets[_local2].MC);
PlayerRef.bullets.splice(_local2--, 1);
}
}
_local2++;
}
_local3++;
}
}
function BreakableUpdate() {
var _local2 = 0;
while (_local2 < Breakables.length) {
Breakables[_local2].Update(EnemySPEED);
if (PlayerRef.mc._visible && (Breakables[_local2].MC.hitTest(PlayerRef.mc.collisionBox))) {
KillPlayer();
KillAll();
}
var _local5 = 0;
while (_local5 < PlayerRef.bullets.length) {
if (Breakables[_local2].MC.hitTest(PlayerRef.bullets[_local5].MC)) {
_level.score_mc.score.text = Number(Number(_level.score_mc.score.text) + (BREAKABLESCORE * Multiplyer));
PowerUPLovin();
while (Breakables[_local2].Size > 1) {
Breakables[_local2].Size--;
var _local4 = 0;
while (_local4 < 4) {
var _local3 = new Breakable(MainMC.player.mc, MainMC, NumBreakables++, 2.5, null, Breakables[_local2].Size, Breakables[_local2].MC);
if (_local3.MC) {
Breakables.push(_local3);
}
_local4++;
}
}
KillEnemy(Breakables, 11141290, _local2);
if (BulletSize == 1) {
removeMovieClip(PlayerRef.bullets[_local5].MC);
PlayerRef.bullets.splice(_local5--, 1);
}
}
_local5++;
}
_local2++;
}
}
function SnakeUpdate() {
var _local6 = 0;
var _local2 = 0;
while (_local2 < Snakes.length) {
if (Snakes[_local2].MC == null) {
} else {
Snakes[_local2].Update(EnemySPEED);
if (PlayerRef.mc._visible && (Snakes[_local2].MC.hitTest(PlayerRef.mc.collisionBox))) {
KillPlayer();
KillAll();
return(undefined);
}
var _local5 = 2;
while (_local5 < Snakes[_local2].Tail.length) {
if (PlayerRef.mc._visible && (Snakes[_local2].Tail[_local5].hitTest(PlayerRef.mc.collisionBox))) {
KillPlayer();
KillAll();
return(undefined);
}
_local5++;
}
var _local3 = 0;
while (_local3 < PlayerRef.bullets.length) {
var _local4 = 2;
while (_local4 <= Snakes[_local2].Tail.length) {
if (Snakes[_local2].Tail[_local4].hitTest(PlayerRef.bullets[_local3].MC)) {
removeMovieClip(PlayerRef.bullets[_local3].MC);
PlayerRef.bullets.splice(_local3, 1);
return(undefined);
}
_local4++;
}
if (Snakes[_local2].MC.hitTest(PlayerRef.bullets[_local3].MC)) {
_local4 = 1;
while (_local4 <= Snakes[_local2].Tail.length) {
removeMovieClip(Snakes[_local2].Tail[_local4]);
_local4++;
}
Snakes[_local2].Tail = null;
_level.score_mc.score.text = Number(Number(_level.score_mc.score.text) + (SNAKESCORE * Multiplyer));
PowerUPLovin();
KillEnemy(Snakes, 16777215, _local2);
if (BulletSize == 1) {
removeMovieClip(PlayerRef.bullets[_local3].MC);
PlayerRef.bullets.splice(_local3, 1);
}
return(undefined);
}
_local3++;
}
}
_local2++;
}
}
function PowerUPLovin() {
if (PlayerRef.TotalKills >= PwrUpNumber) {
var _local2 = random(1000);
PwrUpNumber = PwrUpNumber + (random(20) + 80);
if (_local2 > 600) {
var _local3 = new PowerUp("slowdown");
return(undefined);
}
if (_local2 > 250) {
var _local3 = new PowerUp("bigBullet");
return(undefined);
}
if (_local2 > 0) {
var _local3 = new PowerUp("bigBomb");
return(undefined);
}
}
}
function KillEnemy(ArrayToDeleteFrom, ExplosionColor, WhichOneToKill) {
var _local9 = _level.getNextHighestDepth();
_level.attachMovie("explosion", "explosion" + _local9, _local9);
_level["explosion" + _local9].cacheAsBitmap = true;
_level["explosion" + _local9]._x = ArrayToDeleteFrom[WhichOneToKill].MC._x + MainMC.stars1._x;
_level["explosion" + _local9]._y = ArrayToDeleteFrom[WhichOneToKill].MC._y + MainMC.stars1._y;
_level["explosion" + _local9].cacheAsBitmap = true;
if (Particles.length < 50) {
var _local13 = new flash.filters.GlowFilter(ExplosionColor, 100, 32, 32, 2, 2, false, false);
_level["explosion" + _local9].filters = [_local13];
}
eDeathSound.start(0, 0);
var _local8 = Particles.length;
((_local8 < 5) ? (_local8 = 5) : null);
var _local2 = _local8 * 4;
while (_local2 <= 360) {
var _local4 = _local2 * DEG2RAD;
var _local3 = new Particle("particle", ArrayToDeleteFrom[WhichOneToKill].MC._x + MainMC.stars1._x, ArrayToDeleteFrom[WhichOneToKill].MC._y + MainMC.stars1._y, ExplosionColor, Math.cos(_local4), Math.sin(_local4));
var _local5 = _local2;
_local3.mc._rotation = _local5;
Particles.push(_local3);
_local2 = _local2 + (_local8 * 4);
}
removeMovieClip(ArrayToDeleteFrom[WhichOneToKill].MC);
ArrayToDeleteFrom.splice(WhichOneToKill, 1);
if (PlayerRef.enabled) {
PlayerRef.TotalKills++;
if ((PlayerRef.TotalKills % 100) == 0) {
if ((PlayerRef.weapon == "lazer") || (PlayerRef.weapon == "rapidFire")) {
var _local14 = new PowerUp("spreadPwrUp");
} else {
var _local14 = new PowerUp("rapidFirePwrUp");
}
}
}
if (PlayerRef.TotalKills >= PlayerRef.KillGoal) {
PlayerRef.KillGoal = PlayerRef.KillGoal * 3;
trace("TotalKills" + PlayerRef.TotalKills);
Multiplyer++;
MainMC.multiplyer_mc.nextFrame();
MainMC.multiplyer_mc.scoreM.text = Multiplyer;
var _local11 = new Sound();
_local11.attachSound("scoreWav");
_local11.start(0, 0);
MainMC.multiplyer_mc.play();
}
if (Number(_level.score_mc.score.text) >= ExtraLifeCounter) {
ExtraLifeCounter = ExtraLifeCounter + 100000;
PlayerRef.lives++;
MainMC.playerLives.text = PlayerRef.lives;
var _local12 = new Sound();
_local12.attachSound("lifeUp");
_local12.start(0, 0);
MainMC.extraLife_mc.play();
}
}
function ParticleUpdate() {
var _local2 = 0;
while (_local2 < Particles.length) {
if (Particles[_local2].Update()) {
removeMovieClip(Particles[_local2].mc);
Particles.splice(_local2, 1);
}
_local2++;
}
}
function KillAll() {
var _local2 = 0;
while (_local2 != GreenBaddys.length) {
KillEnemy(GreenBaddys, 65280, _local2);
if (PlayerRef.enabled) {
_level.score_mc.score.text = Number(Number(_level.score_mc.score.text) + (GREENSCORE * Multiplyer));
}
}
_local2 = 0;
while (_local2 != Loners.length) {
KillEnemy(Loners, 16711935, _local2);
if (PlayerRef.enabled) {
_level.score_mc.score.text = Number(Number(_level.score_mc.score.text) + (LONERSCORE * Multiplyer));
}
}
_local2 = 0;
while (_local2 != Blinkys.length) {
KillEnemy(Blinkys, 255, _local2);
if (PlayerRef.enabled) {
_level.score_mc.score.text = Number(Number(_level.score_mc.score.text) + (BLINKYSCORE * Multiplyer));
}
}
_local2 = 0;
while (_local2 != Breakables.length) {
KillEnemy(_level.engine.Breakables, 65535, _local2);
if (PlayerRef.enabled) {
_level.score_mc.score.text = Number(Number(_level.score_mc.score.text) + (BREAKABLESCORE * Multiplyer));
}
}
_local2 = 0;
while (_local2 != Snakes.length) {
var _local3 = 1;
while (_local3 <= Snakes[_local2].Tail.length) {
removeMovieClip(Snakes[_local2].Tail[_local3]);
_local3++;
}
KillEnemy(Snakes, 16777215, _local2);
if (PlayerRef.enabled) {
_level.score_mc.score.text = Number(Number(_level.score_mc.score.text) + (SNAKESCORE * Multiplyer));
}
}
}
function KillPlayer() {
Multiplyer = 1;
MainMC.multiplyer_mc.scoreM.text = Multiplyer;
PlayerRef.TotalKills = 0;
PlayerRef.KillGoal = 10;
PlayerRef.mc._visible = false;
PlayerRef.lives--;
PlayerRef.enabled = false;
var _local2 = _level.getNextHighestDepth();
_level.attachMovie("explosion", "explosion" + _local2, _local2);
_level["explosion" + _local2].cacheAsBitmap = true;
_level["explosion" + _local2]._x = PlayerRef.mc._x;
_level["explosion" + _local2]._y = PlayerRef.mc._y;
var _local5 = new flash.filters.GlowFilter(16711680, 100, 32, 32, 16, 2, false, false);
_level["explosion" + _local2].filters = [_local5];
PlayerRef.mc._x = 270;
PlayerRef.mc._y = 180;
PlayerRef.dx = 0;
PlayerRef.dy = 0;
MainMC.playerLives.text = PlayerRef.lives;
var ref = this;
var setPlayerAlive = setInterval(function () {
if (ref.PlayerRef.lives > 0) {
ref.PlayerRef.enabled = true;
ref.PlayerRef.mc._visible = true;
ref.StartGameEffect();
var _local1 = new Sound();
_local1.attachSound("playerSpawnWav");
_local1.start(0, 0);
} else {
ref.MainMC.backBtn._visible = true;
var _local2 = new Sound();
_local2.attachSound("gameOverWav");
_local2.start(0, 0);
}
clearInterval(setPlayerAlive);
}, 2000);
}
}
Symbol 167 MovieClip [__Packages.PowerUp] Frame 0
class PowerUp
{
var Type, Death, startTime, mc, ID;
function PowerUp (thisR) {
Type = thisR;
if (((Type == "spreadPwrUp") || (Type == "rapidFirePwrUp")) || (Type == "bigBomb")) {
Death = 10000;
} else {
Death = 6000;
}
startTime = getTimer();
var _local3 = _level.getNextHighestDepth();
_level.stars1.attachMovie(Type, "thisR" + _level.getNextHighestDepth(), _level.getNextHighestDepth());
mc = _level.stars1["thisR" + _local3];
mc.cacheAsBitmap = true;
mc._x = random(400) + 100;
mc._y = random(300) + 100;
thisR = this;
ID = setInterval(function () {
if ((getTimer() - thisR.startTime) > thisR.Death) {
removeMovieClip(thisR.mc);
delete thisR;
clearInterval(thisR.ID);
return(undefined);
}
if (thisR.mc.hitTest(_level.player.mc)) {
switch (thisR.Type) {
case "slowdown" :
var _local1 = new Sound();
_local1.attachSound("slowDownWav");
_local1.start(0, 0);
_level.engine.EnemySPEED = 3;
var resetEnemySpeedID = setInterval(function () {
_level.engine.EnemySPEED = 1;
clearInterval(resetEnemySpeedID);
}, _level.engine.PowerUpLife);
break;
case "bigBullet" :
_level.engine.BulletSize = 3;
var resetBulletSizeID = setInterval(function () {
_level.engine.BulletSize = 1;
clearInterval(resetBulletSizeID);
}, _level.engine.PowerUpLife);
break;
case "bigBomb" :
_level.engine.KillAll();
break;
case "spreadPwrUp" :
_level.engine.PlayerRef.weapon = "spread";
_level.engine.PlayerRef.BulletSpeed = 13;
_level.engine.PlayerRef.fireRate = 200;
break;
case "rapidFirePwrUp" :
_level.engine.PlayerRef.weapon = "rapidFire";
_level.engine.PlayerRef.BulletSpeed = 18;
_level.engine.PlayerRef.fireRate = 40;
}
removeMovieClip(thisR.mc);
delete thisR;
clearInterval(thisR.ID);
}
}, 200);
}
}
Symbol 168 MovieClip [__Packages.Wave] Frame 0
class Wave
{
var EngineRef, StartSpawnTime, EnemyType, SpawnType;
function Wave (EType, SType, ERef, numSpawns) {
EngineRef = ERef;
StartSpawnTime = getTimer();
EnemyType = EType;
SpawnType = SType;
switch (SpawnType) {
case "FourCornersRapidSpawn" :
trace("FourCornersRapidSpawn");
var NumSpawns = 0;
var MaxSpawns = numSpawns;
var thisRef = this;
var fastSpawnID = setInterval(function () {
if (NumSpawns >= MaxSpawns) {
var yetAnotherRef = thisRef.EngineRef;
var AnotherID = setInterval(function () {
yetAnotherRef.waveComplete = true;
clearInterval(AnotherID);
}, 5000);
clearInterval(fastSpawnID);
}
if (thisRef.EnemyType.indexOf("Loner", 0) != -1) {
var _local1 = random(4);
((_local1 == 1) ? (_local1 = 5) : null);
var _local5 = new Loner(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumLoners++, 2.5, _local1);
if (_local5.MC) {
thisRef.EngineRef.Loners.push(_local5);
NumSpawns++;
}
}
if (thisRef.EnemyType.indexOf("GreenBaddy", 0) != -1) {
var _local1 = random(4);
((_local1 == 1) ? (_local1 = 5) : null);
var _local4 = new GreenBaddy(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumGreenBaddys++, 2.5, _local1);
if (_local4.MC) {
thisRef.EngineRef.GreenBaddys.push(_local4);
NumSpawns++;
}
}
if (thisRef.EnemyType.indexOf("Blinky", 0) != -1) {
var _local1 = random(4);
((_local1 == 1) ? (_local1 = 5) : null);
var _local2 = new Blinky(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumBlinkys++, 2, _local1);
if (_local2.MC) {
thisRef.EngineRef.Blinkys.push(_local2);
NumSpawns++;
}
}
if (thisRef.EnemyType.indexOf("Breakable", 0) != -1) {
if (thisRef.EngineRef.Breakables.length > 12) {
return(undefined);
}
var _local1 = random(4);
((_local1 == 1) ? (_local1 = 5) : null);
var _local3 = new Breakable(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumBreakables++, 2.5, _local1, 2, null);
if (_local3.MC) {
thisRef.EngineRef.Breakables.push(_local3);
NumSpawns++;
}
}
if (thisRef.EnemyType.indexOf("Snake", 0) != -1) {
var _local1 = random(4);
((_local1 == 1) ? (_local1 = 5) : null);
var _local6 = new Snake(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumSnakes++, 2.5, _local1);
if (_local6.MC) {
thisRef.EngineRef.Snakes.push(_local6);
NumSpawns++;
}
}
}, 250);
break;
case "FourCornersSmallSpawn" :
trace("FourCornersSmallSpawn");
var thisRef = this;
var yetAnotherRef = thisRef.EngineRef;
var AnotherID = setInterval(function () {
yetAnotherRef.waveComplete = true;
clearInterval(AnotherID);
}, 5000);
if (thisRef.EnemyType.indexOf("Loner", 0) != -1) {
var _local2 = 0;
while (_local2 < 4) {
var spawnPlace = _local2;
((spawnPlace == 1) ? ((spawnPlace = 5)) : null);
var _local8 = new Loner(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumLoners++, 2.5, spawnPlace);
if (_local8.MC) {
thisRef.EngineRef.Loners.push(_local8);
}
_local2++;
}
}
if (thisRef.EnemyType.indexOf("GreenBaddy", 0) != -1) {
var _local2 = 0;
while (_local2 < 4) {
var spawnPlace = _local2;
((spawnPlace == 1) ? ((spawnPlace = 5)) : null);
var _local3 = new GreenBaddy(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumGreenBaddys++, 2.5, spawnPlace);
if (_local3.MC) {
thisRef.EngineRef.GreenBaddys.push(_local3);
}
_local2++;
}
}
if (thisRef.EnemyType.indexOf("Blinky", 0) != -1) {
var _local2 = 0;
while (_local2 < 4) {
var spawnPlace = _local2;
((spawnPlace == 1) ? ((spawnPlace = 5)) : null);
var _local5 = new Blinky(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumBlinkys++, 2, spawnPlace);
if (_local5.MC) {
thisRef.EngineRef.Blinkys.push(_local5);
}
_local2++;
}
}
if (thisRef.EnemyType.indexOf("Breakable", 0) != -1) {
var _local2 = 0;
while (_local2 < 4) {
var spawnPlace = _local2;
((spawnPlace == 1) ? ((spawnPlace = 5)) : null);
var _local6 = new Breakable(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumBreakables++, 2.5, spawnPlace, 2, null);
if (_local6.MC) {
thisRef.EngineRef.Breakables.push(_local6);
}
_local2++;
}
}
if (thisRef.EnemyType.indexOf("Snake", 0) != -1) {
var _local2 = 0;
while (_local2 < 4) {
var spawnPlace = _local2;
((spawnPlace == 1) ? ((spawnPlace = 5)) : null);
var _local9 = new Snake(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumSnakes++, 2.5, spawnPlace);
if (_local9.MC) {
thisRef.EngineRef.Snakes.push(_local9);
}
_local2++;
}
}
break;
case "FourCornersSlowSpawn" :
trace("FourCornersSlowSpawn");
var NumSpawns = 0;
var MaxSpawns = numSpawns;
var thisRef = this;
var fastSpawnID = setInterval(function () {
if (NumSpawns > MaxSpawns) {
var yetAnotherRef = thisRef.EngineRef;
var AnotherID = setInterval(function () {
yetAnotherRef.waveComplete = true;
clearInterval(AnotherID);
}, 5000);
clearInterval(fastSpawnID);
return(undefined);
}
if (thisRef.EnemyType.indexOf("Loner", 0) != -1) {
var _local1 = random(4);
((_local1 == 1) ? (_local1 = 5) : null);
var _local5 = new Loner(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumLoners++, 2.5, _local1);
if (_local5.MC) {
thisRef.EngineRef.Loners.push(_local5);
NumSpawns++;
}
}
if (thisRef.EnemyType.indexOf("GreenBaddy", 0) != -1) {
var _local1 = random(4);
((_local1 == 1) ? (_local1 = 5) : null);
var _local4 = new GreenBaddy(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumGreenBaddys++, 2.5, _local1);
if (_local4.MC) {
thisRef.EngineRef.GreenBaddys.push(_local4);
NumSpawns++;
}
}
if (thisRef.EnemyType.indexOf("Blinky", 0) != -1) {
var _local1 = random(4);
((_local1 == 1) ? (_local1 = 5) : null);
var _local2 = new Blinky(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumBlinkys++, 2, _local1);
if (_local2.MC) {
thisRef.EngineRef.Blinkys.push(_local2);
NumSpawns++;
}
}
if (thisRef.EnemyType.indexOf("Breakable", 0) != -1) {
if (thisRef.EngineRef.Breakables.length > 12) {
return(undefined);
}
var _local1 = random(4);
((_local1 == 1) ? (_local1 = 5) : null);
var _local3 = new Breakable(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumBreakables++, 2.5, _local1, 2, null);
if (_local3.MC) {
thisRef.EngineRef.Breakables.push(_local3);
NumSpawns++;
}
}
if (thisRef.EnemyType.indexOf("Snake", 0) != -1) {
var _local1 = random(4);
((_local1 == 1) ? (_local1 = 5) : null);
var _local6 = new Snake(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumSnakes++, 2.5, _local1);
if (_local6.MC) {
thisRef.EngineRef.Snakes.push(_local6);
NumSpawns++;
}
}
}, 600);
break;
case "DeathSpawnFast" :
trace("DeathSpawnFast");
var NumSpawns = 0;
var MaxSpawns = numSpawns;
var thisRef = this;
var fastSpawnID = setInterval(function () {
if (NumSpawns >= MaxSpawns) {
var yetAnotherRef = thisRef.EngineRef;
var AnotherID = setInterval(function () {
yetAnotherRef.waveComplete = true;
clearInterval(AnotherID);
}, 5000);
clearInterval(fastSpawnID);
}
if (thisRef.EnemyType.indexOf("Loner", 0) != -1) {
var _local6 = random(10);
var _local4 = new Loner(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumLoners++, 2.5, _local6);
if (_local4.MC) {
thisRef.EngineRef.Loners.push(_local4);
NumSpawns++;
}
}
if (thisRef.EnemyType.indexOf("GreenBaddy", 0) != -1) {
var _local6 = random(10);
var _local3 = new GreenBaddy(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumGreenBaddys++, 2.5, _local6);
if (_local3.MC) {
thisRef.EngineRef.GreenBaddys.push(_local3);
NumSpawns++;
}
}
if (thisRef.EnemyType.indexOf("Blinky", 0) != -1) {
var _local6 = random(10);
var _local1 = new Blinky(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumBlinkys++, 2.5, _local6);
if (_local1.MC) {
thisRef.EngineRef.Blinkys.push(_local1);
NumSpawns++;
}
}
if (thisRef.EnemyType.indexOf("Breakable", 0) != -1) {
if (thisRef.EngineRef.Breakables.length > 12) {
return(undefined);
}
var _local6 = random(10);
var _local2 = new Breakable(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumBreakables++, 2.5, _local6, 2, null);
if (_local2.MC) {
thisRef.EngineRef.Breakables.push(_local2);
NumSpawns++;
}
}
if (thisRef.EnemyType.indexOf("Snake", 0) != -1) {
var _local6 = random(10);
var _local5 = new Snake(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumSnakes++, 2.5, _local6);
if (_local5.MC) {
thisRef.EngineRef.Snakes.push(_local5);
NumSpawns++;
}
}
}, 150);
break;
case "DeathSpawnSlow" :
trace("DeathSpawnSlow");
var NumSpawns = 0;
var MaxSpawns = numSpawns;
var thisRef = this;
var fastSpawnID = setInterval(function () {
if (NumSpawns >= MaxSpawns) {
var yetAnotherRef = thisRef.EngineRef;
var AnotherID = setInterval(function () {
yetAnotherRef.waveComplete = true;
clearInterval(AnotherID);
}, 5000);
clearInterval(fastSpawnID);
}
if (thisRef.EnemyType.indexOf("Loner", 0) != -1) {
var _local6 = random(10);
var _local4 = new Loner(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumLoners++, 2.5, _local6);
if (_local4.MC) {
thisRef.EngineRef.Loners.push(_local4);
NumSpawns++;
}
}
if (thisRef.EnemyType.indexOf("GreenBaddy", 0) != -1) {
var _local6 = random(10);
var _local3 = new GreenBaddy(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumGreenBaddys++, 2.5, _local6);
if (_local3.MC) {
thisRef.EngineRef.GreenBaddys.push(_local3);
NumSpawns++;
}
}
if (thisRef.EnemyType.indexOf("Blinky", 0) != -1) {
var _local6 = random(10);
var _local1 = new Blinky(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumBlinkys++, 2, _local6);
if (_local1.MC) {
thisRef.EngineRef.Blinkys.push(_local1);
NumSpawns++;
}
}
if (thisRef.EnemyType.indexOf("Breakable", 0) != -1) {
if (thisRef.EngineRef.Breakables.length > 12) {
return(undefined);
}
var _local6 = random(10);
var _local2 = new Breakable(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumBreakables++, 2.5, _local6, 2, null);
if (_local2.MC) {
thisRef.EngineRef.Breakables.push(_local2);
NumSpawns++;
}
}
if (thisRef.EnemyType.indexOf("Snake", 0) != -1) {
var _local6 = random(10);
var _local5 = new Snake(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumSnakes++, 2.5, _local6);
if (_local5.MC) {
thisRef.EngineRef.Snakes.push(_local5);
NumSpawns++;
}
}
}, 600);
break;
case "MaryGoRoundFast" :
trace("MaryGoRoundFast");
var NumSpawns = 0;
var MaxSpawns = 10;
var thisRef = this;
var spawnPlace = 0;
var fastSpawnID = setInterval(function () {
if (spawnPlace > MaxSpawns) {
var yetAnotherRef = thisRef.EngineRef;
var AnotherID = setInterval(function () {
yetAnotherRef.waveComplete = true;
clearInterval(AnotherID);
}, 5000);
clearInterval(fastSpawnID);
return(undefined);
}
if (thisRef.EnemyType.indexOf("Loner", 0) != -1) {
var _local4 = new Loner(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumLoners++, 2.5, spawnPlace);
if (_local4.MC) {
thisRef.EngineRef.Loners.push(_local4);
spawnPlace++;
}
}
if (thisRef.EnemyType.indexOf("GreenBaddy", 0) != -1) {
var _local3 = new GreenBaddy(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumGreenBaddys++, 2.5, spawnPlace);
if (_local3.MC) {
thisRef.EngineRef.GreenBaddys.push(_local3);
spawnPlace++;
}
}
if (thisRef.EnemyType.indexOf("Blinky", 0) != -1) {
var _local1 = new Blinky(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumBlinkys++, 2.5, spawnPlace);
if (_local1.MC) {
thisRef.EngineRef.Blinkys.push(_local1);
spawnPlace++;
}
}
if (thisRef.EnemyType.indexOf("Breakable", 0) != -1) {
if (thisRef.EngineRef.Breakables.length > 12) {
return(undefined);
}
var _local2 = new Breakable(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumBreakables++, 2.5, spawnPlace, 2, null);
if (_local2.MC) {
thisRef.EngineRef.Breakables.push(_local2);
spawnPlace++;
}
}
if (thisRef.EnemyType.indexOf("Snake", 0) != -1) {
var _local5 = new Snake(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumSnakes++, 2.5, spawnPlace);
if (_local5.MC) {
thisRef.EngineRef.Snakes.push(_local5);
spawnPlace++;
}
}
}, 100);
break;
case "MaryGoRoundSlow" :
trace("MaryGoRoundSlow");
var NumSpawns = 0;
var MaxSpawns = 10;
var thisRef = this;
var spawnPlace = 0;
var fastSpawnID = setInterval(function () {
if (spawnPlace > MaxSpawns) {
var yetAnotherRef = thisRef.EngineRef;
var AnotherID = setInterval(function () {
yetAnotherRef.waveComplete = true;
clearInterval(AnotherID);
}, 5000);
clearInterval(fastSpawnID);
return(undefined);
}
if (thisRef.EnemyType.indexOf("Loner", 0) != -1) {
var _local4 = new Loner(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumLoners++, 2.5, spawnPlace);
if (_local4.MC) {
thisRef.EngineRef.Loners.push(_local4);
spawnPlace++;
}
}
if (thisRef.EnemyType.indexOf("GreenBaddy", 0) != -1) {
var _local3 = new GreenBaddy(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumGreenBaddys++, 2.5, spawnPlace);
if (_local3.MC) {
thisRef.EngineRef.GreenBaddys.push(_local3);
spawnPlace++;
}
}
if (thisRef.EnemyType.indexOf("Blinky", 0) != -1) {
var _local1 = new Blinky(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumBlinkys++, 2.5, spawnPlace);
if (_local1.MC) {
thisRef.EngineRef.Blinkys.push(_local1);
spawnPlace++;
}
}
if (thisRef.EnemyType.indexOf("Breakable", 0) != -1) {
if (thisRef.EngineRef.Breakables.length > 12) {
return(undefined);
}
var _local2 = new Breakable(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumBreakables++, 2.5, spawnPlace, 2, null);
if (_local2.MC) {
thisRef.EngineRef.Breakables.push(_local2);
spawnPlace++;
}
}
if (thisRef.EnemyType.indexOf("Snake", 0) != -1) {
var _local5 = new Snake(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumSnakes++, 2.5, spawnPlace);
if (_local5.MC) {
thisRef.EngineRef.Snakes.push(_local5);
spawnPlace++;
}
}
}, 500);
break;
case "UberDeath" :
trace("UberDeath");
var NumSpawns = 0;
var MaxSpawns = numSpawns;
var thisRef = this;
var fastSpawnID = setInterval(function () {
if (NumSpawns >= MaxSpawns) {
var yetAnotherRef = thisRef.EngineRef;
var AnotherID = setInterval(function () {
yetAnotherRef.waveComplete = true;
clearInterval(AnotherID);
}, 5000);
clearInterval(fastSpawnID);
}
if (thisRef.EnemyType.indexOf("Loner", 0) != -1) {
var _local6 = random(10);
var _local4 = new Loner(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumLoners++, 3, _local6);
if (_local4.MC) {
thisRef.EngineRef.Loners.push(_local4);
NumSpawns++;
}
}
if (thisRef.EnemyType.indexOf("GreenBaddy", 0) != -1) {
var _local6 = random(10);
var _local3 = new GreenBaddy(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumGreenBaddys++, 3, _local6);
if (_local3.MC) {
thisRef.EngineRef.GreenBaddys.push(_local3);
NumSpawns++;
}
}
if (thisRef.EnemyType.indexOf("Blinky", 0) != -1) {
var _local6 = random(10);
var _local1 = new Blinky(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumBlinkys++, 3, _local6);
if (_local1.MC) {
thisRef.EngineRef.Blinkys.push(_local1);
NumSpawns++;
}
}
if (thisRef.EnemyType.indexOf("Breakable", 0) != -1) {
if (thisRef.EngineRef.Breakables.length > 12) {
return(undefined);
}
var _local6 = random(10);
var _local2 = new Breakable(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumBreakables++, 3, _local6, 2, null);
if (_local2.MC) {
thisRef.EngineRef.Breakables.push(_local2);
NumSpawns++;
}
}
if (thisRef.EnemyType.indexOf("Snake", 0) != -1) {
var _local6 = random(10);
var _local5 = new Snake(thisRef.EngineRef.MainMC.player.mc, thisRef.EngineRef.MainMC, thisRef.EngineRef.NumSnakes++, 3, _local6);
if (_local5.MC) {
thisRef.EngineRef.Snakes.push(_local5);
NumSpawns++;
}
}
}, 50);
}
}
}
Symbol 169 MovieClip [__Packages.Loner] Frame 0
class Loner
{
var PlayerMC, MainMC, MC, dx, dy, SPEED, LocX, LocY;
function Loner (PMC, MMC, number, speed, spawnNum) {
PlayerMC = PMC;
MainMC = MMC;
MainMC.stars1.attachMovie("Loner", "Loner" + number, MainMC.stars1.getNextHighestDepth());
MC = MainMC.stars1["Loner" + number];
MC.cacheAsBitmap = true;
MC._x = MMC.stars1["spawnPoint" + spawnNum]._x;
MC._y = MMC.stars1["spawnPoint" + spawnNum]._y;
dx = MainMC._xmouse - PlayerMC._x;
dy = MainMC._ymouse - PlayerMC._y;
var _local3 = Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2));
dx = dx / _local3;
dy = dy / _local3;
SPEED = (speed + MMC.engine.DifficultySpeed) + 1;
LocX = random(725);
LocY = random(525);
}
function Update(SPEEDMOD) {
if (MC.hitTest(LocX + MainMC.stars1._x, LocY + MainMC.stars1._y)) {
LocX = random(725);
LocY = random(525);
}
dx = LocX - MC._x;
dy = LocY - MC._y;
var _local2 = Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2));
if (_local2 == 0) {
_local2 = 1E-5;
}
dx = dx / _local2;
dy = dy / _local2;
MC._x = MC._x + ((dx * SPEED) / SPEEDMOD);
MC._y = MC._y + ((dy * SPEED) / SPEEDMOD);
}
}
Symbol 170 MovieClip [__Packages.GreenBaddy] Frame 0
class GreenBaddy
{
var PlayerMC, MainMC, MC, dx, dy, SPEED;
function GreenBaddy (PMC, MMC, number, speed, spawnNum) {
PlayerMC = PMC;
MainMC = MMC;
MainMC.stars1.attachMovie("GreenBaddy", "GreenBaddy" + number, MainMC.stars1.getNextHighestDepth());
MC = MainMC.stars1["GreenBaddy" + number];
MC.cacheAsBitmap = true;
MC._x = MMC.stars1["spawnPoint" + spawnNum]._x;
MC._y = MMC.stars1["spawnPoint" + spawnNum]._y;
if (MMC.engine.GreenBaddys.length < 10) {
var _local4 = new flash.filters.BlurFilter(2, 2, 1);
MC.filters = [_local4];
}
dx = MainMC._xmouse - PlayerMC._x;
dy = MainMC._ymouse - PlayerMC._y;
var _local3 = Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2));
dx = dx / _local3;
dy = dy / _local3;
SPEED = (speed + MMC.engine.DifficultySpeed) + ((random(5) - 2.5) * 0.1);
}
function Update(SPEEDMOD) {
dx = (PlayerMC._x - MainMC.stars1._x) - MC._x;
dy = (PlayerMC._y - MainMC.stars1._y) - MC._y;
var _local2 = Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2));
if (_local2 == 0) {
_local2 = 1E-5;
}
dx = dx / _local2;
dy = dy / _local2;
MC._x = MC._x + ((dx * SPEED) / SPEEDMOD);
MC._y = MC._y + ((dy * SPEED) / SPEEDMOD);
}
}
Symbol 171 MovieClip [__Packages.Blinky] Frame 0
class Blinky
{
var PlayerMC, MainMC, MC, dx, dy, SPEED;
function Blinky (PMC, MMC, number, speed, spawnNum) {
if (MMC.engine.Blinkys.length > 5) {
MMC.engine.NumBlinkys--;
return;
}
PlayerMC = PMC;
MainMC = MMC;
MainMC.stars1.attachMovie("Blinky", "Blinky" + number, MainMC.stars1.getNextHighestDepth());
MC = MainMC.stars1["Blinky" + number];
MC._x = MMC.stars1["spawnPoint" + spawnNum]._x;
MC._y = MMC.stars1["spawnPoint" + spawnNum]._y;
dx = (PlayerMC._x - MainMC.stars1._x) - MC._x;
dy = (PlayerMC._y - MainMC.stars1._y) - MC._y;
MC.cacheAsBitmap = true;
var _local3 = Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2));
dx = dx / _local3;
dy = dy / _local3;
SPEED = speed;
var _local7 = this;
var _local4 = new mx.transitions.Tween(MC, "_alpha", mx.transitions.easing.Regular.easeInOut, 100, 0, 2, true);
_local7 = this;
_local4.onMotionFinished = function () {
this.yoyo();
};
}
function Update(SPEEDMOD) {
dx = (PlayerMC._x - MainMC.stars1._x) - MC._x;
dy = (PlayerMC._y - MainMC.stars1._y) - MC._y;
var _local2 = Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2));
if (_local2 == 0) {
_local2 = 1E-5;
}
dx = dx / _local2;
dy = dy / _local2;
MC._x = MC._x + ((dx * SPEED) / SPEEDMOD);
MC._y = MC._y + ((dy * SPEED) / SPEEDMOD);
}
}
Symbol 172 MovieClip [__Packages.Breakable] Frame 0
class Breakable
{
var PlayerMC, MainMC, Size, dx, dy, MC, SPEED;
function Breakable (PMC, MMC, number, speed, spawnNum, sz, SpawnHere) {
PlayerMC = PMC;
MainMC = MMC;
Size = sz;
dx = 0;
dy = 0;
MainMC.stars1.attachMovie("Breakable" + Size, "Breakable" + number, MainMC.stars1.getNextHighestDepth());
MC = MainMC.stars1["Breakable" + number];
MC.cacheAsBitmap = true;
if (SpawnHere) {
MC._x = SpawnHere._x;
MC._y = SpawnHere._y;
dx = random(8) - 4;
dy = random(8) - 4;
} else {
MC._x = MMC.stars1["spawnPoint" + spawnNum]._x;
MC._y = MMC.stars1["spawnPoint" + spawnNum]._y;
}
if (MMC.engine.Breakables.length < 10) {
var _local4 = new flash.filters.BlurFilter(4, 4, 1);
MC.filters = [_local4];
}
SPEED = (speed + MMC.engine.DifficultySpeed) - 1;
}
function Update(SPEEDMOD) {
if (MC._x > (PlayerMC._x - MainMC.stars1._x)) {
if (dx > -1) {
dx = dx - 0.1;
} else {
dx = dx + 0.1;
}
} else if (MC._x < (PlayerMC._x - MainMC.stars1._x)) {
if (dx < 1) {
dx = dx + 0.1;
} else {
dx = dx - 0.1;
}
}
if (MC._y > (PlayerMC._y - MainMC.stars1._y)) {
if (dy > -1) {
dy = dy - 0.1;
} else {
dy = dy + 0.1;
}
} else if (MC._y < (PlayerMC._y - MainMC.stars1._y)) {
if (dy < 1) {
dy = dy + 0.1;
} else {
dy = dy - 0.1;
}
}
MC._x = MC._x + ((dx * SPEED) / SPEEDMOD);
MC._y = MC._y + ((dy * SPEED) / SPEEDMOD);
}
}
Symbol 173 MovieClip [__Packages.Snake] Frame 0
class Snake
{
var PlayerMC, MainMC, Tail, MC, SPEED, dx, dy, LocX, LocY;
function Snake (PMC, MMC, number, speed, spawnNum) {
if (MMC.engine.Snakes.length > 5) {
return;
}
PlayerMC = PMC;
MainMC = MMC;
Tail = new Array();
MainMC.stars1.attachMovie("Snake", "Snake" + number, MainMC.stars1.getNextHighestDepth());
MC = MainMC.stars1["Snake" + number];
MC.cacheAsBitmap = true;
MC._x = MMC.stars1["spawnPoint" + spawnNum]._x;
MC._y = MMC.stars1["spawnPoint" + spawnNum]._y;
SPEED = speed + MMC.engine.DifficultySpeed;
dx = (PlayerMC._x - MainMC.stars1._x) - MC._x;
dy = (PlayerMC._y - MainMC.stars1._y) - MC._y;
var _local7 = Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2));
dx = dx / _local7;
dy = dy / _local7;
var _local2 = 1;
while (_local2 <= 6) {
var _local3 = new MovieClip();
MainMC.stars1.attachMovie("SnakeTail", (("Snake" + number) + "TailNumber") + _local2, MainMC.stars1.getNextHighestDepth());
_local3 = MainMC.stars1[(("Snake" + number) + "TailNumber") + _local2];
_local3._x = MMC.stars1["spawnPoint" + spawnNum]._x - ((dx * 15) * _local2);
_local3._y = MMC.stars1["spawnPoint" + spawnNum]._y - ((dy * 15) * _local2);
Tail[_local2] = _local3;
_local2++;
}
Tail[1]._visible = false;
LocX = random(725);
LocY = random(525);
}
function Update(SPEEDMOD) {
var _local2 = 6;
while (_local2 > 1) {
if (Tail[_local2]) {
var _local4 = Tail[_local2 - 1]._x - Tail[_local2]._x;
var _local3 = Tail[_local2 - 1]._y - Tail[_local2]._y;
var _local5 = Math.sqrt(Math.pow(_local4, 2) + Math.pow(_local3, 2));
_local4 = _local4 / _local5;
_local3 = _local3 / _local5;
Tail[_local2]._x = Tail[_local2 - 1]._x - (_local4 * 15);
Tail[_local2]._y = Tail[_local2 - 1]._y - (_local3 * 15);
}
_local2--;
}
Tail[1]._x = MC._x;
Tail[1]._y = MC._y;
if (MC.hitTest(LocX + MainMC.stars1._x, LocY + MainMC.stars1._y)) {
LocX = random(725);
LocY = random(525);
}
if (MC._x > LocX) {
if (dx > -1) {
dx = dx - 0.1;
} else {
dx = dx + 0.1;
}
} else if (MC._x < LocX) {
if (dx < 1) {
dx = dx + 0.1;
} else {
dx = dx - 0.1;
}
}
if (MC._y > LocY) {
if (dy > -1) {
dy = dy - 0.1;
} else {
dy = dy + 0.1;
}
} else if (MC._y < LocY) {
if (dy < 1) {
dy = dy + 0.1;
} else {
dy = dy - 0.1;
}
}
MC._x = MC._x + ((dx * SPEED) / SPEEDMOD);
MC._y = MC._y + ((dy * SPEED) / SPEEDMOD);
}
}
Symbol 174 MovieClip [__Packages.Particle] Frame 0
class Particle
{
var mc, colorRef, dx, dy, done;
function Particle (MC, xLoc, yLoc, colorR, changeInX, changeInY) {
var _local2 = _level.getNextHighestDepth();
_level.attachMovie("particle", "particle" + _local2, _local2);
mc = _level["particle" + _local2];
mc.cacheAsBitmap = true;
mc._x = xLoc;
mc._y = yLoc;
var gf = (new flash.filters.GlowFilter(colorR, 100, 4, 4, 10, 10, false, false));
var blurFilter = (new flash.filters.BlurFilter(2, 2, 1));
var _local3 = new mx.transitions.Tween(blurFilter, "blurX", mx.transitions.easing.Regular.easeIn, 2, 60, 2 * _level.engine.EnemySPEED, true);
var _local5 = new mx.transitions.Tween(blurFilter, "blurY", mx.transitions.easing.Regular.easeIn, 2, 60, 2 * _level.engine.EnemySPEED, true);
mc.filters = [blurFilter];
var thisR = this;
_local3.onMotionChanged = function () {
thisR.mc.filters = [gf, blurFilter];
};
_local3.onMotionFinished = function () {
thisR.done = true;
};
var _local4 = random(20) / 10;
mc._xscale = mc._xscale * _local4;
mc._yscale = mc._yscale * _local4;
mc.filters = [gf];
colorRef = colorR;
dx = changeInX * 10;
dy = changeInY * 10;
done = false;
}
function Update() {
if (done) {
return(true);
}
mc._x = mc._x + (dx / _level.engine.EnemySPEED);
mc._y = mc._y + (dy / _level.engine.EnemySPEED);
((dx < 0) ? ((dx = dx + 0.05)) : ((dx = dx - 0.05)));
((dy < 0) ? ((dy = dy + 0.05)) : ((dy = dy - 0.05)));
if (mc._x > 550) {
mc._x = 550;
dx = dx * -1;
if (mc._rotation != 0) {
if ((mc._rotation + 90) <= 180) {
mc._rotation = mc._rotation + 90;
} else {
mc._rotation = mc._rotation - 90;
}
}
} else if (mc._x < 0) {
mc._x = 0;
dx = dx * -1;
if (mc._rotation != 180) {
if ((mc._rotation + 90) <= 180) {
mc._rotation = mc._rotation + 90;
} else {
mc._rotation = mc._rotation - 90;
}
}
}
if (mc._y > 400) {
mc._y = 400;
dy = dy * -1;
if (mc._rotation != 90) {
if ((mc._rotation + 90) <= 180) {
mc._rotation = mc._rotation + 90;
} else {
mc._rotation = mc._rotation - 90;
}
}
} else if (mc._y < 0) {
mc._y = 0;
dy = dy * -1;
if (mc._rotation != -90) {
if ((mc._rotation + 90) <= 180) {
mc._rotation = mc._rotation + 90;
} else {
mc._rotation = mc._rotation - 90;
}
}
}
return(false);
}
}
Symbol 103 MovieClip Frame 1
stop();
Symbol 129 MovieClip Frame 1
var starCounter = 0;
while ((starCounter++) < 100) {
this.attachMovie("star", "star" + starCounter, this.getNextHighestDepth());
this["star" + starCounter]._x = random(800);
this["star" + starCounter]._y = random(600);
var scaling = (random(10) + 5);
this["star" + starCounter]._xscale = scaling;
this["star" + starCounter]._yscale = scaling;
this["star" + starCounter]._alpha = random(50) + 20;
var gf = (new flash.filters.GlowFilter(16777215, 50, scaling + 20, scaling + 20, 8, 2, false, false));
this["star" + starCounter].filters = [gf];
}
Symbol 134 MovieClip Frame 1
Symbol 139 MovieClip Frame 1
_visible = false;
Symbol 154 MovieClip Frame 1
stop();
Symbol 157 MovieClip Frame 1
stop();