Frame 1
MochiAd.showPreGameAd({id:"1486626657c49d94", res:"640x480"});
Frame 2
function gameMenu(menu, obj) {
getURL (_root.authorsSite, "_blank");
}
this._lockroot = true;
var gameName = "gyrustakee";
_root.gameTitle = "Gyrustakee";
vNum = "1.01";
gameQuality = "AUTO";
_quality = "HIGH";
authorsSite = "http://www.terrypaton.com";
var menu_cm = new ContextMenu();
menu_cm.customItems.push(new ContextMenuItem(authorsSite, gameMenu));
menu_cm.hideBuiltInItems();
_root.menu = menu_cm;
legalDomain = "http://www.terrypaton.com";
gameLocation = _root._url.substr(0, legalDomain.length);
if (gameLocation != legalDomain) {
}
_root.externalMusic = 1;
_root.lastLevel = 10;
Frame 3
gameLoadingName = "gyrustake";
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();
}
};
stringLength = gameLoadingName.length;
wordOffset = (stringLength * 10) / 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 * 10;
t.angle = i;
t.Lvar.text = gameLoadingName.charAt(i);
t._xscale = (t._yscale = 200);
i++;
}
stop();
Frame 6
function calcX(tRot, tDepth) {
this.temprot = (tRot / 180) * Math.PI;
return(320 + (tDepth * Math.sin(this.temprot)));
}
function calcY(tRot, tDepth) {
this.temprot = (tRot / 180) * Math.PI;
return(240 + (tDepth * Math.cos(this.temprot)));
}
function calcScale(tDepth) {
return(10 + (90 * (tDepth / 200)));
}
function starClass() {
}
function makeStars() {
if (sA < sM) {
sC++;
if (sC > sD) {
sC = 0;
sA++;
starGen.attachMovie("star", "s" + sA, sA);
with (eval ("starGen.s" + sA)) {
_x = -5;
}
}
}
}
starClass.prototype = new MovieClip();
starClass.prototype.onLoad = function () {
this.rot = random(360);
this.depth = 20;
this.gotoAndStop(1 + random(3));
};
starClass.prototype.onEnterFrame = function () {
if (_root.gameState != "paused") {
this.depth = this.depth * 1.1;
if (this.depth > 400) {
this.rot = random(360);
this.depth = 20;
}
this._x = _root.calcX(this.rot, this.depth);
this._y = _root.calcY(this.rot, this.depth);
this.scale = _root.calcScale(this.depth);
this._xscale = (this._yscale = this.scale);
}
};
Object.registerClass("star", starClass);
Frame 7
function attachSoundFromLibrary(idname) {
var _local2 = new Sound(this);
_local2.attachSound(idname);
return(_local2);
}
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;
}
var mouseOverSnd = attachSoundFromLibrary("mouseOverSound");
var mouseDownSnd = attachSoundFromLibrary("mouseDownSound");
var gameOverSnd = attachSoundFromLibrary("gameOverSound");
var collectSnd = attachSoundFromLibrary("collectSound");
var hurtSnd = attachSoundFromLibrary("hurtSound");
var bonusSnd = attachSoundFromLibrary("bonusSound");
var fire_snd1 = attachSoundFromLibrary("playerShootSound1");
var fire_snd2 = attachSoundFromLibrary("playerShootSound2");
var fire_snd3 = attachSoundFromLibrary("playerShootSound3");
var explodeSnd1 = attachSoundFromLibrary("explodeSound1");
var explodeSnd2 = attachSoundFromLibrary("explodeSound2");
var explodeSnd3 = attachSoundFromLibrary("explodeSound3");
var explodeSnd4 = attachSoundFromLibrary("explodeSound4");
var explodeSnd5 = attachSoundFromLibrary("explodeSound5");
var explodeSnd6 = attachSoundFromLibrary("explodeSound6");
var playerExplodesSnd = attachSoundFromLibrary("playerExplodesSound");
var intromusic = attachSoundFromLibrary("intromusic");
var gamefinishedmusic = attachSoundFromLibrary("gamefinishedmusic");
Frame 8
function stopmusic() {
music1.stop();
optionsmusic.stop();
intromusic.stop();
gameovermusic.stop();
gamefinishedmusic.stop();
}
function playmusic() {
trace("musicstate = " + musicstate);
if (musicstate == 1) {
stopmusic();
trace("playing music");
switch (gameScene) {
case "INTRO" :
intromusic.start(0, 90);
return;
case "GAME" :
intromusic.start(0, 90);
return;
}
}
}
storage = SharedObject.getLocal("store");
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 = 1;
storage.data.musicsetting = 1;
}
Frame 9
function resetlevel() {
storage.data.myhighscore = 0;
yourhigh = 0;
_root.resetclip.gotoAndPlay(2);
storage.flush();
}
delete gameState;
_quality = "HIGH";
level = 1;
playBtn.onRollOver = function () {
mouseOverSnd.start();
};
playBtn.onPress = function () {
mouseDownSnd.start();
gotoAndPlay (18);
};
optionsBtn.onRollOver = function () {
mouseOverSnd.start();
};
optionsBtn.onPress = function () {
mouseDownSnd.start();
gotoAndPlay (9);
};
gameScene = "INTRO";
playmusic();
if (musicstate == 0) {
this.on_off.gotoAndStop(2);
}
sA = 0;
sM = 40;
sC = 0;
sD = 2;
Instance of Symbol 332 MovieClip "starGen" in Frame 9
onClipEvent (enterFrame) {
_parent.makeStars();
}
Frame 10
if (false) {
}
Frame 17
stop();
Frame 18
function asteroidClass() {
}
asteroidClass.prototype = new MovieClip();
asteroidClass.prototype.onLoad = function () {
this.rot = random(360);
this.scope = 100 - (_root.level * 10);
this.rot = (_root.prot + (Math.random() * this.scope)) - (this.scope / 2);
trace(Math.random(this.scope) - (this.scope / 2));
trace("asteroids rot = " + this.rot);
this.strength = 6;
this.pointsawarded = 500;
this.state = "normal";
this.clip._visible = false;
};
asteroidClass.prototype.onEnterFrame = function () {
if (_root.gameState != "paused") {
if (this.state == "explode") {
explodeSnd3.start();
_root.addExplosion(this.rot, this.clip.depth);
removeMovieClip(this);
}
if (this.state == "normal") {
this.clip.depth = this.clip.depth * zoomSpeed;
if (_root.gameState == "level finished wait") {
if (this.clip.depth < 15) {
removeMovieClip(this);
}
this.clip.depth = this.clip.depth * exitZoomSpeed;
}
if (this.clip.depth > 400) {
removeMovieClip(this);
}
this.shot = _root.testShot(this.clip);
if (this.shot != false) {
this.strength--;
if (this.strength < 1) {
this.state = "explode";
_root.score = _root.score + this.pointsawarded;
}
}
this.hitplayer = _root.testHitPlayer(this.clip);
if ((this.hitplayer != false) && (this.hitplayer != undefined)) {
if (_root.gameState != "level finished wait") {
_root.playerHit("asteroid");
this.state = "explode";
}
}
}
this._x = _root.calcX(this.rot, this.clip.depth);
this._y = _root.calcY(this.rot, this.clip.depth);
this.scale = _root.calcScale(this.clip.depth);
this._xscale = (this._yscale = this.scale);
}
};
Object.registerClass("asteroid", asteroidClass);
function enemy1Class() {
}
enemy1Class.prototype = new MovieClip();
enemy1Class.prototype.onLoad = function () {
this.startRot = random(360);
this.startRot = _root.prot;
this.scope = 100 - (_root.level * 10);
this.startRot = (_root.prot + (Math.random() * this.scope)) - (this.scope / 2);
this.baserot = this.startRot;
this.offset = random(360);
this.firing = 1;
this.firedelay = 45;
this.strength = 1;
this.pointsawarded = 300;
this.formationWait = 260 + random(20);
this.formationCount = 0;
this.clip.depth = 0.5;
this.rot = 0;
this.clip._visible = false;
this.angle = 0;
this.range = 30;
this.ySpeed = 0.025;
this.centerScale = this.startRot;
};
enemy1Class.prototype.onEnterFrame = function () {
if (_root.gameState == "playing") {
switch (this.enemyState) {
case "setup" :
this.enemyState = "fly into formation";
break;
case "explode" :
explodeSnd1.start();
_root.lvlAliensKilled++;
_root.addExplosion(this.rot, this.clip.depth);
removeMovieClip(this);
break;
case "fly into formation" :
this.clip.depth = this.clip.depth * zoomSpeed;
if (this.clip.depth > this.clip.formationDepth) {
this.enemyState = "waiting in formation";
this.formationCount = 0;
}
break;
case "waiting in formation" :
this.formationCount++;
if (this.formationCount > this.formationWait) {
this.formationCount = 0;
this.enemyState = "flying out";
}
this.firedelay--;
if (this.firedelay < 1) {
this.firedelay = random(50) + 15;
this.bname = _root.enemyBulletHolder.attachMovie("enemyBullet", "b" + enemyBulletNum, enemyBulletNum);
this.bname.clip.depth = this.clip.depth;
this.bname.clip.rot = this.rot;
enemyBulletNum++;
}
break;
case "flying out" :
this.firedelay--;
if (this.firedelay < 1) {
this.firedelay = random(50) + 25;
this.bname = _root.enemyBulletHolder.attachMovie("enemyBullet", "b" + enemyBulletNum, enemyBulletNum);
this.bname.clip.depth = this.clip.depth;
this.bname.clip.rot = this.rot;
enemyBulletNum++;
}
this.clip.depth = this.clip.depth * zoomSpeed;
if (this.clip.depth > 400) {
this.offset = random(360);
this.clip.depth = 0.5;
this.enemyState = "fly into formation";
}
if (this.clip.hitTest(player.hitClip)) {
this.enemyState = "explode";
_root.playerHit("enemy");
}
break;
default :
this.enemyState = "setup";
}
if ((this.enemyState != "explode") && (this.enemyState != "explode wait")) {
this.shot = _root.testShot(this.clip);
if (this.shot != false) {
this.strength--;
if (this.strength < 1) {
this.enemyState = "explode";
_root.score = _root.score + this.pointsawarded;
}
}
}
this.sinMove = Math.sin(this.startRot + this.angle) * this.range;
this.baserot = this.sinMove;
this.cliptogo = 8 - Math.floor(this.sinMove / 4);
this.gotoAndStop(this.cliptogo);
this.angle = this.angle + this.ySpeed;
this.rot = this.baserot + this.offset;
this._x = _root.calcX(this.rot, this.clip.depth);
this._y = _root.calcY(this.rot, this.clip.depth);
this._xscale = (this._yscale = _root.calcScale(this.clip.depth));
this._rotation = 360 - this.rot;
}
};
Object.registerClass("enemy1", enemy1Class);
function addExplosion(a, b) {
c = enemyHolder.attachMovie("explosion", "ex" + en, en);
with (eval ("enemyHolder.ex" + en)) {
_x = -15;
clip.rot = a;
clip.depth = b;
clip.formationDepth = 70;
}
en++;
}
ex = 0;
function enemy4Class() {
}
enemy4Class.prototype = new MovieClip();
enemy4Class.prototype.onLoad = function () {
trace("SHIP4");
this.startRot = random(360);
this.scope = 100 - (_root.level * 10);
this.startRot = (_root.prot + (Math.random() * this.scope)) - (this.scope / 2);
this.baserot = this.startRot;
this.offset = random(360);
this.firing = 1;
this.firedelay = 45;
this.strength = 4;
this.pointsawarded = 300;
this.formationWait = 260 + random(20);
this.formationCount = 0;
this.clip.depth = 0.5;
this.rot = this.baserot;
this.clip._visible = false;
this.angle = random(360);
this.range = 30;
this.ySpeed = 0.025;
this.centerScale = this.startRot;
};
enemy4Class.prototype.onEnterFrame = function () {
if (_root.gameState == "playing") {
switch (this.enemyState) {
case "setup" :
this.enemyState = "fly into formation";
break;
case "explode" :
explodeSnd2.start();
_root.addExplosion(this.rot, this.clip.depth);
removeMovieClip(this);
_root.lvlAliensKilled++;
break;
case "fly into formation" :
this.clip.depth = this.clip.depth * 1.03;
if (this.clip.depth > this.clip.formationDepth) {
this.enemyState = "waiting in formation";
this.formationCount = 0;
}
break;
case "waiting in formation" :
this.formationCount++;
if (this.formationCount > this.formationWait) {
this.formationCount = 0;
this.enemyState = "flying out";
}
this.firedelay--;
if (this.firedelay < 1) {
this.firedelay = random(50) + 15;
this.bname = _root.enemyBulletHolder.attachMovie("enemyBullet", "b" + enemyBulletNum, enemyBulletNum);
this.bname.clip.depth = this.clip.depth;
this.bname.clip.rot = this.rot - 3;
enemyBulletNum++;
this.bname = _root.enemyBulletHolder.attachMovie("enemyBullet", "b" + enemyBulletNum, enemyBulletNum);
this.bname.clip.depth = this.clip.depth;
this.bname.clip.rot = this.rot + 3;
enemyBulletNum++;
}
break;
case "flying out" :
this.firedelay--;
if (this.firedelay < 1) {
this.firedelay = random(50) + 25;
this.bname = _root.enemyBulletHolder.attachMovie("enemyBullet", "b" + enemyBulletNum, enemyBulletNum);
this.bname.clip.depth = this.clip.depth;
this.bname.clip.rot = this.rot - 3;
enemyBulletNum++;
this.bname = _root.enemyBulletHolder.attachMovie("enemyBullet", "b" + enemyBulletNum, enemyBulletNum);
this.bname.clip.depth = this.clip.depth;
this.bname.clip.rot = this.rot + 3;
enemyBulletNum++;
}
this.clip.depth = this.clip.depth * 1.025;
if (this.clip.depth > 400) {
this.offset = random(360);
this.clip.depth = 0.5;
this.enemyState = "fly into formation";
}
if (this.clip.hitTest(player.hitClip)) {
explodeSound1.start();
_root.playerHit("enemy");
this.enemyState = "explode";
}
break;
default :
this.enemyState = "setup";
}
if ((this.enemyState != "explode") && (this.enemyState != "explode wait")) {
this.shot = _root.testShot(this.clip);
if (this.shot != false) {
this.strength--;
if (this.strength < 1) {
this.enemyState = "explode";
explodeSound2.start();
_root.score = _root.score + this.pointsawarded;
}
}
}
this.sinMove = (Math.sin(this.startRot + this.angle) * this.range) + (Math.sin(this.angle) * this.range);
this.baserot = this.sinMove;
this.cliptogo = 8 - Math.floor(this.sinMove / 4);
this.gotoAndStop(this.cliptogo);
this.angle = this.angle + this.ySpeed;
this._x = _root.calcX(this.rot, this.clip.depth);
this._y = _root.calcY(this.rot, this.clip.depth);
this._xscale = (this._yscale = _root.calcScale(this.clip.depth));
this.rot = this.baserot + this.offset;
this._rotation = 360 - this.rot;
}
};
Object.registerClass("enemy4", enemy4Class);
function enemy3Class() {
}
enemy3Class.prototype = new MovieClip();
enemy3Class.prototype.onLoad = function () {
trace("SHIP3");
this.startRot = random(360);
this.startRot = _root.prot;
this.scope = 100 - (_root.level * 10);
this.startRot = (_root.prot + (Math.random() * this.scope)) - (this.scope / 2);
this.baserot = this.startRot;
this.offset = random(360);
this.firing = 1;
this.firedelay = 45;
this.strength = 3;
this.pointsawarded = 300;
this.formationWait = 260 + random(20);
this.formationCount = 0;
this.clip.depth = 0.5;
this.rot = this.baserot;
this.clip._visible = false;
this.angle = random(360);
this.range = 30;
this.ySpeed = 0.025;
this.centerScale = this.startRot;
};
enemy3Class.prototype.onEnterFrame = function () {
if (_root.gameState == "playing") {
switch (this.enemyState) {
case "setup" :
this.enemyState = "fly into formation";
break;
case "explode" :
explodeSnd2.start();
_root.addExplosion(this.rot, this.clip.depth);
removeMovieClip(this);
_root.lvlAliensKilled++;
break;
case "fly into formation" :
this.clip.depth = this.clip.depth * 1.03;
if (this.clip.depth > this.clip.formationDepth) {
this.enemyState = "waiting in formation";
this.formationCount = 0;
}
break;
case "waiting in formation" :
this.formationCount++;
if (this.formationCount > this.formationWait) {
this.formationCount = 0;
this.enemyState = "flying out";
}
this.firedelay--;
if (this.firedelay < 1) {
this.firedelay = random(50) + 15;
this.bname = _root.enemyBulletHolder.attachMovie("enemyBullet", "b" + enemyBulletNum, enemyBulletNum);
this.bname.clip.depth = this.clip.depth;
this.bname.clip.rot = this.rot - 3;
enemyBulletNum++;
}
break;
case "flying out" :
this.firedelay--;
if (this.firedelay < 1) {
this.firedelay = random(50) + 25;
this.bname = _root.enemyBulletHolder.attachMovie("enemyBullet", "b" + enemyBulletNum, enemyBulletNum);
this.bname.clip.depth = this.clip.depth;
this.bname.clip.rot = this.rot;
enemyBulletNum++;
}
this.clip.depth = this.clip.depth * 1.025;
if (this.clip.depth > 400) {
this.offset = random(360);
this.clip.depth = 0.5;
this.enemyState = "fly into formation";
}
if (this.clip.hitTest(player.hitClip)) {
explodeSound1.start();
_root.playerHit("enemy");
this.enemyState = "explode";
}
break;
default :
this.enemyState = "setup";
}
if ((this.enemyState != "explode") && (this.enemyState != "explode wait")) {
this.shot = _root.testShot(this.clip);
if (this.shot != false) {
this.strength--;
if (this.strength < 1) {
this.enemyState = "explode";
explodeSound2.start();
_root.score = _root.score + this.pointsawarded;
}
}
}
this.sinMove = (Math.sin(this.startRot + this.angle) * this.range) + (Math.sin(this.angle) * this.range);
this.baserot = this.sinMove;
this.cliptogo = 8 - Math.floor(this.sinMove / 4);
this.gotoAndStop(this.cliptogo);
this.angle = this.angle + this.ySpeed;
this._x = _root.calcX(this.rot, this.clip.depth);
this._y = _root.calcY(this.rot, this.clip.depth);
this._xscale = (this._yscale = _root.calcScale(this.clip.depth));
this.rot = this.baserot + this.offset;
this._rotation = 360 - this.rot;
}
};
Object.registerClass("enemy3", enemy3Class);
function enemy2Class() {
}
enemy2Class.prototype = new MovieClip();
enemy2Class.prototype.onLoad = function () {
this.startRot = random(360);
this.scope = 100 - (_root.level * 10);
this.startRot = (_root.prot + (Math.random() * this.scope)) - (this.scope / 2);
this.baserot = this.startRot;
this.offset = random(360);
this.firing = 1;
this.firedelay = 45;
this.strength = 1;
this.pointsawarded = 300;
this.formationWait = 260 + random(20);
this.formationCount = 0;
this.clip.depth = 0.5;
this.rot = 0;
this.clip._visible = false;
this.angle = 0;
this.range = 30;
this.ySpeed = 0.025;
this.centerScale = this.startRot;
};
enemy2Class.prototype.onEnterFrame = function () {
if (_root.gameState == "playing") {
switch (this.enemyState) {
case "setup" :
this.enemyState = "fly into formation";
break;
case "explode" :
explodeSnd2.start();
_root.addExplosion(this.rot, this.clip.depth);
removeMovieClip(this);
_root.lvlAliensKilled++;
break;
case "fly into formation" :
this.clip.depth = this.clip.depth * 1.03;
if (this.clip.depth > this.clip.formationDepth) {
this.enemyState = "waiting in formation";
this.formationCount = 0;
}
break;
case "waiting in formation" :
this.formationCount++;
if (this.formationCount > this.formationWait) {
this.formationCount = 0;
this.enemyState = "flying out";
}
this.firedelay--;
if (this.firedelay < 1) {
this.firedelay = random(50) + 15;
this.bname = _root.enemyBulletHolder.attachMovie("enemyBullet", "b" + enemyBulletNum, enemyBulletNum);
this.bname.clip.depth = this.clip.depth;
this.bname.clip.rot = this.rot - 3;
enemyBulletNum++;
this.bname = _root.enemyBulletHolder.attachMovie("enemyBullet", "b" + enemyBulletNum, enemyBulletNum);
this.bname.clip.depth = this.clip.depth;
this.bname.clip.rot = this.rot + 3;
enemyBulletNum++;
}
break;
case "flying out" :
this.firedelay--;
if (this.firedelay < 1) {
this.firedelay = random(50) + 25;
this.bname = _root.enemyBulletHolder.attachMovie("enemyBullet", "b" + enemyBulletNum, enemyBulletNum);
this.bname.clip.depth = this.clip.depth;
this.bname.clip.rot = this.rot - 3;
enemyBulletNum++;
this.bname = _root.enemyBulletHolder.attachMovie("enemyBullet", "b" + enemyBulletNum, enemyBulletNum);
this.bname.clip.depth = this.clip.depth;
this.bname.clip.rot = this.rot + 3;
enemyBulletNum++;
}
this.clip.depth = this.clip.depth * 1.025;
if (this.clip.depth > 400) {
this.offset = random(360);
this.clip.depth = 0.5;
this.enemyState = "fly into formation";
}
if (this.clip.hitTest(player.hitClip)) {
explodeSound1.start();
_root.playerHit("enemy");
this.enemyState = "explode";
}
break;
default :
this.enemyState = "setup";
}
if ((this.enemyState != "explode") && (this.enemyState != "explode wait")) {
this.shot = _root.testShot(this.clip);
if (this.shot != false) {
this.strength--;
if (this.strength < 1) {
this.enemyState = "explode";
explodeSound2.start();
_root.score = _root.score + this.pointsawarded;
}
}
}
this.sinMove = Math.sin(this.startRot + this.angle) * this.range;
this.baserot = this.sinMove;
this.cliptogo = 8 - Math.floor(this.sinMove / 4);
this.gotoAndStop(this.cliptogo);
this.angle = this.angle + this.ySpeed;
this._x = _root.calcX(this.rot, this.clip.depth);
this._y = _root.calcY(this.rot, this.clip.depth);
this._xscale = (this._yscale = _root.calcScale(this.clip.depth));
this.rot = this.baserot + this.offset;
this._rotation = 360 - this.rot;
}
};
Object.registerClass("enemy2", enemy2Class);
function explosionClass() {
}
explosionClass.prototype = new MovieClip();
explosionClass.prototype.onLoad = function () {
this.clip._visible = false;
this.c = 15;
};
explosionClass.prototype.onEnterFrame = function () {
if (_root.gameState != "paused") {
this.clip.depth = this.clip.depth * zoomSpeed;
}
this._x = _root.calcX(this.clip.rot, this.clip.depth);
this._y = _root.calcY(this.clip.rot, this.clip.depth);
this.scale = _root.calcScale(this.clip.depth);
this._xscale = (this._yscale = this.scale);
this.c--;
if (this.c < 1) {
removeMovieClip(this);
}
};
Object.registerClass("explosion", explosionClass);
function mineClass() {
}
mineClass.prototype = new MovieClip();
mineClass.prototype.onLoad = function () {
this.rot = random(360);
this.strength = 1;
this.state = "normal";
this.pointsawarded = 100;
this.clip._visible = false;
this._rotation = random(360);
};
mineClass.prototype.onEnterFrame = function () {
if (_root.gameState != "paused") {
if (this.state == "explode") {
explodeSnd4.start();
_root.addExplosion(this.rot, this.clip.depth);
removeMovieClip(this);
}
if (this.state == "normal") {
this.clip.depth = this.clip.depth * zoomSpeed;
if (_root.gameState == "level finished wait") {
if (this.clip.depth < 15) {
removeMovieClip(this);
}
this.clip.depth = this.clip.depth * exitZoomSpeed;
}
if (this.clip.depth > 400) {
removeMovieClip(this);
}
this.shot = _root.testShot(this.clip);
if (this.shot != false) {
this.strength--;
if (this.strength < 1) {
this.state = "explode";
_root.score = _root.score + this.pointsawarded;
}
}
this.hitplayer = _root.testHitPlayer(this.clip);
if ((this.hitplayer != false) && (this.hitplayer != undefined)) {
if (_root.gameState != "level finished wait") {
_root.playerHit("mine");
this.state = "explode";
}
}
}
this._x = _root.calcX(this.rot, this.clip.depth);
this._y = _root.calcY(this.rot, this.clip.depth);
this._xscale = (this._yscale = _root.calcScale(this.clip.depth));
}
};
Object.registerClass("mine", mineClass);
function playerbulletClass() {
}
playerbulletClass.prototype = new MovieClip();
playerbulletClass.prototype.onLoad = function () {
this.rot = _root.prot;
this.depth = _root.pdepth;
this.state = "normal";
};
playerbulletClass.prototype.onEnterFrame = function () {
if (this.state == "normal") {
if (_root.gameState != "paused") {
this.depth = this.depth * 0.9;
if (this.depth < 25) {
removeMovieClip(this);
}
if (this.depth < 50) {
this._alpha = this._alpha - 2;
}
this.temprot = (this.rot / 180) * Math.PI;
this.x = _root.calcX(this.rot, this.depth);
this.y = _root.calcY(this.rot, this.depth);
this.scale = _root.calcScale(this.depth);
this._x = this.x;
this._y = this.y;
this._xscale = this.scale;
this._yscale = this.scale;
}
}
};
Object.registerClass("bullet", playerbulletClass);
level1Enemies = new Array(1, 1, 1, 1, 1, 2);
level2Enemies = new Array(1, 2, 1, 2, 1, 2, 1, 2, 1, 2);
level3Enemies = new Array(2, 1, 3, 1, 3, 2, 2, 1, 3, 1, 3, 2);
level4Enemies = new Array(2, 3, 4, 2, 3, 1, 4, 2, 3, 4, 2, 1, 3, 4, 2, 3, 4);
level5Enemies = new Array(1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4);
function bonusClass() {
}
bonusClass.prototype = new MovieClip();
bonusClass.prototype.onLoad = function () {
this.rot = random(360);
this.state = "normal";
this.clip._visible = false;
};
bonusClass.prototype.onEnterFrame = function () {
if (_root.gameState != "paused") {
if (_root.gameState == "level finished wait") {
this.clip.depth = this.clip.depth * _root.exitZoomSpeed;
}
if (this.state == "remove") {
trace("remove");
trace(this.clip.depth);
this.clip.depth = this.clip.depth * _root.zoomSpeed;
if (this.clip.depth > 400) {
removeMovieClip(this);
}
}
if (this.state == "normal") {
this.clip.depth = this.clip.depth * _root.zoomSpeed;
if (_root.gameState == "level finished wait") {
if (this.clip.depth < 15) {
removeMovieClip(this);
}
this.clip.depth = this.clip.depth * _root.exitZoomSpeed;
}
if (this.clip.depth > 400) {
removeMovieClip(this);
}
this.hitplayer = _root.testHitPlayer(this.clip);
if (this.hitplayer != false) {
if (_root.gameState != "level finished wait") {
_root.playerHit("bonus" + this.clip.bonusType);
this.state = "collected wait";
this.rot = _root.prot;
this.gotoAndStop(this.clip.bonusType + 3);
this.cw = 60;
this.clip.depth = _root.pdepth - 25;
}
}
}
if (this.state == "collected wait") {
trace("waiting");
this.cw--;
if (this.cw < 1) {
this.state = "remove";
trace(this.clip.depth);
}
}
this._x = _root.calcX(this.rot, this.clip.depth);
this._y = _root.calcY(this.rot, this.clip.depth);
this.scale = _root.calcScale(this.clip.depth);
this._xscale = (this._yscale = this.scale);
}
};
Object.registerClass("bonus", bonusClass);
function displayplayer() {
if (Math.abs(movePlayer) > 0) {
prot = prot + (movePlayer * 0.1);
movePlayer = movePlayer * 0.9;
playerdisplayrot = 8 + Math.floor(movePlayer / 3);
player.gotoAndStop(playerdisplayrot);
if (Math.abs(movePlayer) < 0.5) {
movePlayer = 0;
player.gotoAndStop(8);
}
}
if (prot < 0) {
prot = 359 - prot;
}
if (prot > 361) {
prot = prot - 360;
}
px = _root.calcX(prot, pdepth);
py = _root.calcY(prot, pdepth);
player._x = px;
player._y = py;
player._xscale = (player._yscale = calcScale(pdepth));
player._rotation = 360 - prot;
if (displayThrust == 1) {
tc++;
if (tc > td) {
tc = 0;
attachMovie("thrust", "th" + thrstn, thrstn);
eval ("th" + thrstn)._x = player._x;
eval ("th" + thrstn)._y = player._y;
eval ("th" + thrstn)._rotation = player._rotation;
thrstn++;
if (thrstn > 198) {
thrstn = 101;
}
}
}
}
function enemybulletClass() {
}
enemybulletClass.prototype = new MovieClip();
enemybulletClass.prototype.onLoad = function () {
this.state = "normal";
};
enemybulletClass.prototype.onEnterFrame = function () {
if (this.state == "normal") {
if (_root.gameState == "level finished wait") {
this.clip.depth = this.clip.depth * exitZoomSpeed;
}
if (_root.gameState != "paused") {
this.clip.depth = this.clip.depth * 1.04;
if (this.depth > 400) {
removeMovieClip(this);
}
this.temprot = (this.clip.rot / 180) * Math.PI;
this.x = _root.calcX(this.clip.rot, this.clip.depth);
this.y = _root.calcY(this.clip.rot, this.clip.depth);
this.scale = _root.calcScale(this.clip.depth);
this._x = this.x;
this._y = this.y;
this._xscale = (this._yscale = this.scale);
this.hitplayer = _root.testHitPlayer(this.clip);
if ((this.hitplayer != false) && (this.hitplayer != undefined)) {
_root.playerHit("ebullet");
removeMovieClip(this);
}
}
}
};
Object.registerClass("enemyBullet", enemybulletClass);
function frameaction() {
switch (gameState) {
case "game complete" :
trace("GAME COMPLETE");
attachMovie("game_complete", "tellPlayer", 9);
tellPlayer._x = 320;
tellPlayer._y = 240;
gameState = "game complete wait";
gameCWait = 90;
break;
case "game complete wait" :
testKeys();
pdepth = pdepth - 3;
if (pdepth < 10) {
removeMovieClip(player);
}
gameCWait--;
if (gameCWait < 1) {
gameState = "game complete end";
}
break;
case "game complete end" :
gameState = "null";
removeMovieClip(player);
gotoAndPlay (37);
break;
case "level finished" :
attachMovie("level_complete", "tellPlayer", 9);
tellPlayer._x = 320;
tellPlayer._y = 240;
gameState = "level finished wait";
lvlCompleteWait = 90;
break;
case "level finished wait" :
testKeys();
lvlCompleteWait--;
if (lvlCompleteWait < 1) {
level++;
if (level > 5) {
gameState = "game complete";
} else {
gameState = "begin";
}
}
break;
case "start gameover" :
playerExplodesSnd.start();
gameState = "game over wait";
gw = 30;
break;
case "game over wait" :
gw--;
if (gw < 1) {
removeMovieClip(player);
gameState = "null";
gotoAndPlay (28);
}
break;
case "start again" :
level = 1;
attachMovie("ready_announce", "tellPlayer", 9);
tellPlayer._x = 320;
tellPlayer._y = 240;
_global.playerState = 1;
attachMovie("player", "player", 199);
player.gotoAndStop(8);
playerState = 1;
gameState = "paused";
break;
case "paused" :
break;
case "begin" :
setuplevel();
gameState = "begin wait";
tNum = 76;
break;
case "begin wait" :
generatestars();
tNum--;
if (tNum < 1) {
gameState = "playing";
removeMovieClip(tellPlayer);
}
break;
case "playing" :
testKeys();
generatestars();
displayplayer();
testifLevelisOver();
}
displayplayer();
}
function generatestars() {
levelTime = Math.floor((getTimer() - levelStart) / 1000);
if (levelTime < 50) {
bonusCount++;
if (bonusCount > bonusDelay) {
t = random(10);
if (t < 5) {
typeOfB = 1;
}
if ((t > 4) && (t < 8)) {
typeOfB = 2;
}
if (t > 7) {
typeOfB = 3;
}
stars.attachMovie("bonus", "b" + n, n);
with (eval ("stars.b" + n)) {
_x = -15;
clip.depth = 2;
clip.bonusType = typeOfB;
gotoAndStop(typeOfB);
}
n++;
if (n > 1000) {
n = 0;
}
bonusCount = 0;
}
}
if (starAmount < maxStars) {
if (displayStars == 1) {
sc++;
if (sc > sd) {
starAmount++;
sc = 0;
stars.attachMovie("star", "s" + n, n);
with (eval ("stars.s" + n)) {
_x = -5;
}
n++;
if (n > 1000) {
n = 0;
}
}
}
}
ac++;
if (ac > ad) {
ac = 0;
stars.attachMovie("asteroid", "a" + n, n);
with (eval ("stars.a" + n)) {
_x = -15;
clip.depth = 2;
}
n++;
if (n > 1000) {
n = 0;
}
}
mc++;
if (mc > md) {
mc = 0;
stars.attachMovie("mine", "m" + n, n);
with (eval ("stars.m" + n)) {
_x = -15;
clip.depth = 2;
}
n++;
}
if (genAliens < maxAliens) {
ec++;
if (ec > ed) {
genAliens++;
ec = 0;
enemyName = "enemy" + eval (("level" + level) + "Enemies")[genAliens - 1];
trace(enemyName);
enemyHolder.attachMovie(enemyName, "e" + en, en);
with (eval ("enemyHolder.e" + en)) {
_x = -15;
clip.depth = 4;
clip.formationDepth = 70;
clip.enemyType = 1;
}
en++;
if (en > 1000) {
en = 0;
}
}
}
}
function pausebtnpress() {
if (_root.state == "playing") {
_root.state = "paused";
attachMovie("paused_clip", "tellPlayer", 9);
tellPlayer._x = 320;
tellPlayer._y = 240;
} else if (_root.state == "paused") {
removeMovieClip("tellPlayer");
_root.state = "playing";
}
}
function playerShoot() {
if (soundOn == 1) {
eval ("fire_snd" + (random(2) + 1)).start();
}
this.bulletHolder.attachMovie("bullet", "b" + bulletNum, bulletNum);
eval ("this.bulletHolder.b" + bulletNum)._x = -10;
bulletNum++;
}
function playerHit(hitBy) {
if (hitBy == "mine") {
trace("player has been hit by a mine");
playerEnergy = playerEnergy - 20;
}
if (hitBy == "enemy") {
trace("player has been hit by an enemy");
playerEnergy = playerEnergy - 10;
}
if (hitBy == "asteroid") {
trace("player has been hit by a asteroid");
playerEnergy = playerEnergy - 15;
}
if (hitBy == "ebullet") {
trace("player has been hit by an enemy bullet");
playerEnergy = playerEnergy - 5;
}
if (hitBy == "bonus1") {
collectSnd.start();
trace("player has been hit by bonus 1");
score = score + 1000;
}
if (hitBy == "bonus2") {
collectSnd.start();
trace("player has been hit by bonus 2");
score = score + 500;
playerEnergy = playerEnergy + 20;
if (playerEnergy > 100) {
playerEnergy = 100;
}
}
if (hitBy == "bonus3") {
ffCount = 240;
fastFire = true;
collectSnd.start();
trace("player has been hit by bonus 3");
score = score + 1000;
trace("faster firepower");
}
if (playerEnergy < 1) {
playerExplodesSnd.start();
playerEnergy = 0;
gameState = "start gameover";
}
this.shieldBar.clip._y = 388 - ((playerEnergy / 100) * 388);
this.shieldBar.clip.gotoAndPlay(2);
hurtSnd.start();
}
function setup() {
exitZoomSpeed = 1.1;
zoomSpeed = 1.03;
maxStars = 30;
starAmount = 0;
playerEnergy = 100;
n = 10;
pdepth = 200;
prot = 0;
sc = 0;
sd = 2;
tc = 0;
td = 1;
thrstn = 101;
leftKey = 37;
rightKey = 39;
fireKey = 32;
movePlayer = 0;
bulletNum = 1;
lastFired = getTimer();
fireDelay = 350;
displayThrust = 0;
displayStars = 1;
soundOn = 1;
_quality = _root.gameQuality;
var _local2 = new Object();
_local2.onMouseDown = function () {
if ((playerState == 1) && (gameState == "playing")) {
trace("mouse clicked");
}
};
Mouse.addListener(_local2);
extralives = 0;
_root.lives = 2;
_root.score = 0;
gameScene = "GAME";
playmusic();
}
if (musicstate == 0) {
this.on_off.gotoAndStop(2);
}
function testKeys() {
if (Key.isDown(leftKey)) {
movePlayer = movePlayer - 7;
}
if (Key.isDown(rightKey)) {
movePlayer = movePlayer + 7;
}
if (movePlayer > 30) {
movePlayer = 30;
}
if (movePlayer < -30) {
movePlayer = -30;
}
if (fastFire) {
fireDelay = 175;
ffCount--;
if (ffCount < 1) {
fastFire = false;
}
} else {
fireDelay = 350;
}
if (gameState == "playing") {
if (Key.isDown(fireKey)) {
nowFire = getTimer();
if ((nowFire - lastFired) > fireDelay) {
playerShoot();
lastFired = getTimer();
}
}
}
}
function testifLevelisOver() {
if (lvlAliensKilled >= maxAliens) {
gameState = "level finished";
}
}
function testHitPlayer(tName) {
tisShot = false;
if (eval (tName).hitTest(player.hitClip)) {
trace("PLAYER HAS BEEN HIT!!");
return(i);
}
return(false);
}
function testShot(tName) {
tisShot = false;
i = bulletNum;
while (i > (bulletNum - 9)) {
if (eval (tName).hitTest(eval ("bulletHolder.b" + i))) {
removeMovieClip(eval ("bulletHolder.b" + i));
return(i);
}
i--;
}
return(false);
}
function setuplevel() {
fastFire = false;
enemyBulletNum = 1;
lvlAliensKilled = 0;
maxAliens = eval (("level" + level) + "Enemies").length;
trace("maxAliens = " + maxAliens);
bonusCount = 0;
mc = 0;
ac = 0;
ec = 0;
en = 1;
switch (level) {
case 1 :
bonusDelay = 120;
md = 60;
ad = 60;
ed = 100;
break;
case 2 :
bonusDelay = 170;
md = 50;
ad = 50;
ed = 80;
break;
case 3 :
bonusDelay = 150;
md = 40;
ad = 40;
ed = 70;
break;
case 4 :
bonusDelay = 190;
md = 35;
ad = 35;
ed = 60;
break;
case 5 :
bonusDelay = 190;
md = 30;
ad = 30;
ed = 50;
break;
default :
bonusDelay = 190;
md = 30;
ad = 30;
ed = 50;
}
genAliens = 0;
_root.levelann = "Level " + level;
trace("LEVEL START" + level);
attachMovie("level_announce", "tellPlayer", 9);
tellPlayer._x = 320;
tellPlayer._y = 240;
background.gotoAndStop(level);
attachMovie("player", "player", 199);
player.gotoAndStop(8);
displayplayer();
playerState = 1;
playmusic();
levelStart = getTimer();
}
Instance of Symbol 393 MovieClip in Frame 18
onClipEvent (enterFrame) {
_root.frameaction();
}
Frame 27
setup();
gameState = "begin";
stop();
Instance of Symbol 332 MovieClip "starGen" in Frame 28
onClipEvent (enterFrame) {
_parent.makeStars();
}
Frame 28
if (false) {
}
Frame 29
gameOverSnd.start();
storage.flush();
gamescene = "game over";
playmusic();
sA = 0;
sM = 40;
sC = 0;
sD = 2;
if (score > yourhigh) {
yourhigh = score;
storage.data.myhighscore = score;
}
this.playBtn.onRelease = function () {
removeMovieClip(highHolder);
gotoAndPlay (18);
_root.gameState = "start again";
};
if (score > 1000) {
t = this.createEmptyMovieClip("highHolder", 1000);
loadMovie ("http://www.terrypaton.com/highscores/highscoreSubmit.swf", highHolder);
t._x = 81;
t._y = 292;
}
if (yourhigh != undefined) {
yourHighestText = "YOUR HIGHEST SCORE: " + yourhigh;
} else {
yourHighestText = " ";
}
storage.flush();
Frame 36
stop();
Frame 37
storage.data.uptolevel = 1;
level = 1;
gameOverSnd.start();
storage.flush();
gameScene = "GAME FINISHED";
playmusic();
sA = 0;
sM = 40;
sC = 0;
sD = 2;
if (score > yourhigh) {
yourhigh = score;
storage.data.myhighscore = score;
}
this.playBtn.onRelease = function () {
removeMovieClip(highHolder);
gotoAndPlay (18);
_root.gameState = "start again";
};
this.playBtn.onRollOver = function () {
};
if (score > 1000) {
t = this.createEmptyMovieClip("highHolder", 1000);
loadMovie ("http://www.terrypaton.com/highscores/highscoreSubmit.swf", highHolder);
t._x = 81;
t._y = 292;
}
if (yourhigh != undefined) {
yourHighestText = "YOUR HIGHEST SCORE: " + yourhigh;
} else {
yourHighestText = " ";
}
storage.flush();
Instance of Symbol 332 MovieClip "starGen" in Frame 37
onClipEvent (enterFrame) {
_parent.makeStars();
}
Frame 45
stop();
Symbol 3 MovieClip [letter] Frame 1
#initclip 8
Object.registerClass("letter", letterClass);
#endinitclip
Symbol 414 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 415 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 416 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 417 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 418 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 419 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 420 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 46 MovieClip [enemy3] Frame 1
stop();
Symbol 77 MovieClip [enemy4] Frame 1
stop();
Symbol 108 MovieClip [enemy2] Frame 1
stop();
Symbol 156 MovieClip [explosion] Frame 16
stop();
Symbol 166 MovieClip Frame 1
stop();
Symbol 167 MovieClip [tell_player] Frame 65
removeMovieClip(this);
Symbol 172 MovieClip [ready_announce] Frame 76
_root.state = "playing";
removeMovieClip(this);
Symbol 211 Button
on (release) {
_root.pausebtnpress();
}
Symbol 212 MovieClip [paused_clip] Frame 30
stop();
Symbol 215 MovieClip [lifelost] Frame 80
_root.state = "start again";
removeMovieClip(this);
Symbol 218 MovieClip [level_announce] Frame 77
stop();
Symbol 222 MovieClip [game_complete] Frame 76
_root.state = "playing";
removeMovieClip(this);
Symbol 228 MovieClip [thrust] Frame 13
removeMovieClip(this);
Symbol 263 MovieClip [enemy1] Frame 1
stop();
Symbol 296 MovieClip [asteroid] Frame 16
this.gotoAndPlay(1);
Symbol 299 MovieClip [mine] Frame 1
stop();
Symbol 303 MovieClip [level_complete] Frame 76
_root.state = "playing";
removeMovieClip(this);
Symbol 319 MovieClip Frame 1
stop();
Symbol 323 MovieClip Frame 1
_root.stop();
new mx.transitions.Tween(this.head, "_rotation", mx.transitions.easing.Bounce.easeOut, 0, 180, 0.7, true);
new mx.transitions.Tween(this.head, "_y", mx.transitions.easing.Bounce.easeOut, this.head._y - 200, this.head._y, 1, true);
new mx.transitions.Tween(this.head, "_x", mx.transitions.easing.Strong.easeOut, (Math.random() * 640) - 320, 0, 1, true);
Symbol 323 MovieClip Frame 92
_root.play();
Symbol 338 MovieClip Frame 23
stop();
Symbol 340 Button
on (press) {
_root.musicoff();
this.over.play();
}
Symbol 343 Button
on (press) {
_root.musicon();
this.over.play();
}
Symbol 344 MovieClip Frame 1
stop();
Symbol 361 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 364 MovieClip Frame 1
stop();
Symbol 369 Button
on (release) {
_root.resetlevel();
}
Symbol 379 MovieClip Frame 1
stop();
Symbol 403 MovieClip Frame 1
stop();