Frame 1
Security.allowDomain("*");
MochiAd.showPreGameAd({id:"741a844c41c3b750", res:"640x480"});
Frame 2
function gameMenu(menu, obj) {
getURL (_root.authorsSite, "_blank");
}
_root.externalMusic = 0;
_root.gameTitle = "Amoeba";
_root.gameName = "Amoeba";
_root.gameDesc = "Dangers in a microscopic world!";
_root.vNum = "1.37";
_root.flashVersionsNeeded = 8;
_root.authorName = "Terry Paton";
_root.authorContact = "terry@terrypaton.com";
_root.authorsSite = "http://www.terrypaton.com";
_root.legalDomain = "http://www.terrypaton.com";
_root.gameLocation = _root._url.substr(0, legalDomain.length);
_root.gameQuality = "MEDIUM";
var menu_cm = new ContextMenu();
menu_cm.customItems.push(new ContextMenuItem(gameTitle, gameMenu));
menu_cm.hideBuiltInItems();
_root.menu = menu_cm;
fscommand ("fullscreen", true);
this._lockroot = true;
if (gameLocation != legalDomain) {
}
Frame 3
loadingClip.onLoad = function () {
};
loadingClip.onEnterFrame = function () {
pL = Math.floor((this._parent.getBytesLoaded() / this._parent.getBytesTotal()) * 100);
if (pL < 100) {
this.mask._xscale = (pL / 100) * 100;
this._parent.stop();
} else {
i = 0;
while (i < stringLength) {
removeMovieClip(eval ("loadingHolder.l" + i));
i++;
}
this._parent.play();
}
};
wordString = "amoeba";
stringLength = wordString.length;
wordOffset = (stringLength * 20) / 2;
this.createEmptyMovieClip("loadingHolder", 1);
loadingHolder._x = (320 - wordOffset) + 10;
loadingHolder._y = 175;
i = 0;
while (i < stringLength) {
t = loadingHolder.attachMovie("letter", "l" + i, i);
t._x = i * 20;
t.angle = i;
t.Lvar.text = wordString.charAt(i);
t._xscale = (t._yscale = 200);
i++;
}
stop();
Frame 6
function flyingBlobClass() {
}
flyingBlobClass.prototype = new MovieClip();
flyingBlobClass.prototype.onLoad = function () {
this.x = -50 - random(300);
this.y = random(480);
this.gotoAndStop(random(5) + 1);
this.speed = random(7) + 1;
this._x = this.x;
this._y = this.y;
this._xscale = (this._yscale = random(75) + 75);
};
flyingBlobClass.prototype.onEnterFrame = function () {
this.x = this.x + this.speed;
this._x = this.x;
this._y = this.y;
if (this.x > 680) {
this.x = -50 - random(300);
this.y = random(480);
this.gotoAndStop(random(5) + 1);
this.speed = random(5) + 2;
}
};
Object.registerClass("flyingBlobs", flyingBlobClass);
level1quota = 5;
level2quota = 8;
level3quota = 12;
level4quota = 16;
level5quota = 20;
level6quota = 23;
level7quota = 27;
level8quota = 30;
level9quota = 36;
level10quota = 40;
Frame 7
sound1 = new Sound();
sound1.attachSound("sound1");
sound2 = new Sound();
sound2.attachSound("sound2");
sound3 = new Sound();
sound3.attachSound("sound3");
sound4 = new Sound();
sound4.attachSound("sound4");
sound5 = new Sound();
sound5.attachSound("sound5");
sound6 = new Sound();
sound6.attachSound("sound6");
sound7 = new Sound();
sound7.attachSound("sound7");
sound8 = new Sound();
sound8.attachSound("sound8");
sound9 = new Sound();
sound9.attachSound("sound9");
sound10 = new Sound();
sound10.attachSound("sound10");
foodSnd = new Sound();
foodSnd.attachSound("foodSound.wav");
extralife_snd = new Sound();
extralife_snd.attachSound("sound10");
if (_root.externalMusic == 0) {
music1 = new Sound();
music1.attachSound("music1");
gameovermusic = new Sound();
gameovermusic.attachSound("gameovermusic");
intromusic = new Sound();
intromusic.attachSound("intromusic");
optionsmusic = new Sound();
optionsmusic.attachSound("optionsmusic");
gamefinishedmusic = new Sound();
gamefinishedmusic.attachSound("gamefinishedmusic");
}
Frame 8
function stopmusic() {
music1.stop();
optionsmusic.stop();
intromusic.stop();
gameovermusic.stop();
gamefinishedmusic.stop();
}
function playmusic() {
if (musicstate == 1) {
stopmusic();
trace("playing music");
switch (gameScene) {
case "INTRO" :
intromusic.start(0, 90);
return;
case "GAME" :
intromusic.start(0, 90);
return;
case "GAME OVER" :
return;
case "CREDITS" :
return;
case "HOW TO PLAY" :
return;
case "GAME FINISHED" :
intromusic.start(0, 90);
return;
}
}
}
storage = SharedObject.getLocal("amoebaStorage");
level = storage.data.uptolevel;
if (level == undefined) {
storage.data.uptolevel = 1;
level = 1;
}
yourhigh = storage.data.myhighscore;
if (yourhigh == undefined) {
storage.data.myhighscore = 0;
yourhigh = 0;
}
musicstate = storage.data.musicsetting;
if ((musicstate == undefined) || (musicstate == 2)) {
musicstate = 0;
storage.data.musicsetting = 0;
}
Frame 9
function playgame() {
gotoAndPlay (76);
}
function resetlevel() {
this.resetclip.resetclip.gotoAndPlay(2);
storage.data.myhighscore = 0;
yourhigh = 0;
storage.flush();
}
function musicon() {
this.options.on_off.gotoAndStop(1);
musicstate = 1;
storage.data.musicsetting = 1;
playmusic();
}
function musicoff() {
stopmusic();
this.options.on_off.gotoAndStop(2);
musicstate = 0;
storage.data.musicsetting = 0;
}
_root.level = 1;
delete gameState;
_quality = "HIGH";
if (level > 1) {
playcont.gotoAndStop(2);
}
gameScene = "INTRO";
playmusic();
i = 0;
while (i < 5) {
this.flyingBlob_holder.attachMovie("flyingBlobs", "fb" + i, i);
i++;
}
i = 0;
while (i < 5) {
this.flyingBlob_holder2.attachMovie("flyingBlobs", "fb" + i, i);
i++;
}
if (musicstate == 0) {
this.options.on_off.gotoAndStop(2);
}
Frame 75
stop();
Frame 76
function trailClass() {
}
trailClass.prototype = new MovieClip();
trailClass.prototype.onLoad = function () {
this.c = 0;
};
trailClass.prototype.onEnterFrame = function () {
this.c++;
if (this.c > 60) {
removeMovieClip(this);
}
};
Object.registerClass("trail", trailClass);
function powerUpClass() {
}
powerUpClass.prototype = new MovieClip();
powerUpClass.prototype.onLoad = function () {
this.x = this._x;
this.y = this._y;
this.startx = this.x;
this.starty = this.y;
this.yspeed = random(3) + 1;
this.xspeed = random(4) + 1;
this.maxSpeed = 5;
this.starttime = getTimer();
this.gameState = "normal";
this.typeOfpowerUp = random(4) + 1;
this.pointsawarded = 100;
this.gotoAndStop(this.typeOfpowerUp);
};
powerUpClass.prototype.onEnterFrame = function () {
if (this.gameState == "remove") {
removeMovieClip(this);
}
if (_root.gameState == "playing") {
switch (this.typeOfpowerUp) {
case 1 :
this._rotation = this._rotation + 10;
if (this.y < stageTop) {
this.y = stageTop;
this.yspeed = -this.yspeed;
}
if (this.y > stageBottom) {
this.y = stageBottom;
this.yspeed = -this.yspeed;
}
if (this.x > stageRight) {
this.x = stageRight;
this.xspeed = -this.xspeed;
}
if (this.x < stageLeft) {
this.x = stageLeft;
this.xspeed = -this.xspeed;
}
this.y = this.y + (this.yspeed * speedModifier);
this.x = this.x + (this.xspeed * speedModifier);
break;
case 2 :
break;
case 3 :
this._rotation = this._rotation + 10;
break;
case 4 :
break;
}
if (this.hitTest(_root.player) == true) {
trace("power up has hit player");
switch (this.typeOfpowerUp) {
case 1 :
sound1.start();
starPowerUp();
break;
case 2 :
sound2.start();
stunPowerUp();
break;
case 3 :
sound3.start();
spiralPowerUp();
this._rotation = this._rotation + 10;
break;
case 4 :
sound4.start();
shrinkPowerUp();
break;
}
_root.score = _root.score + this.pointsawarded;
gameState = "power up wait start";
powerUpEffect = this.typeOfpowerUp;
removeMovieClip(this);
}
this._x = int(this.x);
this._y = int(this.y);
}
};
Object.registerClass("powerUp", powerUpClass);
function damagePlayer() {
score--;
if (score < 0) {
score = 0;
}
playerEnergy = playerEnergy - 1.2;
if (playerEnergy < 0) {
playerEnergy = 0;
}
energyBar.energyBar_Bar._xscale = playerEnergy;
energyBar.energyLoss.gotoAndPlay(2);
if (playerEnergy < 1) {
gameState = "game over";
}
}
function enemy2Class() {
}
enemy2Class.prototype = new MovieClip();
enemy2Class.prototype.onLoad = function () {
this.x = this._x;
this.y = this._y;
this.startx = this.x;
this.starty = this.y;
this.maxSpeed = 5;
this.starttime = getTimer();
this.eState = "normal";
};
enemy2Class.prototype.onEnterFrame = function () {
if (_root.gameState == "playing") {
if (this.eState == "normal") {
if (this.y < stageTop) {
this.y = stageTop;
this._rotation = this._rotation + 15;
this.clip.yspeed = -this.clip.yspeed;
this.clip.xspeed = -this.clip.xspeed;
}
if (this.y > stageBottom) {
this.y = stageBottom;
this._rotation = this._rotation + 15;
this.clip.yspeed = -this.clip.yspeed;
this.clip.xspeed = -this.clip.xspeed;
}
if (this.x > stageRight) {
this.x = stageRight;
this._rotation = this._rotation + 15;
this.clip.yspeed = -this.clip.yspeed;
this.clip.xspeed = -this.clip.xspeed;
}
if (this.x < stageLeft) {
this.x = stageLeft;
this._rotation = this._rotation + 15;
this.clip.yspeed = -this.clip.yspeed;
this.clip.xspeed = -this.clip.xspeed;
}
this.y = this.y + (this.clip.yspeed * speedModifier);
this.x = this.x + (this.clip.xspeed * speedModifier);
this._x = int(this.x);
this._y = int(this.y);
if (Math.abs(this.x - px) < (25 * (playerScale / 100))) {
if (Math.abs(this.y - py) < (25 * (playerScale / 100))) {
sound1.start();
damagePlayer();
this._rotation = this._rotation + 15;
}
}
this.y = this.y + (this.clip.yspeed * speedModifier);
this.x = this.x + (this.clip.xspeed * speedModifier);
this._x = int(this.x);
this._y = int(this.y);
}
if (this.eState == "stun") {
this.stunCount = 100;
this.eState = "stun wait";
}
if (this.eState == "stun wait") {
this.stunCount--;
if (this.stunCount < 0) {
this.eState = "normal";
}
}
if (this.eState == "kill") {
trace("kill");
this.killCount = 10;
this.eState = "dying";
}
if (this.eState == "dying") {
this._alpha = this._alpha - 10;
this.killCount--;
if (this.killCount < 1) {
removeMovieClip(this);
}
}
}
};
Object.registerClass("enemy2", enemy2Class);
function enemyBClass() {
}
enemyBClass.prototype = new MovieClip();
enemyBClass.prototype.onLoad = function () {
this.x = this._x;
this.y = this._y;
this.startx = this.x;
this.starty = this.y;
this.maxSpeed = 5;
this.starttime = getTimer();
this.eState = "normal";
this.mNum = 0;
if (level < 5) {
this.bugType = 0;
}
if ((level == 5) || (level == 6)) {
this.bugType = random(2);
}
if (level > 6) {
this.bugType = random(3);
}
this.body.gotoAndStop(this.bugType + 1);
};
enemyBClass.prototype.onEnterFrame = function () {
if (_root.gameState == "playing") {
if (this.eState == "normal") {
if (this.y < stageTop) {
this.y = stageTop;
this._rotation = this._rotation + 10;
this.clip.yspeed = -this.clip.yspeed;
this.clip.xspeed = -this.clip.xspeed;
}
if (this.y > stageBottom) {
this.y = stageBottom;
this._rotation = this._rotation + 10;
this.clip.yspeed = -this.clip.yspeed;
this.clip.xspeed = -this.clip.xspeed;
}
if (this.x > stageRight) {
this.x = stageRight;
this._rotation = this._rotation + 10;
this.clip.yspeed = -this.clip.yspeed;
this.clip.xspeed = -this.clip.xspeed;
}
if (this.x < stageLeft) {
this.x = stageLeft;
this._rotation = this._rotation + 10;
this.clip.yspeed = -this.clip.yspeed;
this.clip.xspeed = -this.clip.xspeed;
}
if (this.bugType == 0) {
this.mNum = this.mNum + 0.05;
this.y = this.y + ((4 * Math.cos(this.mNum)) * speedModifier);
this.x = this.x + ((4 * Math.sin(this.mNum)) * speedModifier);
}
if (this.bugType == 1) {
this.mNum = this.mNum + 0.05;
this.y = this.y + ((4 * Math.sin(this.mNum)) * speedModifier);
this.x = this.x + ((4 * Math.cos(this.mNum)) * speedModifier);
}
if (this.bugType == 2) {
this.mNum = this.mNum + 0.03;
this.y = this.y + ((3 * Math.cos(this.mNum)) * speedModifier);
this.x = this.x + ((6 * Math.sin(this.mNum)) * speedModifier);
}
this._x = int(this.x);
this._y = int(this.y);
if (Math.abs(this.x - px) < (25 * (playerScale / 100))) {
if (Math.abs(this.y - py) < (25 * (playerScale / 100))) {
sound1.start();
damagePlayer();
}
}
} else if (this.eState == "stun") {
this.stunCount = 100;
this.eState = "stun wait";
} else if (this.eState == "stun wait") {
this.stunCount--;
if (this.stunCount < 0) {
this.eState = "normal";
}
}
}
if (this.eState == "kill") {
trace("kill");
this.killCount = 10;
this.eState = "dying";
} else if (this.eState == "dying") {
this._alpha = this._alpha - 10;
this.killCount--;
if (this.killCount < 1) {
removeMovieClip(this);
}
}
if (_root.gameState == "paused") {
}
};
Object.registerClass("enemy1", enemyBClass);
function tellplayer(num) {
attachMovie("tell_player", "tellPlayer", 9);
with (tellPlayer) {
_x = 320;
_y = 240;
clip.gotoAndStop(num);
}
_root.playerscore.gotoAndPlay(2);
if (num == 9) {
extralife_snd.start();
}
switch (num) {
case 1 :
_root.score = _root.score + 500;
_root.sound1.start();
return;
case 2 :
_root.score = _root.score + 750;
_root.sound2.start();
return;
case 3 :
_root.score = _root.score + 1000;
_root.sound3.start();
return;
case 4 :
_root.score = _root.score + 2000;
_root.sound4.start();
return;
case 5 :
_root.score = _root.score + 3000;
_root.sound5.start();
return;
case 6 :
_root.score = _root.score + 4000;
_root.sound6.start();
return;
}
}
function pausebtnpress() {
if (_root.gameState == "playing") {
_root.gameState = "paused";
attachMovie("paused_clip", "tellPlayer", 9);
tellPlayer._x = 320;
tellPlayer._y = 240;
} else if (_root.gameState == "paused") {
removeMovieClip("tellPlayer");
_root.gameState = "playing";
}
}
function frameaction() {
switch (gameState) {
case "playing" :
if ((enemyLevel - 1) > 4) {
if (random(500) == 0) {
n = enemyHolder.getNextHighestDepth();
t = enemyHolder.attachMovie("food", "food" + n, n);
}
}
playerEnergy = playerEnergy - 0.035;
if (playerEnergy < 0) {
playerEnergy = 0;
}
if (playerEnergy < 1) {
gameState = "game over";
}
energyBar.energyBar_Bar._xscale = playerEnergy;
if (speedModifier < 0.8) {
speedModifier = speedModifier + 0.001;
}
if ((((pxmove > 0.5) || (pymove > 0.5)) || (pxmove < -0.5)) || (pymove < -0.5)) {
if (random(3) == 0) {
t = trailHolder.attachMovie("trail", "tr" + trNum, trNum);
t._x = px + random(5);
t._y = py + random(5);
new mx.transitions.Tween(t, "_xscale", mx.transitions.easing.Strong.easeOut, 100, 30, 2, true);
new mx.transitions.Tween(t, "_yscale", mx.transitions.easing.Strong.easeOut, 100, 30, 2, true);
b = new mx.transitions.Tween(t, "_alpha", mx.transitions.easing.Strong.easeOut, 70, 10, 2, true);
b.temp = t;
b.onMotionFinished = function () {
removeMovieClip(temp);
};
trNum++;
if (trNum > 60) {
trNum = 1;
}
}
}
if (Key.isDown(leftKey)) {
ptx = ptx - 10;
}
if (Key.isDown(rightKey)) {
ptx = ptx + 10;
}
if (Key.isDown(upKey)) {
pty = pty - 10;
}
if (Key.isDown(downKey)) {
pty = pty + 10;
}
pxmove = (ptx - px) * 0.2;
pymove = (pty - py) * 0.2;
lastpx = px;
lastpy = py;
px = px + pxmove;
py = py + pymove;
player._x = px;
player._y = py;
if (Math.abs(enemyHolder.levelTarget._x - px) < (30 * (playerScale / 100))) {
if (Math.abs(enemyHolder.levelTarget._y - py) < (30 * (playerScale / 100))) {
sound10.start();
playerEnergy = playerEnergy + 3;
if (playerEnergy > 100) {
playerEnergy = 100;
}
energyBar.energyBar_Bar._xscale = playerEnergy;
energyBar.energyLoss.gotoAndPlay(2);
removeMovieClip("enemyHolder.levelTarget");
playerScale = playerScale + 5;
player.itemCollected_clip.gotoAndPlay(1);
player._xscale = playerScale;
player._yscale = playerScale;
score = score + (level * 15);
playerscore.gotoAndPlay(2);
currentLevelCollect++;
currentLevelquota = eval (("level" + level) + "quota");
remainObjects = currentLevelquota - currentLevelCollect;
if (currentLevelCollect >= currentLevelquota) {
gameState = "level complete";
playerEnergy = playerEnergy + 15;
if (playerEnergy > 100) {
playerEnergy = 100;
}
energyBar.energyBar_Bar._xscale = playerEnergy;
} else {
trace("add more baddies");
addmoreBaddies();
addTarget();
}
}
}
if (px < stageLeft) {
px = stageLeft;
ptx = stageLeft;
}
if (px > stageRight) {
px = stageRight;
ptx = stageRight;
}
if (py < stageTop) {
py = stageTop;
pty = stageTop;
}
if (py > stageBottom) {
py = stageBottom;
pty = stageBottom;
}
if ((pxmove > 0.5) || (pymove > 0.5)) {
this.player.playerbody1._rotation = this.player.playerbody1._rotation + 5;
} else if ((pxmove < -0.5) || (pymove < -0.5)) {
this.player.playerbody1._rotation = this.player.playerbody1._rotation - 5;
}
xOff = px - lastpx;
yOff = py - lastpy;
this.player.playerbody1._x = -xOff;
this.player.playerbody1._y = -yOff;
this.player.playerbody2._x = -(xOff * 2);
this.player.playerbody2._y = -(yOff * 2);
this.player.playerTail._x = -xOff;
this.player.playerTail._y = -yOff;
this.player.playerTail2._x = -(xOff * 2);
this.player.playerTail2._y = -(yOff * 2);
return;
case "begin" :
setuplevel();
gameState = "begin wait";
bWait = 30;
return;
case "power up wait" :
powerWaitCount++;
if (powerWaitCount > powerWaitDelay) {
gameState = "playing";
}
switch (powerUpEffect) {
case 1 :
score = score + 2;
i = 0;
while (i < 25) {
t = eval ("enemyHolder.b" + i);
if (powerClip.hitTest(t) == true) {
if ((t.eState != "kill") && (t.eState != undefined)) {
trace("hit enemiy = " + i);
t.eState = "kill";
score = score + 1;
}
}
i++;
}
break;
case 2 :
score = score + 2;
i = 0;
while (i < 25) {
t = eval ("enemyHolder.b" + i);
if ((powerClip.hitTest(t) == true) && (t.eState != undefined)) {
if (t.eState != "stun") {
trace("hit enemy = " + i);
t.eState = "stun";
}
}
i++;
}
break;
case 3 :
score = score + 2;
speedModifier = speedModifier - 0.03;
if (speedModifier < 0.03) {
speedModifier = 0.03;
}
break;
case 4 :
playerScale = playerScale - 1.2;
if (playerScale < 100) {
playerScale = 100;
}
player._xscale = playerScale;
player._yscale = playerScale;
score = score + 2;
break;
}
return;
case "begin wait" :
bWait--;
if (bWait < 1) {
gameState = "playing";
}
return;
case "level complete" :
i = 0;
while (i < 500) {
removeMovieClip(eval ("enemyHolder.b" + i));
i++;
}
i = 200;
while (i < 220) {
removeMovieClip(eval ("enemyHolder.powerUp" + i));
i++;
}
t = attachMovie("level_complete", "tellPlayer", 200);
t._x = 320;
t._y = 240;
gameState = "level complete wait";
count = 100;
return;
case "level complete wait" :
count--;
if (count < 1) {
gameState = "next level";
}
return;
case "next level" :
level++;
if (level > 9) {
removeMovieClip(player);
gotoAndPlay (117);
} else {
setuplevel();
gameState = "begin wait";
bWait = 30;
}
return;
case "game over" :
removeMovieClip(player);
gotoAndPlay ("GAMEOVER");
return;
case "start again" :
attachMovie("ready_announce", "tellPlayer", 9);
tellPlayer._x = 320;
tellPlayer._y = 240;
_global.playerState = 1;
attachMovie("player", "player", 180);
player._x = px;
player._y = py;
gameState = "begin wait";
bWait = 30;
return;
case "paused" :
return;
case "power up wait start" :
pxmove = 0;
pymove = 0;
ptx = px;
pty = py;
powerWaitCount = 0;
powerWaitDelay = 30;
gameState = "power up wait";
}
}
function addmoreBaddies() {
trace("enemyLevel = " + enemyLevel);
if (level < 3) {
e = enemyHolder.attachMovie("enemy1", "b" + enemyLevel, enemyLevel);
}
if ((level == 3) || (level == 4)) {
if (random(10) < 5) {
e = enemyHolder.attachMovie("enemy1", "b" + enemyLevel, enemyLevel);
} else {
e = enemyHolder.attachMovie("enemy2", "b" + enemyLevel, enemyLevel);
}
}
if (level > 4) {
if (random(6) < 3) {
e = enemyHolder.attachMovie("enemy1", "b" + enemyLevel, enemyLevel);
} else {
e = enemyHolder.attachMovie("enemy2", "b" + enemyLevel, enemyLevel);
}
}
with (e) {
c = random(2);
if (c == 0) {
} else {
_x = -20;
_y = findNewYLocation();
}
a = random(4);
botSpeed = (Math.random() * 3) + 1;
switch (a) {
case 0 :
clip.xspeed = -botSpeed;
clip.yspeed = -botSpeed;
_x = findNewXLocation();
_y = -20;
if (py < 100) {
_y = 500;
}
break;
case 1 :
clip.xspeed = botSpeed;
clip.yspeed = -botSpeed;
_x = findNewXLocation();
_y = -20;
if (py < 100) {
_y = 500;
}
break;
case 2 :
clip.xspeed = 0;
clip.yspeed = botSpeed;
_x = findNewXLocation();
_y = -20;
if (py < 100) {
_y = 500;
}
break;
case 3 :
clip.xspeed = botSpeed;
clip.yspeed = 0;
_x = -20;
_y = findNewYLocation();
if (px < 100) {
_x = 660;
}
break;
}
}
enemyLevel++;
}
function addPowerUp() {
if ((enemyLevel - 1) > 3) {
if (random(6) < 2) {
nextClip = 200;
n = enemyHolder.getNextHighestDepth();
t = enemyHolder.attachMovie("powerUp", "powerUp" + nextClip, nextClip);
t._x = findNewXLocation();
t._y = findNewYLocation();
}
}
}
function findNewXLocation() {
tempXD = 10;
while (tempXD < 150) {
newX = random(520) + 60;
tempXD = Math.abs(px - newX);
if (newX < 0) {
newX = 20;
}
if (newX > 640) {
newX = 620;
}
}
return(Math.floor(newX));
}
function findNewYLocation() {
tempYD = 10;
while (tempYD < 150) {
newY = random(360) + 60;
tempYD = Math.abs(py - newY);
}
if (newY < 0) {
newY = 20;
}
if (newY > 480) {
newY = 460;
}
return(Math.floor(newY));
}
function starPowerUp() {
attachMovie("starPower", "powerClip", 198);
powerClip._x = px;
powerClip._y = py;
}
function stunPowerUp() {
attachMovie("stunPower", "powerClip", 198);
powerClip._x = px;
powerClip._y = py;
}
function spiralPowerUp() {
attachMovie("spiralPower", "powerClip", 198);
powerClip._x = px;
powerClip._y = py;
}
function shrinkPowerUp() {
attachMovie("shrinkPower", "powerClip", 198);
powerClip._x = px;
powerClip._y = py;
}
function addTarget() {
t = enemyHolder.attachMovie("levelTarget", "levelTarget", 1000);
t._x = findNewXLocation();
t._y = findNewYLocation();
t._rotation = random(360);
addPowerUp();
}
function playSound(temp) {
if (temp == "food") {
foodSnd.start();
}
}
function setup() {
playerEnergy = 100;
_quality = _root.gameQuality;
extralives = 0;
_root.lives = 2;
_root.score = 0;
_global.playerState = 1;
ptx = px;
pty = py;
trNum = 1;
_global.gameState = "begin";
acl = 0;
_global.prot = 0;
_root.pnum = 2;
gameScene = "GAME";
}
function musicon() {
this.on_off.gotoAndStop(1);
musicstate = 1;
storage.data.musicsetting = 1;
playmusic();
}
function musicoff() {
stopmusic();
this.on_off.gotoAndStop(2);
musicstate = 0;
storage.data.musicsetting = 0;
}
if (musicstate == 0) {
this.on_off.gotoAndStop(2);
}
function setuplevel() {
border.gotoAndStop(level);
enemyLevel = 1;
powerUpEffect = 0;
currentLevelCollect = 0;
currentLevelquota = eval (("level" + level) + "quota");
remainObjects = currentLevelquota - currentLevelCollect;
speedModifier = 1;
playerScale = 100;
px = 320;
py = 400;
ptx = px;
pty = py;
addTarget();
upKey = 38;
downKey = 40;
leftKey = 37;
rightKey = 39;
stageLeft = 20;
stageRight = 640;
stageTop = 20;
stageBottom = 460;
_root.levelann = "Level " + level;
attachMovie("level_announce", "tellPlayer", 200);
tellPlayer._x = 320;
tellPlayer._y = 240;
background.gotoAndStop(level);
background.back_blobs._rotation = random(360);
attachMovie("player", "player", 196);
player.attachMovie("playerbody2", "playerbody2", 197);
player.attachMovie("playerbody1", "playerbody1", 198);
player.itemCollected_clip.gotoAndPlay(1);
player._x = px;
player._y = py;
lastpx = px;
lastpy = py;
xOff = px - lastpx;
yOff = py - lastpy;
this.player.playerbody1._x = -xOff;
this.player.playerbody1._y = -yOff;
this.player.playerbody2._x = -(xOff * 2);
this.player.playerbody2._y = -(yOff * 2);
this.player.playerTail._x = -xOff;
this.player.playerTail._y = -yOff;
this.player.playerTail2._x = -(xOff * 2);
this.player.playerTail2._y = -(yOff * 2);
playerState = 1;
addmoreBaddies();
playmusic();
}
Instance of Symbol 224 MovieClip in Frame 76
onClipEvent (enterFrame) {
_root.frameaction();
}
Frame 85
setup();
stop();
Frame 86
if (false) {
}
Frame 87
if (score > yourhigh) {
yourhigh = score;
newscore.gotoAndStop(2);
storage.data.myhighscore = score;
}
if (score > 5000) {
t = this.createEmptyMovieClip("highHolder", 1000);
loadMovie ("http://www.terrypaton.com/highscores/highscoreSubmit.swf", highHolder);
t._x = 81;
t._y = 340;
}
if (yourhigh != undefined) {
yourHighestText = "YOUR HIGHEST SCORE: " + yourhigh;
} else {
yourHighestText = " ";
}
storage.data.uptolevel = level;
storage.flush();
gamescene = "game over";
playmusic();
Frame 94
stop();
Frame 95
function gomain() {
_root.state = "start again";
gotoAndPlay (9);
}
gameScene = "CREDITS";
playmusic();
Frame 107
stop();
Frame 108
function gomain() {
_root.gameState = "start again";
gotoAndPlay (9);
}
if (musicstate == 0) {
this.options.on_off.gotoAndStop(2);
}
gameScene = "HOW TO PLAY";
playmusic();
Frame 116
stop();
Frame 117
if (score > yourhigh) {
yourhigh = score;
storage.data.myhighscore = score;
}
if (score > 5000) {
t = this.createEmptyMovieClip("highHolder", 1000);
loadMovie ("http://www.terrypaton.com/highscores/highscoreSubmit.swf", highHolder);
t._x = 26;
t._y = 328;
}
if (yourhigh != undefined) {
yourHighestText = "YOUR HIGHEST SCORE: " + yourhigh;
} else {
yourHighestText = " ";
}
storage.data.uptolevel = 1;
level = 1;
gameScene = "GAME FINISHED";
playmusic();
i = 0;
while (i < 10) {
this.flyingBlob_holder.attachMovie("flyingBlobs", "fb" + i, i);
i++;
}
a = new mx.transitions.Tween(youRock, "_xscale", mx.transitions.easing.Elastic.easeOut, 10, 100, 4, true);
b = new mx.transitions.Tween(youRock, "_yscale", mx.transitions.easing.Elastic.easeOut, 10, 100, 4, true);
Frame 131
stop();
Symbol 286 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.3");
}
static function showPreGameAd(options) {
var _local27 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}};
options = _parseOptions(options, _local27);
if ("5cc6f7dfb67f2f08341c831480f7c2a7".length == 0) {
options.ad_started();
options.ad_finished();
return(undefined);
}
var clip = options.clip;
var _local23 = 11000;
var _local26 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local7._x = 10;
_local7._y = _local13 - 20;
var _local22 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local7.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local7.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local22);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local6 = _local7.createEmptyMovieClip("_outline", 3);
_local6.lineStyle(0, _local24, 100);
_local6.moveTo(0, 0);
_local6.lineTo(_local4 - 20, 0);
_local6.lineTo(_local4 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
chk.ad_msec = _local23;
chk.ad_timeout = _local26;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local12 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local10 = (100 * _local8) / _local4;
var _local11 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local10 || 0, _local11));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local9._xscale = _local2;
if (!chk.showing) {
var _local7 = _local12.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local5 > chk.ad_timeout) {
options.ad_failed();
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showTimedAd(options) {
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
showInterLevelAd(options);
}
static function showPreloaderAd(options) {
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
showPreGameAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function _loadCommunicator(options) {
var _local26 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _parseOptions(options, _local26);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local18 = options.clip;
var _local20 = "_mochiad_com_" + options.id;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local18[_local20]) {
return(_local18[_local20].lc);
}
var _local21 = options.com_server + options.id;
_allowDomains(_local21);
delete options.id;
delete options.com_server;
var _local25 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local25);
var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1);
for (var _local15 in options) {
_local11[_local15] = options[_local15];
}
var _local6 = new LocalConnection();
var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local6.mc = _local17;
_local6.name = _local16;
_local6.allowDomain = function (d) {
return(true);
};
_local6.allowInsecureDomain = _local6.allowDomain;
_local6.connect(_local16);
_local17.lc = _local6;
_local11.lc = _local16;
_local6._id = 0;
_local6._queue = [];
_local6.rpcResult = function (cb_arg) {
var _local8 = parseInt(cb_arg);
var _local4 = this._callbacks[_local8];
if (!_local4) {
return(undefined);
}
delete this._callbacks[_local8];
var _local5 = [];
var _local3 = 2;
while (_local3 < _local4.length) {
_local5.push(_local4[_local3]);
_local3++;
}
_local3 = 1;
while (_local3 < arguments.length) {
_local5.push(arguments[_local3]);
_local3++;
}
var _local6 = _local4[1];
var _local7 = _local4[0];
if (_local7 && (typeof(_local6) == "string")) {
_local6 = _local7[_local6];
}
if (_local6) {
_local6.apply(_local7, _local5);
}
};
_local6._didConnect = function (endpoint) {
this._endpoint = endpoint;
var _local4 = this._queue;
delete this._queue;
var _local5 = this.doSend;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local5.apply(this, _local3);
_local2++;
}
};
_local6.doSend = function (args, cbobj, cbfn) {
if (this._endpoint == null) {
var _local4 = [];
var _local3 = 0;
while (_local3 < arguments.length) {
_local4.push(arguments[_local3]);
_local3++;
}
this._queue.push(_local4);
return(undefined);
}
this._id = this._id + 1;
var _local5 = this._id;
if ((cbfn === undefined) || (cbfn === null)) {
cbfn = cbobj;
}
this._callbacks[_local5] = [cbobj, cbfn];
var _local7 = new LocalConnection();
var _local9 = _local7.send(this._endpoint, "rpc", _local5, args);
};
_local6._callbacks = {};
_local6._callbacks[0] = [_local6, "_didConnect"];
_local11.st = getTimer();
_local11.loadMovie(_local21 + ".swf", "POST");
return(_local6);
}
static function fetchHighScores(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}
static function sendHighScore(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local9 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local9._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local9._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local8;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
_local6.lc = _local5;
_local4.lc = _local8;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
if (_local4.id == "test") {
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
}
return(_local4);
}
}
Symbol 287 MovieClip [__Packages.letterClass] Frame 0
class letterClass extends MovieClip
{
var centerY, radiusY, speed, y, _y, x, _x, angle;
function letterClass () {
super();
}
function onLoad() {
centerY = 48;
radiusY = 5;
speed = 0.05;
y = _y;
x = _x;
}
function onEnterFrame() {
if (angle != undefined) {
y = centerY + (Math.sin(angle) * radiusY);
angle = angle + speed;
_x = x;
_y = y;
}
}
}
Symbol 288 MovieClip [__Packages.foodClass] Frame 0
class foodClass extends MovieClip
{
var xMove, angle, speed, yMove, scoreBonus, x, y, _y, _x, hitTest, removeMovieClip;
function foodClass () {
super();
}
function findPath() {
xMove = speed * Math.cos((angle * Math.PI) / 180);
yMove = speed * Math.sin((angle * Math.PI) / 180);
}
function onLoad() {
scoreBonus = 5;
angle = (90 + random(30)) - 15;
x = random(600) + 20;
y = -10;
speed = (Math.random() * 3) + 3;
findPath();
}
function onEnterFrame() {
if (_root.gameState == "playing") {
y = y + yMove;
x = x + xMove;
_y = y;
_x = x;
if (hitTest(_root.player) == true) {
_root.score = _root.score + scoreBonus;
_root.playSound("food");
removeMovieClip();
}
if (y > 490) {
removeMovieClip();
}
}
}
}
Symbol 289 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 290 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 291 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 292 MovieClip [__Packages.mx.transitions.easing.Strong] Frame 0
class mx.transitions.easing.Strong
{
function Strong () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return((((((c * t) * t) * t) * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = (t / d) - 1;
return((c * (((((t * t) * t) * t) * t) + 1)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return(((((((c / 2) * t) * t) * t) * t) * t) + b);
}
t = t - 2;
return(((c / 2) * (((((t * t) * t) * t) * t) + 2)) + b);
}
static var version = "1.1.0.52";
}
Symbol 293 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 12 MovieClip [letter] Frame 1
#initclip 9
Object.registerClass("letter", letterClass);
#endinitclip
Symbol 25 MovieClip Frame 1
stop();
Symbol 26 MovieClip [tell_player] Frame 65
removeMovieClip(this);
Symbol 42 MovieClip Frame 12
stop();
Symbol 52 MovieClip [shrinkPower] Frame 31
removeMovieClip(this);
Symbol 55 MovieClip [spiralPower] Frame 31
removeMovieClip(this);
Symbol 58 MovieClip [starPower] Frame 31
removeMovieClip(this);
Symbol 60 MovieClip [stunPower] Frame 31
removeMovieClip(this);
Symbol 65 MovieClip [ready_announce] Frame 76
gameState = "playing";
removeMovieClip(this);
Symbol 71 Button
on (release) {
_root.pausebtnpress();
}
Symbol 72 MovieClip [paused_clip] Frame 30
stop();
Symbol 75 MovieClip [lifelost] Frame 80
_root.state = "start again";
removeMovieClip(this);
Symbol 78 MovieClip [level_announce] Frame 77
_root.state = "playing";
removeMovieClip(this);
Symbol 95 MovieClip Frame 1
stop();
Symbol 101 MovieClip [level_complete] Frame 100
removeMovieClip(this);
Symbol 107 MovieClip Frame 1
stop();
Symbol 111 MovieClip Frame 1
stop();
Symbol 113 MovieClip [player] Frame 1
Symbol 123 MovieClip [levelTarget] Frame 15
stop();
Symbol 125 MovieClip [food] Frame 1
#initclip 10
Object.registerClass("food", foodClass);
#endinitclip
Symbol 139 MovieClip Frame 1
stop();
Symbol 148 MovieClip Frame 1
_root.stop();
Symbol 148 MovieClip Frame 75
_root.play();
Symbol 162 Button
on (release) {
gotoAndPlay (95);
}
Symbol 168 Button
on (release) {
gotoAndPlay (108);
}
Symbol 173 MovieClip Frame 23
stop();
Symbol 174 Button
on (press) {
_root.musicoff();
this.over.play();
}
Symbol 177 Button
on (press) {
_root.musicon();
this.over.play();
}
Symbol 178 MovieClip Frame 1
stop();
Symbol 183 MovieClip Frame 1
stop();
Symbol 188 Button
on (release) {
_root.resetlevel();
}
Symbol 195 Button
on (press) {
_root.playgame();
}
Symbol 197 MovieClip Frame 1
stop();
Symbol 206 MovieClip Frame 1
this.onPress = function () {
getURL ("http://www.terrypaton.com", "_blank");
};
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.stop();
Symbol 215 MovieClip Frame 1
stop();
Symbol 220 MovieClip Frame 1
stop();
Symbol 231 MovieClip Frame 1
stop();
Symbol 239 MovieClip Frame 1
stop();
Symbol 248 MovieClip Frame 1
stop();
Symbol 251 MovieClip Frame 1
stop();
Symbol 255 Button
on (release) {
_root.gameState = "start again";
gotoAndPlay (9);
}
Symbol 264 Button
on (release) {
getURL ("http://www.terrypaton.com", "_blank");
}
Symbol 266 Button
on (release) {
_root.gomain();
}
Symbol 278 Button
on (release) {
gotoAndPlay (9);
}