Frame 1
function gameMenu(menu, obj) {
getURL (_root.authorsSite, "_blank");
}
_root.gameTitle = "jetpac";
_root.gameName = "jetpac2";
_root.gameDesc = "Outer Space Action!";
_root.vNum = "2.02";
_root.flashVersionsNeeded = 8;
_root.legalDomain = "http://www.terrypaton.com";
_root.legalDomain = "http://www.users.tpg.com.au/";
_root.authorName = "Terry Paton";
_root.authorContact = "terry@terrypaton.com";
_root.authorsSite = "http://www.terrypaton.com";
_root.gameLocation = _root._url.substr(0, legalDomain.length);
_root.gameQuality = "AUTO";
var menu_cm = new ContextMenu();
menu_cm.customItems.push(new ContextMenuItem("--> www.terrypaton.com", gameMenu));
menu_cm.hideBuiltInItems();
_root.menu = menu_cm;
fscommand ("fullscreen", true);
this.createEmptyMovieClip("ob", 1);
ob.lineStyle(1, 16777215, 100);
ob.lineTo(240, 0);
ob.lineTo(240, 20);
ob.lineTo(0, 20);
ob.lineTo(0, 0);
ob.endFill();
ob._x = 200;
ob._y = 220;
this.createEmptyMovieClip("iB", 2);
iB.beginFill(16777215, 30);
iB.lineTo(233, 0);
iB.lineTo(233, 15);
iB.lineTo(0, 15);
iB.endFill();
iB._x = 204;
iB._y = 223;
var mf = new TextFormat();
mf.bold = true;
mf.font = "Arial";
mf.size = 14;
mf.align = "center";
mf.color = 16777215 /* 0xFFFFFF */;
this.createTextField("lT", 5000, 0, 0, 640, 32);
iB.onLoad = function () {
};
iB.onEnterFrame = function () {
pL = Math.floor((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (pL < 100) {
this._xscale = pL;
_root.stop();
} else {
removeMovieClip(this._parent.ob);
removeMovieClip(this._parent.lT);
removeMovieClip(this);
_root.play();
}
};
Instance of Symbol 9 MovieClip in Frame 2
onClipEvent (load) {
var flashVersion = System.capabilities.version;
if (8 > flashVersion.substr(4, 1)) {
_parent.stop();
this.gotoAndStop(2);
}
_root.gameIsLegal = "no";
legalDomain1 = "http://uploads.ungrounded.net";
legalDomain2 = "http://www.terrypaton.com";
_root.gameLocation1 = _root._url.substr(0, legalDomain1.length);
_root.gameLocation2 = _root._url.substr(0, legalDomain2.length);
if ((_root.gameLocation1 == legalDomain1) || (_root.gameLocation2 == legalDomain2)) {
_root.play();
} else {
loadVariablesNum ("games/legal/licence.txt", 0, "POST");
trace("BAD");
}
}
onClipEvent (enterFrame) {
if (_root.gameIsLegal == "yes") {
trace("dfsdf");
_root.play();
}
}
Frame 2
if (false) {
}
Frame 5
function stopmusic() {
music1.stop();
music2.stop();
music3.stop();
optionsmusic.stop();
intromusic.stop();
gameovermusic.stop();
gamefinishedmusic.stop();
}
function playmusic() {
if (musicstate == 1) {
stopmusic();
trace("playing music");
trace(gameScene);
switch (gameScene) {
case "INTRO" :
trace("BLASH");
intromusic.start(0, 90);
return;
case "GAME" :
b = level - (int(level / 3) * 3);
switch (b) {
case 0 :
music1.start(0, 30);
break;
case 1 :
music2.start(0, 30);
break;
case 2 :
music3.start(0, 30);
break;
default :
music1.start(0, 30);
}
return;
case "GAME OVER" :
gameovermusic.start(0, 9);
return;
case "OPTIONS" :
optionsmusic.start(0, 90);
return;
case "HOW TO PLAY" :
optionsmusic.start(0, 90);
return;
case "GAME FINISHED" :
gamefinishedmusic.start(0, 90);
return;
}
}
}
storage = SharedObject.getLocal("store");
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;
}
intromusic = new Sound();
intromusic.attachSound("intromusicSnd");
Frame 6
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;
}
this.playBtn.onPress = function () {
gotoAndPlay (11);
};
gameScene = "INTRO";
playmusic();
if (musicstate == 0) {
this.options.on_off.gotoAndStop(2);
}
gameState = "setup";
Frame 10
stop();
Frame 11
function bonusClass() {
}
bonusClass.prototype = new MovieClip();
bonusClass.prototype.onLoad = function () {
this.bonusType = random(5) + 1;
this.gotoAndStop(this.bonusType);
this.bState = "fall";
this.speed = 1;
this.y = this._y;
this.x = this._x;
};
bonusClass.prototype.onEnterFrame = function () {
if (this.bState == "fall") {
this.y = this.y + this.speed;
this.speed = this.speed * 1.02;
if (platForms.hitTest(this.x - 10, this.y + 2, true) || (platForms.hitTest(this.x + 10, this.y + 2, true))) {
this.bState = "wait";
if (this.y > 458) {
this.y = 458;
}
this.c = 0;
}
} else {
this.c++;
if (this.c > 60) {
this._alpha = this._alpha - 5;
if (this.c > 80) {
removeMovieClip(this);
}
}
}
if (this.bState != "exit") {
if (this.hitTest(player)) {
if (this.bonusType == 1) {
playerEnergy = playerEnergy + 15;
if (playerEnergy > 100) {
playerEnergy = 100;
}
energyBar.energyBar_Bar._xscale = playerEnergy;
this.energyBar.cap._x = this.energyBar.energyBar_Bar._width - 100;
}
this.bState = "exit";
bonusCollectSnd.start();
score = score + 500;
}
}
if (this.bState == "exit") {
this._xscale = this._xscale * 1.05;
this._yscale = this._yscale * 1.05;
this._alpha = this._alpha - 5;
if (this._xscale > 150) {
removeMovieClip(this);
}
}
this._x = this.x;
this._y = this.y;
};
Object.registerClass("bonus", bonusClass);
function playingState() {
playerEnergy = playerEnergy - 0.02;
energyBar.energyBar_Bar._xscale = playerEnergy;
this.energyBar.cap._x = this.energyBar.energyBar_Bar._width - 100;
if (playerEnergy < 1) {
die.start();
playerEnergy = 0;
gameState = "start gameover";
}
testKeys();
if (playerYSpeed < 10) {
if (playerY < 430) {
playerYSpeed = playerYSpeed + 0.35;
}
}
if (playerXSpeed > playerMaxSpeed) {
playerXSpeed = playerMaxSpeed;
} else if (playerXSpeed < (-playerMaxSpeed)) {
playerXSpeed = -playerMaxSpeed;
}
if (playerYSpeed < -30) {
playerYSpeed = -30;
}
if (playerYSpeed < 0.1) {
playerY = playerY + playerYSpeed;
playerYSpeed = playerYSpeed * 0.8;
player.thrustFlame._xscale = Math.abs(playerYSpeed * 5);
}
hitLeft = false;
hitRight = false;
hitAbove = false;
hitBelow = false;
if (playerYSpeed > -0.01) {
if (platForms.hitTest(playerX, playerY + 30, true)) {
if (playerYSpeed > 0) {
playerYSpeed = 0;
}
hitBelow = true;
}
playerY = playerY + playerYSpeed;
} else if (playerYSpeed < 0) {
hitAbove = false;
if (platForms.hitTest(playerX, playerY - 30, true)) {
playerY = playerY - playerYSpeed;
playerYSpeed = 3;
hitAbove = true;
} else {
playerY = playerY - playerYSpeed;
}
}
if (playerXSpeed < -0.1) {
if (playerXSpeed < 0) {
if ((platForms.hitTest(playerX - 30, playerY, true) || (platForms.hitTest(playerX - 30, playerY + 20, true))) || (platForms.hitTest(playerX - 30, playerY - 20, true))) {
trace("left");
playerXSpeed = 0;
hitLeft = true;
} else {
playerX = playerX + playerXSpeed;
}
}
} else if (playerXSpeed > 0.1) {
if ((platForms.hitTest(playerX + 30, playerY, true) || (platForms.hitTest(playerX + 30, playerY + 20, true))) || (platForms.hitTest(playerX + 30, playerY - 20, true))) {
if (playerXSpeed > 0) {
playerXSpeed = 0;
hitRight = true;
}
} else {
playerX = playerX + playerXSpeed;
}
}
if (playerYSpeed > 10) {
playerYSpeed = 10;
}
playerXSpeed = playerXSpeed * 0.9;
if (playerX < 0) {
playerX = 649;
} else if (playerX > 650) {
playerX = 0;
}
if (playerY < 20) {
playerY = 20;
playerYSpeed = 0;
} else if (playerY > 430) {
playerY = 430;
playerYSpeed = 0;
}
player._x = playerX;
player._y = playerY;
player._rotation = playerXSpeed * 2;
if (enemies.bonus._x == undefined) {
bonusDelay++;
if (bonusDelay > bonusWait) {
bonusWait = 60 + random(290);
bonusDelay = 0;
this.enemies.attachMovie("bonus", "bonus", 999);
this.enemies.bonus._x = random(600) + 20;
this.enemies.bonus._y = -30;
}
}
alGen++;
if (shipStage < 10) {
if (alGen > alGenDelay) {
alGenDelay = random(30) + 30;
alGen = 0;
alAdd = 0;
i = 1;
while (i < 50) {
if (eval ("enemies.e" + i)._y != undefined) {
alAdd++;
}
i++;
}
if (alAdd < levelMaxEnemies) {
texe++;
if (texe > 99) {
texe = 1;
}
enemies.attachMovie(enemyName, "e" + texe, texe);
eval ("enemies.e" + texe)._y = random(200);
eval ("enemies.e" + texe)._x = 630;
}
}
}
if (shipStage > 2) {
if (fuelCount == 0) {
if (shipStage < 10) {
trace("FUEL ADDED");
fuelCount++;
enemies.attachMovie("ship", "fuel", 55);
enemies.fuel.gotoAndStop(30);
enemies.fuel.shipPeice = 30;
enemies.fuel._y = -50;
if (random(2) == 1) {
enemies.fuel._x = random(325) + 20;
} else {
enemies.fuel._x = random(100) + 530;
}
}
}
}
if (hitBelow == false) {
if (lastHit == 1) {
trace("puff of smoke");
attachMovie("jetPuff", "jetPuff", 997);
jetPuff._x = playerX;
jetPuff._y = playerY + 10;
}
lastHit = 0;
player.gotoAndStop(1);
playerMaxSpeed = 10;
}
if (hitBelow == true) {
lastHit = 1;
playerMaxSpeed = 2;
if (playerXSpeed == 0) {
player.gotoAndStop(2);
} else {
player.gotoAndStop(3);
}
}
if (Math.abs(playerXSpeed) < 1) {
playerXSpeed = 0;
}
}
function damagePlayer() {
if (gameState == "playing") {
if (playerState != 6) {
playerEnergy = playerEnergy - 1;
hurtSnd.start();
if (playerEnergy < 1) {
die.start();
playerEnergy = 0;
testGameOver();
}
energyBar.energyBar_Bar._xscale = playerEnergy;
energyBar.energyLoss.gotoAndPlay(2);
this.energyBar.cap._x = this.energyBar.energyBar_Bar._width - 100;
player.gotoAndPlay(2);
}
}
}
function testGameOver() {
lives--;
if (lives < 0) {
lives = 0;
}
gameState = "life lost start";
}
function enemy1Class() {
}
enemy1Class.prototype = new MovieClip();
enemy1Class.prototype.onLoad = function () {
this.maxSpeed = 2 + (Math.random() * 2);
this.agility = 5 + (Math.random() * 2);
this.fov = 300;
this.rov = 200;
this.health = 45;
this.deaths = 0;
this.speed = 3;
this.delay = 0;
this.angle = random(20) + 1;
this.startDelay = 30;
this._alpha = 0;
this.eState = "norm";
this._rotation = -this.angle;
this.y = this._y;
this.x = 680;
};
enemy1Class.prototype.onEnterFrame = function () {
if ((gameState == "playing") || (gameState == "level complete wait")) {
if (this.startDelay > 1) {
this.startDelay--;
this._alpha = this._alpha + 4;
if (this._alpha > 100) {
this._alpha = 100;
}
} else {
if (this.health < 1) {
tex = enemies.getNextHighestDepth();
enemies.attachMovie("enemy_explosion", "ex" + tex, tex);
with (eval ("enemies.ex" + tex)) {
gotoAndStop(1);
_rotation = this._rotation;
_x = this.x;
_y = this.y;
}
removeMovieClip(this);
}
this.xMove = Math.cos((this.angle * Math.PI) / 180);
this.x = this.x - (this.speed * this.xMove);
this.yMove = Math.sin((this.angle * Math.PI) / 180);
this.y = this.y + (this.speed * this.yMove);
if (this.hitTest(player.hitBox)) {
damagePlayer();
}
if (platForms.hitTest(this.x + this.xMove, this.y + this.yMove, true)) {
tex = enemies.getNextHighestDepth();
enemies.attachMovie("enemy_explosion", "ex" + tex, tex);
with (eval ("enemies.ex" + tex)) {
_rotation = this._rotation;
gotoAndStop(1);
_x = this.x;
_y = this.y;
}
removeMovieClip(this);
}
if (this.x < -60) {
this.x = 650;
}
}
}
this._x = this.x;
this._y = this.y;
};
Object.registerClass("level1Enemy", enemy1Class);
function enemy2Class() {
}
enemy2Class.prototype = new MovieClip();
enemy2Class.prototype.onLoad = function () {
this.maxSpeed = 1 + (Math.random() * 2);
this.agility = 2 + (Math.random() * 3);
this.fov = 240;
this.rov = 200;
this.health = 100;
this.deaths = 0;
this.speed = 5;
this.delay = 0;
this.yDir = random(2);
this.startDelay = 30;
this._alpha = 0;
this.clip.gotoAndStop(random(7) + 1);
this.eState = "norm";
this.attachMovie("spawn", "spawn", 2);
this.y = this._y;
this.x = this._x;
this.ySpeed = 4;
this.clip.gotoAndStop(random(10) + 1);
};
enemy2Class.prototype.onEnterFrame = function () {
if ((gameState == "playing") || (gameState == "level complete wait")) {
if (this.startDelay > 1) {
this.startDelay--;
this._alpha = this._alpha + 4;
if (this._alpha > 100) {
this._alpha = 100;
}
} else {
if (this.health < 1) {
tex = enemies.getNextHighestDepth();
enemies.attachMovie("enemy_explosion", "ex" + tex, tex);
with (eval ("enemies.ex" + tex)) {
gotoAndStop(2);
_x = this.x;
_y = this.y;
}
removeMovieClip(this);
}
if (this.yDir == 0) {
this.y = this.y + this.ySpeed;
}
if (this.yDir == 1) {
this.y = this.y - this.ySpeed;
}
this.x = this.x - 2;
if (this.hitTest(player.hitBox)) {
damagePlayer();
}
if (platForms.hitTest(this.x, this.y + 20, true)) {
this.yDir = 1;
this.y = this.y - 5;
} else if (platForms.hitTest(this.x, this.y - 20, true)) {
this.yDir = 0;
this.y = this.y + 5;
}
if (this.x < 0) {
this.x = 650;
}
if (this.y < 10) {
this.yDir = 0;
this.y = 10;
} else if (this.y > 430) {
this.y = 420;
this.yDir = 1;
}
}
}
this._x = this.x;
this._y = this.y;
};
Object.registerClass("level2Enemy", enemy2Class);
function enemy3Class() {
}
enemy3Class.prototype = new MovieClip();
enemy3Class.prototype.onLoad = function () {
this.maxSpeed = 2 + (Math.random() * 2);
this.agility = 5 + (Math.random() * 2);
this.fov = 300;
this.rov = 200;
this.health = 100;
this.deaths = 0;
this.speed = 1;
this.delay = 0;
this.angle = random(360);
this.startDelay = 30;
this._alpha = 0;
this.eState = "norm";
this.attachMovie("spawn", "spawn", 2);
this.y = this._y;
this.x = this._x;
};
enemy3Class.prototype.onEnterFrame = function () {
if ((gameState == "playing") || (gameState == "level complete wait")) {
if (this.startDelay > 1) {
this.startDelay--;
this._alpha = this._alpha + 4;
if (this._alpha > 100) {
this._alpha = 100;
}
} else {
if (this.health < 1) {
tex = enemies.getNextHighestDepth();
enemies.attachMovie("enemy_explosion", "ex" + tex, tex);
this.eState = "die";
with (eval ("enemies.ex" + tex)) {
gotoAndStop(3);
_x = this.x;
_y = this.y;
}
removeMovieClip(this);
}
this.speed = this.speed + (1 - random(2));
if (this.speed > this.maxSpeed) {
this.speed = this.maxSpeed;
} else if (this.speed < 1) {
this.speed = 1;
}
dx = playerX - this.x;
dy = playerY - this.y;
angleToFood = Math.round(((Math.atan2(dy, dx) / Math.PI) * 180) - this.angle);
if (angleToFood < -180) {
angleToFood = angleToFood + 360;
} else if (angleToFood > 180) {
angleToFood = angleToFood - 360;
}
distToFood = Math.round(Math.sqrt((dx * dx) + (dy * dy)));
if (this.delay < 1) {
if ((Math.abs(angleToFood) <= (this.fov / 2)) && (distToFood <= this.rov)) {
this.aby = ((angleToFood > this.agility) ? (this.agility % angleToFood) : (angleToFood / this.agility));
this.angle = this.angle + this.aby;
}
} else {
this.aby = (1 - Math.round(Math.random() * 2)) * this.agility;
this.angle = this.angle + this.aby;
}
if (this.delay == 0) {
this.x = this.x + (this.speed * Math.cos((this.angle * Math.PI) / 180));
this.y = this.y + (this.speed * Math.sin((this.angle * Math.PI) / 180));
} else {
this.x = this.x - (this.speed * Math.cos((this.angle * Math.PI) / 180));
this.y = this.y - (this.speed * Math.sin((this.angle * Math.PI) / 180));
}
if (this.hitTest(player.hitBox)) {
damagePlayer();
}
if (platForms.hitTest(this.x + (this.speed * Math.cos((this.angle * Math.PI) / 180)), this.y + (this.speed * Math.sin((this.angle * Math.PI) / 180)), true)) {
this.delay = 6;
this.angle = -this.angle;
}
if (this.delay > 0) {
this.delay--;
}
if (this.x < 0) {
this.x = 650;
} else if (this.x > 650) {
this.x = 0;
}
if (this.y < 10) {
this.y = 10;
this.delay = 6;
this.angle = -this.angle;
} else if (this.y > 430) {
this.y = 430;
}
}
}
this._x = this.x;
this._y = this.y;
};
Object.registerClass("level3Enemy", enemy3Class);
function enemy4Class() {
}
enemy4Class.prototype = new MovieClip();
enemy4Class.prototype.onLoad = function () {
this.maxSpeed = 1 + (Math.random() * 2);
this.agility = 2 + (Math.random() * 3);
this.fov = 240;
this.rov = 200;
this.health = 150;
this.deaths = 0;
this.speed = 1;
this.delay = 0;
this.angle = random(360);
this.startDelay = 30;
this._alpha = 0;
this.clip.gotoAndStop(random(7) + 1);
this.eState = "norm";
this.attachMovie("spawn", "spawn", 2);
this.y = this._y;
this.x = this._x;
};
enemy4Class.prototype.onEnterFrame = function () {
if ((gameState == "playing") || (gameState == "level complete wait")) {
if (this.startDelay > 1) {
this.startDelay--;
this._alpha = this._alpha + 4;
if (this._alpha > 100) {
this._alpha = 100;
}
} else {
if (this.health < 1) {
tex = enemies.getNextHighestDepth();
enemies.attachMovie("enemy_explosion", "ex" + tex, tex);
with (eval ("enemies.ex" + tex)) {
gotoAndStop(4);
_x = this.x;
_y = this.y;
}
removeMovieClip(this);
}
this.speed = this.speed + (1 - random(2));
if (this.speed > this.maxSpeed) {
this.speed = this.maxSpeed;
} else if (this.speed < 1) {
this.speed = 1;
}
dx = playerX - this.x;
dy = playerY - this.y;
angleToFood = Math.round(((Math.atan2(dy, dx) / Math.PI) * 180) - this.angle);
if (angleToFood < -180) {
angleToFood = angleToFood + 360;
} else if (angleToFood > 180) {
angleToFood = angleToFood - 360;
}
distToFood = Math.round(Math.sqrt((dx * dx) + (dy * dy)));
if (this.delay < 1) {
if ((Math.abs(angleToFood) <= (this.fov / 2)) && (distToFood <= this.rov)) {
this.aby = ((angleToFood > this.agility) ? (this.agility % angleToFood) : (angleToFood / this.agility));
this.angle = this.angle + this.aby;
}
} else {
this.aby = (1 - Math.round(Math.random() * 2)) * this.agility;
this.angle = this.angle + this.aby;
}
if (this.delay < 1) {
this.x = this.x + (this.speed * Math.cos((this.angle * Math.PI) / 180));
this.y = this.y + (this.speed * Math.sin((this.angle * Math.PI) / 180));
} else {
this.x = this.x - (this.speed * Math.cos((this.angle * Math.PI) / 180));
this.y = this.y - (this.speed * Math.sin((this.angle * Math.PI) / 180));
}
if (this.hitTest(player.hitBox)) {
damagePlayer();
}
if (platForms.hitTest(this.x + (this.speed * Math.cos((this.angle * Math.PI) / 180)), this.y + (this.speed * Math.sin((this.angle * Math.PI) / 180)), true)) {
this.delay = 6;
this.angle = -this.angle;
}
if (this.delay > 0) {
this.delay--;
}
if (this.x < 0) {
this.x = 650;
} else if (this.x > 650) {
this.x = 0;
}
if (this.y < 10) {
this.y = 10;
this.delay = 6;
this.angle = -this.angle;
} else if (this.y > 430) {
this.y = 430;
}
}
}
this._x = this.x;
this._y = this.y;
};
Object.registerClass("level4Enemy", enemy4Class);
function enemy5Class() {
}
enemy5Class.prototype = new MovieClip();
enemy5Class.prototype.onLoad = function () {
this.maxSpeed = 2 + (Math.random() * 2);
this.agility = 5 + (Math.random() * 2);
this.fov = 300;
this.rov = 200;
this.health = 45;
this.speed = 3;
this.delay = 0;
this.startDelay = 30;
this._alpha = 0;
this.subState = "move1";
this.eState = "norm";
this.y = this._y;
this.x = 20;
this.eDir = random(2);
this.eFace = random(2);
if (this.eFace == 0) {
this.xSpeed = -3;
this._xscale = -100;
} else {
this.xSpeed = 3;
}
this.flyDelay = random(200);
this.clip.gotoAndStop(random(10) + 1);
};
enemy5Class.prototype.onEnterFrame = function () {
if ((gameState == "playing") || (gameState == "level complete wait")) {
if (this.startDelay > 1) {
this.startDelay--;
this._alpha = this._alpha + 4;
if (this._alpha > 100) {
this._alpha = 100;
}
} else {
if (this.subState == "move1") {
this.flyDelay--;
if (this.flyDelay < 1) {
this.subState = "move2";
}
if (this.eDir == 0) {
this.y = this.y + 2;
if (this.y > 400) {
this.eDir = 1;
}
} else if (this.eDir == 1) {
this.y = this.y - 2;
if (this.y < 10) {
this.eDir = 0;
}
}
}
if (this.subState == "move2") {
this.x = this.x + this.xSpeed;
this.y = this.y + 2;
if (this.x < -60) {
this.x = 650;
} else if (this.x > 650) {
this.x = -10;
}
}
if (this.health < 1) {
tex = enemies.getNextHighestDepth();
enemies.attachMovie("enemy_explosion", "ex" + tex, tex);
with (eval ("enemies.ex" + tex)) {
gotoAndStop(5);
_rotation = this._rotation;
_x = this.x;
_y = this.y;
}
removeMovieClip(this);
}
if (this.hitTest(player.hitBox)) {
damagePlayer();
}
if (platForms.hitTest(this.x, this.y + 10, true)) {
tex = enemies.getNextHighestDepth();
enemies.attachMovie("enemy_explosion", "ex" + tex, tex);
with (eval ("enemies.ex" + tex)) {
_rotation = this._rotation;
gotoAndStop(5);
_x = this.x;
_y = this.y;
}
removeMovieClip(this);
}
}
}
this._x = this.x;
this._y = this.y;
};
Object.registerClass("level5Enemy", enemy5Class);
function explosionClass() {
}
explosionClass.prototype = new MovieClip();
explosionClass.prototype.onLoad = function () {
this.health = 10;
this.n = random(3);
if (this.n == 0) {
explosionSnd1.start();
}
if (this.n == 1) {
explosionSnd2.start();
}
if (this.n == 2) {
explosionSnd3.start();
}
};
explosionClass.prototype.onEnterFrame = function () {
this.health--;
this._alpha = this._alpha - 10;
this._xscale = this._xscale * 1.1;
this._yscale = this._yscale * 1.1;
if (this.health < 1) {
removeMovieClip(this);
}
};
Object.registerClass("enemy_explosion", explosionClass);
function fireLaser() {
if (laserDelay > 0) {
laserDelay--;
} else {
fireLaserSnd.start();
laserBeamsHolder.attachMovie("laserClip", "l" + Lnum, Lnum);
eval ("laserBeamsHolder.l" + Lnum)._y = playerY - 5;
if (playerFacing == "left") {
eval ("laserBeamsHolder.l" + Lnum)._x = (playerX - 25) - playerXSpeed;
eval ("laserBeamsHolder.l" + Lnum).dir = "left";
}
if (playerFacing == "right") {
eval ("laserBeamsHolder.l" + Lnum)._x = (playerX + 25) + playerXSpeed;
eval ("laserBeamsHolder.l" + Lnum).dir = "right";
}
Lnum++;
if (Lnum > 10) {
Lnum = 1;
}
laserDelay = 5;
}
}
laserDelay = 0;
laserBeams = 1;
Lnum = 1;
function frameAction() {
switch (gameState) {
case "playing" :
playingState();
return;
case "start gameover" :
i = 0;
while (i < 50) {
removeMovieClip(eval ("enemies.e" + i));
removeMovieClip(eval ("laserBeamsHolder.l" + i));
i++;
}
removeMovieClip(enemies.bonus);
removeMovieClip(general.ship1);
removeMovieClip(general.ship2);
removeMovieClip(general.ship3);
removeMovieClip(player);
gameState = "game over wait";
gameoverWait = 60;
return;
case "game over wait" :
gameoverWait--;
if (gameoverWait < 1) {
gotoAndPlay (23);
}
return;
case "life lost start" :
lifeLostWait = 60;
gameState = "life lost wait";
i = 0;
while (i < 50) {
removeMovieClip(eval ("enemies.e" + i));
removeMovieClip(eval ("laserBeamsHolder.l" + i));
i++;
}
playerX = 280;
playerY = 380;
playerFallSpeed = 4;
removeMovieClip(enemies.bonus);
player.gotoAndStop(4);
return;
case "life lost wait" :
trace(lifeLostWait);
player._y = player._y + playerFallSpeed;
playerFallSpeed = playerFallSpeed * 1.03;
player._rotation = player._rotation + 5;
lifeLostWait--;
if (lifeLostWait < 1) {
if (lives == 0) {
gotoAndPlay (23);
} else {
gameState = "start again";
}
delete playerFallSpeed;
}
return;
case "start again" :
playerEnergy = 100;
energyBar.energyLoss.gotoAndPlay(2);
this.energyBar.cap._x = this.energyBar.energyBar_Bar._width - 100;
gameState = "playing";
return;
case "ship landing start" :
trace("ship landing");
gameState = "ship landing";
general.ship3.clip.gotoAndStop(12);
landSnd.start();
return;
case "ship landing" :
if (general.ship3._y < general.ship3.shipPosY) {
temp = 100 * ((general.ship3.shipPosY - general.ship3._y) / 100);
if (temp > 200) {
temp = 200;
}
this.platForms._x = random(2);
this.platForms._y = random(2);
this.enemies._x = random(2);
this.enemies._y = random(2);
this.general._x = random(2);
this.general._y = random(2);
general.ship3.clip.thrust._yscale = temp;
if (general.ship3._y > 250) {
if (general.shipDust._y == undefined) {
general.attachMovie("shipLandDust", "shipDust", 1000);
general.shipDust._x = 411;
general.shipDust._y = general.ship3.shipPosY;
}
}
} else {
gameState = "playing";
this.platForms._x = 0;
this.platForms._y = 0;
this.enemies._x = 0;
this.enemies._y = 0;
this.general._x = 0;
this.general._y = 0;
landSnd.stop();
general.ship3.clip.gotoAndStop(3);
general.ship3._y = general.ship3.shipPosY;
}
return;
case "level complete start" :
trace("level is complete");
playerEnergy = 100;
energyBar.energyBar_Bar._xscale = playerEnergy;
this.energyBar.cap._x = this.energyBar.energyBar_Bar._width - 100;
removeMovieClip(player);
shipSpeed = 1;
gameState = "level complete wait";
general.attachMovie("shipLaunchDust", "shipDust", 1000);
general.shipDust._x = 411;
general.shipDust._y = general.ship3.shipPosY;
launchSnd.start();
return;
case "level complete wait" :
this.platForms._x = random(2);
this.platForms._y = random(2);
this.enemies._x = random(2);
this.enemies._y = random(2);
this.general._x = random(2);
this.general._y = random(2);
shipSpeed = shipSpeed * 1.01;
general.ship3.clip.gotoAndStop(11);
general.ship3._y = general.ship3._y - shipSpeed;
general.ship3.clip.thrust._yscale = (30 - shipSpeed) * 3;
if (general.ship3._y < -100) {
this.platForms._x = 0;
this.platForms._y = 0;
this.enemies._x = 0;
this.enemies._y = 0;
this.general._x = 0;
this.general._y = 0;
removeMovieClip(general.ship3);
gameState = "next level";
}
return;
case "next level" :
launchSnd.stop();
removeAllClips();
level++;
if (level > 9) {
gotoAndPlay (17);
} else {
trace("increase level");
setupLevel();
if (((level == 1) || (level == 4)) || (level == 7)) {
gameState = "playing";
} else {
gameState = "ship landing start";
trace("gameState");
}
}
return;
case "setup" :
setup();
setupLevel();
if (level == 1) {
gameState = "playing";
} else {
gameState = "next level";
}
return;
case "" :
return;
}
}
function jetPuffClass() {
}
jetPuffClass.prototype = new MovieClip();
jetPuffClass.prototype.onLoad = function () {
this.c = 10;
};
jetPuffClass.prototype.onEnterFrame = function () {
this.c--;
this._xscale = this._xscale + 5;
if (this.c < 1) {
removeMovieClip(this);
}
this._alpha = this._alpha * 0.9;
};
Object.registerClass("jetPuff", jetPuffClass);
function laserClass() {
}
laserClass.prototype = new MovieClip();
laserClass.prototype.onLoad = function () {
this.life = 30;
this.lx = this._x;
this.ly = this._y;
this.spd = 15;
this.lineLength = 10;
this.lState = "norm";
if (this.dir == "left") {
this._xscale = -100;
}
};
laserClass.prototype.onEnterFrame = function () {
if (this.lState == "norm") {
this.life--;
this._alpha = this._alpha - 2;
if (this.life < 1) {
removeMovieClip(this);
}
if (this.dir == "left") {
this.lx = this.lx - this.spd;
this.createEmptyMovieClip("lsr", 5);
this.lsr.lineStyle(10, 16776960, 100);
this.lsr.lineTo(this.lineLength, 0);
}
if (this.dir == "right") {
this.lx = this.lx + this.spd;
this.createEmptyMovieClip("lsr", 5);
this.lsr.lineStyle(10, 16776960, 100);
this.lsr.lineTo(-this.lineLength, 0);
}
this.spd = this.spd * 1.1;
if ((this.lx > 700) || (this.lx < -100)) {
removeMovieClip(this);
}
this._x = this.lx;
this.lineLength = this.lineLength * 1.2;
if (platForms.hitTest(this.lx, this.ly, true)) {
removeMovieClip(this);
}
c = 0;
while (c < 50) {
if (eval ("this.enemies.e" + c).eState == "norm") {
if (eval ("this.enemies.e" + c).hitTest(this.lx, this.ly, true)) {
trace(c);
eval ("this.enemies.e" + c).health = eval ("this.enemies.e" + c).health - 50;
if (this.dir == "left") {
eval ("this.enemies.e" + c)._x = eval ("this.enemies.e" + c)._x - (5 + random(5));
}
if (this.dir == "right") {
eval ("this.enemies.e" + c)._x = eval ("this.enemies.e" + c)._x + (5 + random(5));
}
if (eval ("this.enemies.e" + c).health > 0) {
tex = enemies.getNextHighestDepth();
enemies.attachMovie("tink", "tink", 1000);
tinkSnd.start();
with (enemies.tink) {
_x = this._x;
_y = this._y;
}
}
score = score + (level * 10);
this.lState = "die";
break;
}
}
c++;
}
}
if (this.lState == "die") {
removeMovieClip(this);
}
};
Object.registerClass("laserClip", laserClass);
function removeAllClips() {
i = 0;
while (i < 250) {
removeMovieClip(eval ("enemies.e" + i));
removeMovieClip(eval ("general.ship" + i));
removeMovieClip(eval ("laserBeamsHolder.l" + i));
i++;
}
removeMovieClip(enemies.fuel);
removeMovieClip(enemies.bonus);
removeMovieClip(player);
}
function setupLevel() {
removeAllClips();
trace("setupLevel()");
playerEnergy = 100;
bonusDelay = 0;
bonusWait = 70;
playerFacing = "left";
upKey = 38;
downKey = 40;
leftKey = 37;
rightKey = 39;
fireKey = 32;
playerX = 280;
playerY = 380;
playerXSpeed = 0;
playerYSpeed = 0;
playerMaxSpeed = 10;
n = 0;
hitAbove = false;
hitBelow = false;
hitLeft = false;
hitRight = false;
player.thrustFlame._xscale = 1;
switch (level) {
case 1 :
shipStage = 1;
shipLevelOffset = 0;
levelEnemyNum = 1;
alGenDelay = 30;
backGround.gotoAndStop(1);
break;
case 2 :
shipStage = 3;
shipLevelOffset = 0;
levelEnemyNum = 2;
alGenDelay = 60;
backGround.gotoAndStop(1);
break;
case 3 :
shipStage = 3;
shipLevelOffset = 0;
levelEnemyNum = 3;
alGenDelay = 60;
backGround.gotoAndStop(1);
break;
case 4 :
shipStage = 1;
shipLevelOffset = 0;
alGenDelay = 30;
levelEnemyNum = 5;
backGround.gotoAndStop(2);
break;
case 5 :
shipStage = 3;
shipLevelOffset = 3;
alGenDelay = 60;
levelEnemyNum = 3;
backGround.gotoAndStop(2);
break;
case 6 :
shipStage = 3;
shipLevelOffset = 3;
alGenDelay = 60;
levelEnemyNum = 4;
backGround.gotoAndStop(2);
break;
case 7 :
shipStage = 1;
shipLevelOffset = 3;
alGenDelay = 60;
levelEnemyNum = 4;
backGround.gotoAndStop(3);
break;
case 8 :
shipStage = 3;
shipLevelOffset = 3;
alGenDelay = 60;
levelEnemyNum = 2;
backGround.gotoAndStop(3);
break;
case 9 :
shipStage = 3;
shipLevelOffset = 3;
alGenDelay = 60;
levelEnemyNum = 5;
backGround.gotoAndStop(3);
break;
default :
shipStage = 3;
shipLevelOffset = 0;
alGenDelay = 60;
levelEnemyNum = 5;
}
alGen = 0;
levelMaxEnemies = 6;
enemyName = ("level" + levelEnemyNum) + "Enemy";
i = 1;
while (i < 5) {
enemies.attachMovie(enemyName, "e" + i, i);
eval ("enemies.e" + i)._y = random(200);
eval ("enemies.e" + i)._x = 640;
i++;
}
general.attachMovie("ship", "ship1", 1);
general.ship1._y = -50;
general.ship1._x = 116;
general.ship1.gotoAndStop(1 + shipLevelOffset);
general.ship1.shipPeice = 1;
general.attachMovie("ship", "ship2", 2);
general.ship2._y = -100;
general.ship2._x = 296;
general.ship2.shipPeice = 2;
general.ship2.gotoAndStop(2 + shipLevelOffset);
general.attachMovie("ship", "ship3", 3);
general.ship3._y = -150;
general.ship3._x = 411;
general.ship3.gotoAndStop(3 + shipLevelOffset);
general.ship3.shipPeice = 3;
if (shipStage > 2) {
removeMovieClip(general.ship1);
removeMovieClip(general.ship2);
general.ship3.clip.gotoAndStop(shipStage);
}
fuelCount = 0;
texe = 7;
attachMovie("player", "player", 97);
player._x = -200;
}
function setup() {
lives = 2;
level = 1;
score = 0;
playerEnergy = 100;
playerCarry = 0;
trailCount = 0;
trailDelay = 3;
}
function shipClass() {
}
shipClass.prototype = new MovieClip();
shipClass.prototype.onLoad = function () {
this.sState = "fall";
if (this.shipPeice == 1) {
this.shipPosY = 330;
}
if (this.shipPeice == 2) {
this.shipPosY = 393;
}
if (this.shipPeice == 3) {
this.shipPosY = 457;
}
if (this.shipPeice == 30) {
this.shipPosY = 450;
}
this.shipXPos = 411;
if (gameState == "ship landing start") {
this.speed = 15;
} else {
this.speed = 1;
}
};
shipClass.prototype.onEnterFrame = function () {
if (this.sState == "fall") {
if (gameState == "ship landing") {
this._y = this._y + this.speed;
this.speed = this.speed * 0.976;
if (platForms.hitTest(this._x - 20, this._y + 2.5, true) || (platForms.hitTest(this._x + 20, this._y + 2.5, true))) {
this.sState = "wait";
}
} else {
this._y = this._y + this.speed;
this.speed = this.speed * 1.02;
if (platForms.hitTest(this._x - 20, this._y + 2.5, true) || (platForms.hitTest(this._x + 20, this._y + 2.5, true))) {
this.sState = "wait";
}
}
}
if (this.hitSpot.hitTest(player)) {
if (this.shipPeice != 3) {
if ((((this.shipPeice == 1) && (shipStage == 2)) || ((this.shipPeice == 2) && (shipStage == 1))) || (this.shipPeice == 30)) {
if (((playerCarry == 0) && (this.sState != "falling2")) && (gameState == "playing")) {
this.sState = "grabbed";
CollectSnd.start();
score = score + 500;
playerCarry = 1;
}
}
}
if (this.shipPeice == 3) {
if ((shipStage > 9) && (gameState != "level complete start")) {
gameState = "level complete start";
this.sState = "launch";
}
}
}
if (this.sState == "grabbed") {
if (gameState == "life lost wait") {
this.sState = "fall";
playerCarry = 0;
}
this._x = player._x;
this._y = player._y + 5;
if ((this._x > (this.shipXPos - 5)) && (this._x < (this.shipXPos + 5))) {
this.sState = "falling2";
this.ySpeed = 1;
playerCarry = 0;
this._x = this.shipXPos;
}
}
if (this.sState == "falling2") {
this._x = shipTargetX;
this._y = this._y + this.ySpeed;
this.ySpeed = this.ySpeed * 1.05;
if (this._y >= this.shipPosY) {
this._y = this.shipPosY;
this.sState = "inPlace";
shipStage++;
if (this.shipPeice == 30) {
fuelCount = 0;
fuelDeliverSnd.start();
}
general.ship3.clip.gotoAndStop(shipStage);
removeMovieClip(this);
trace("ADDED");
}
}
if (this._y >= 457) {
this._y = 457;
}
if (this.sState == "inPlace") {
}
if (this.sState == "launch") {
}
};
Object.registerClass("ship", shipClass);
fireLaserSnd = new Sound();
fireLaserSnd.attachSound("fireLaserSound");
explosionSnd1 = new Sound();
explosionSnd1.attachSound("explosionSound1");
explosionSnd2 = new Sound();
explosionSnd2.attachSound("explosionSound2");
explosionSnd3 = new Sound();
explosionSnd3.attachSound("explosionSound3");
tinkSnd = new Sound();
tinkSnd.attachSound("tinkSound");
bonusCollectSnd = new Sound();
bonusCollectSnd.attachSound("bonusCollectSound");
hurtSnd = new Sound();
hurtSnd.attachSound("hurtSound");
CollectSnd = new Sound();
CollectSnd.attachSound("CollectSound");
fuelDeliverSnd = new Sound();
fuelDeliverSnd.attachSound("fuelDeliverSound");
fuelPickUpSnd = new Sound();
fuelPickUpSnd.attachSound("fuelPickUpSound");
launchSnd = new Sound();
launchSnd.attachSound("launchSound");
landSnd = new Sound();
landSnd.attachSound("landSound");
function testKeys() {
if (!hitLeft) {
if (Key.isDown(leftKey)) {
playerXSpeed = playerXSpeed - 1.2;
player._xscale = 100;
playerFacing = "left";
}
}
if (!hitRight) {
if (Key.isDown(rightKey)) {
playerXSpeed = playerXSpeed + 1.2;
player._xscale = -100;
playerFacing = "right";
}
}
if (!hitAbove) {
if (Key.isDown(upKey)) {
playerYSpeed = playerYSpeed - 6;
}
}
if (!hitBelow) {
if (Key.isDown(downKey)) {
playerYSpeed = playerYSpeed + 1;
}
}
if (Key.isDown(fireKey)) {
fireLaser();
}
}
function tinkClass() {
}
tinkClass.prototype = new MovieClip();
tinkClass.prototype.onLoad = function () {
this._rotation = random(360);
};
tinkClass.prototype.onEnterFrame = function () {
this._alpha = this._alpha - 9;
this._xscale = this._xscale * 1.1;
this._yscale = this._yscale * 1.1;
if (this._alpha < 10) {
removeMovieClip(this);
}
};
Object.registerClass("tink", tinkClass);
gameScene = "GAME";
Instance of Symbol 248 MovieClip in Frame 11
onClipEvent (enterFrame) {
_parent.frameAction();
}
Frame 15
gameState = "setup";
stop();
Frame 16
gotoAndPlay (6);
Frame 17
okBtn.onRelease = function () {
gotoAndPlay (6);
};
gameScene = "GAME COMPLETE";
if (score > yourhigh) {
yourhigh = score;
storage.data.myhighscore = score;
} else {
newHighScore_clip._y = 500;
}
Instance of Symbol 268 MovieClip "stars" in Frame 17
onClipEvent (enterFrame) {
_parent.generatestars();
}
Frame 22
stop();
Frame 23
okBtn.onRelease = function () {
gotoAndPlay (6);
};
gameScene = "GAME OVER";
if (score > yourhigh) {
yourhigh = score;
storage.data.myhighscore = score;
}
Instance of Symbol 284 MovieClip "stars" in Frame 23
onClipEvent (enterFrame) {
_parent.generatestars();
}
Frame 24
if (false) {
}
Frame 25
if (false) {
}
Frame 26
if (false) {
}
Frame 27
if (false) {
}
Frame 28
if (false) {
}
Frame 29
if (false) {
}
Frame 30
if (false) {
}
Frame 31
if (false) {
}
Frame 32
if (false) {
}
Frame 33
if (false) {
}
Frame 34
if (false) {
}
Frame 35
if (false) {
}
Frame 36
if (false) {
}
Frame 37
if (false) {
}
Frame 38
if (false) {
}
Frame 41
stop();
Symbol 8 Button
on (release) {
getURL ("http://www.macromedia.com/go/getflashplayer/", "_blank");
}
Symbol 9 MovieClip Frame 1
stop();
Symbol 18 MovieClip Frame 1
_root.stop();
Symbol 18 MovieClip Frame 93
_root.play();
Symbol 70 MovieClip [enemyStartClip] Frame 30
removeMovieClip(this);
Symbol 73 MovieClip [level1Enemy] Frame 1
this.gotoAndStop(random(5) + 1);
Symbol 120 MovieClip Frame 1
stop();
Symbol 130 MovieClip Frame 1
stop();
Symbol 140 MovieClip Frame 1
stop();
Symbol 156 Button
on (release) {
sendHighscore();
}
Symbol 164 MovieClip [highscore_entry] Frame 1
function sendHighscore() {
submitURL = (((("http://www.terrypaton.com/highscores/testScore.php?game=" + _root.gameName) + "&score=") + _root.score) + "&name=") + typeYourName;
trace(submitURL);
loadVariablesNum (submitURL, 0, "GET");
this.gotoAndPlay("loadingResult");
}
typeYourName = "type your name";
_root.yourPos = undefined;
var keyListener = new Object();
keyListener.onKeyDown = function () {
if (!(Key.getCode() === 13)) {
} else if (typeYourName != "type your name") {
trace("enter pressed");
sendHighscore();
}
};
Key.addListener(keyListener);
Symbol 164 MovieClip [highscore_entry] Frame 5
stop();
Symbol 164 MovieClip [highscore_entry] Frame 10
if (_root.yourPos == undefined) {
this.gotoAndPlay(8);
} else if (_root.yourPos != "none") {
this.gotoAndPlay("showHighscoreResult");
} else {
this.gotoAndPlay("noResult");
}
Symbol 164 MovieClip [highscore_entry] Frame 11
stop();
Symbol 164 MovieClip [highscore_entry] Frame 15
stop();
Symbol 164 MovieClip [highscore_entry] Frame 20
stop();
Symbol 172 MovieClip [shipLandDust] Frame 92
removeMovieClip(this);
Symbol 175 MovieClip [spawn] Frame 30
removeMovieClip(this);
Symbol 176 MovieClip [shipLaunchDust] Frame 59
removeMovieClip(this);
Symbol 188 MovieClip Frame 1
stop();
Symbol 192 MovieClip Frame 1
stop();
Symbol 201 MovieClip Frame 23
stop();
Symbol 206 MovieClip Frame 1
stop();
Symbol 210 Button
on (release) {
_root.resetlevel();
}
Symbol 217 Button
on (press) {
_root.musicoff();
this.over.play();
}
Symbol 220 Button
on (press) {
_root.musicon();
this.over.play();
}
Symbol 221 MovieClip Frame 1
stop();
Symbol 241 MovieClip Frame 1
stop();
Symbol 268 MovieClip Frame 1
function generatestars() {
if (sc == undefined) {
sc = 1;
sd = 0;
n = 1;
}
sc++;
if (sc > sd) {
sc = 0;
i = 0;
while (i < 5) {
stars.attachMovie("star", "s" + n, n);
with (eval ("stars.s" + n)) {
_x = -5;
_y = -5;
}
n++;
i++;
}
if (n > 1000) {
n = 0;
}
}
}
function starClass() {
}
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(200 + (tDepth * Math.cos(this.temprot)));
}
function calcScale(tDepth) {
return(10 + (90 * (tDepth / 200)));
}
starClass.prototype = new MovieClip();
starClass.prototype.onLoad = function () {
this.rot = random(360);
this.depth = 2;
this.gotoAndStop(1 + random(3));
};
starClass.prototype.onEnterFrame = function () {
this.depth = this.depth * 1.1;
this.rot = this.rot + 2;
if (this.depth > 400) {
removeMovieClip(this);
}
this.x = calcX(this.rot, this.depth);
this.y = calcY(this.rot, this.depth);
this.scale = calcScale(this.depth);
this._x = this.x;
this._y = this.y;
this._xscale = 1.5 * this.scale;
this._yscale = 1.5 * this.scale;
};
Object.registerClass("star", starClass);
Instance of Symbol 260 MovieClip "stars" in Symbol 268 MovieClip Frame 1
onClipEvent (enterFrame) {
_parent.generatestars();
}
Symbol 268 MovieClip Frame 4
stop();
Symbol 284 MovieClip Frame 1
function generatestars() {
if (sc == undefined) {
sc = 1;
sd = 0;
n = 1;
}
sc++;
if (sc > sd) {
sc = 0;
i = 0;
while (i < 1) {
stars.attachMovie("star", "s" + n, n);
with (eval ("stars.s" + n)) {
_x = -5;
_y = -5;
}
n++;
i++;
}
if (n > 1000) {
n = 0;
}
}
}
function starClass() {
}
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(200 + (tDepth * Math.cos(this.temprot)));
}
function calcScale(tDepth) {
return(10 + (90 * (tDepth / 200)));
}
starClass.prototype = new MovieClip();
starClass.prototype.onLoad = function () {
this.rot = random(360);
this.depth = 2;
this.gotoAndStop(1 + random(3));
};
starClass.prototype.onEnterFrame = function () {
this.depth = this.depth * 1.05;
if (this.depth > 400) {
removeMovieClip(this);
}
this.x = calcX(this.rot, this.depth);
this.y = calcY(this.rot, this.depth);
this.scale = calcScale(this.depth);
this._x = this.x;
this._y = this.y;
this._xscale = 1.5 * this.scale;
this._yscale = 1.5 * this.scale;
};
Object.registerClass("star", starClass);
Instance of Symbol 260 MovieClip "stars" in Symbol 284 MovieClip Frame 1
onClipEvent (enterFrame) {
_parent.generatestars();
}
Symbol 284 MovieClip Frame 4
stop();