Frame 1
_root.Rondulf.getNextHighestDepth();
Instance of Symbol 59 MovieClip "shipskin" in Frame 1
onClipEvent (load) {
speed = 10;
}
onClipEvent (enterFrame) {
if (Key.isDown(40)) {
_y = (_y + speed);
}
if (Key.isDown(38)) {
_y = (_y - speed);
}
if (Key.isDown(37)) {
_x = (_x - speed);
}
if (Key.isDown(39)) {
_x = (_x + speed);
}
if (Key.isDown(16)) {
speed = 5;
} else {
speed = 10;
}
if (_x > 310) {
_root.shipskin._x = _root.shipskin._x - 10;
}
if (_x < -10) {
_root.shipskin._x = _root.shipskin._x + 10;
}
if (_y > 561) {
_root.shipskin._y = _root.shipskin._y - 10;
}
if (_y < 0) {
_root.shipskin._y = _root.shipskin._y + 10;
}
}
Symbol 8 MovieClip [Explosion] Frame 1
#initclip 20
Object.registerClass("Explosion", Explosion);
#endinitclip
Symbol 8 MovieClip [Explosion] Frame 10
removeMovieClip("this");
Symbol 11 MovieClip [Missile] Frame 1
#initclip 11
Object.registerClass("Missile", Missile);
#endinitclip
Symbol 14 MovieClip [Redfairy3] Frame 1
#initclip 12
Object.registerClass("Redfairy3", Redfairy3);
#endinitclip
Symbol 15 MovieClip [Redfairy] Frame 1
#initclip 13
Object.registerClass("Redfairy", Redfairy);
#endinitclip
Symbol 18 MovieClip [EnemyShip] Frame 1
#initclip 14
Object.registerClass("EnemyShip", EnemyShip);
#endinitclip
Symbol 23 MovieClip [Enemybomb] Frame 1
#initclip 15
Object.registerClass("Enemybomb", Enemybomb);
#endinitclip
Symbol 23 MovieClip [Enemybomb] Frame 66
stop();
Symbol 26 MovieClip [EnemyMissile] Frame 1
#initclip 16
Object.registerClass("EnemyMissile", EnemyMissile);
#endinitclip
Symbol 29 MovieClip [Rocket2] Frame 1
#initclip 17
Object.registerClass("Rocket2", Rocket2);
#endinitclip
Symbol 31 MovieClip [Rocket] Frame 1
#initclip 18
Object.registerClass("Rocket", Rocket);
#endinitclip
Symbol 36 MovieClip [Yes] Frame 1
stop();
Symbol 39 MovieClip [No] Frame 1
stop();
Symbol 54 MovieClip [Ship] Frame 1
#initclip 19
Object.registerClass("Ship", Ship);
#endinitclip
Symbol 77 Button
on (release) {
sound.setVolume(0);
gotoAndStop (2);
}
Symbol 79 Button
on (release) {
sound.setVolume(100);
gotoAndStop (1);
}
Symbol 80 MovieClip Frame 1
stop();
sound = new Sound();
Symbol 95 MovieClip [__Packages.Missile] Frame 0
class Missile extends MovieClip
{
var speed, _y, hitTest, removeMovieClip;
function Missile () {
super();
}
function onLoad() {
speed = 10 + random(2);
}
function onEnterFrame() {
_y = _y - speed;
for (var _local3 in _root.ship.enemies) {
if (hitTest(_root.ship.enemies[_local3])) {
removeMovieClip();
_root.ship.enemies[_local3].takeDamage();
}
}
if (_y < -10) {
removeMovieClip();
}
}
}
Symbol 96 MovieClip [__Packages.Redfairy3] Frame 0
class Redfairy3 extends MovieClip
{
var _y, _x, speed, shootTimer, health, removeMovieClip, hitTest;
function Redfairy3 () {
super();
}
function onLoad() {
_y = _y + (20 + random(200));
_x = 330;
speed = random(-5) + -5;
shootTimer = 0;
health = 40;
}
function onEnterFrame() {
_x = _x + speed;
if (_x < -10) {
removeMovieClip();
}
if (hitTest(_root.ship)) {
explode();
_root.ship.updateHealth(-34);
}
if (hitTest(_root.shipskin.body)) {
_root.ship.updateScore(3);
_root.ships.graze(1);
}
shootTimer = shootTimer + 2;
if (shootTimer > 30) {
shootTimer = 0;
var _local3 = _root.attachMovie("Enemybomb", "Enemybomb" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local3._y = _y + 0;
_local3._x = _x - 2;
}
}
function takeDamage() {
health = health - 10;
if (health < 1) {
explode();
}
}
function explode() {
var _local3 = _root.attachMovie("Explosion", "Explosion" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local3._x = _x;
_local3._y = _y;
removeMovieClip();
_root.ship.updateScore(5000);
_root.ship.kills = _root.ship.kills + 1;
}
}
Symbol 97 MovieClip [__Packages.Redfairy] Frame 0
class Redfairy extends MovieClip
{
var _y, _x, speed, shootTimer, health, removeMovieClip, hitTest;
function Redfairy () {
super();
}
function onLoad() {
_y = _y + (20 + random(200));
_x = 0;
speed = (Math.random() * 5) + 5;
shootTimer = 0;
health = 40;
}
function onEnterFrame() {
_x = _x + speed;
if (_x > 340) {
removeMovieClip();
}
if (hitTest(_root.ship)) {
explode();
_root.ship.updateHealth(-34);
}
if (hitTest(_root.shipskin.body)) {
_root.ship.updateScore(3);
_root.ships.graze(1);
}
shootTimer = shootTimer + 2;
if (shootTimer > 30) {
shootTimer = 0;
var _local3 = _root.attachMovie("Enemybomb", "Enemybomb" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local3._y = _y + 0;
_local3._x = _x - 2;
}
}
function takeDamage() {
health = health - 10;
if (health < 1) {
explode();
}
}
function explode() {
var _local3 = _root.attachMovie("Explosion", "Explosion" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local3._x = _x;
_local3._y = _y;
removeMovieClip();
_root.ship.updateScore(5000);
_root.ship.kills = _root.ship.kills + 1;
}
}
Symbol 98 MovieClip [__Packages.EnemyShip] Frame 0
class EnemyShip extends MovieClip
{
var _y, _x, speed, shootTimer, health, removeMovieClip, hitTest;
function EnemyShip () {
super();
}
function onLoad() {
_y = _y - 5;
_x = 1 + (Math.random() * 330);
speed = (Math.random() * 1) + 1;
shootTimer = 0;
health = 30;
_root.enemyHealthMeter.bar._xscale = 100;
}
function onEnterFrame() {
_y = _y + speed;
if (_y > 600) {
removeMovieClip();
}
shootTimer = shootTimer + 1;
if (shootTimer > 30) {
shootTimer = 0;
var _local3 = _root.attachMovie("EnemyMissile", "EnemyMissile" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local3._y = _y + 50;
_local3._x = _x - 2;
}
if (hitTest(_root.ship)) {
removeMovieClip();
_root.ship.updateHealth(-34);
}
if (hitTest(_root.shipskin.body)) {
_root.ship.updateScore(1);
_root.ships.graze(1);
}
}
function takeDamage() {
health = health - 10;
if (health < 1) {
explode();
}
_root.enemyHealthMeter.bar._xscale = health;
}
function explode() {
var _local3 = _root.attachMovie("Explosion", "Explosion" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local3._x = _x;
_local3._y = _y;
removeMovieClip();
_root.ship.updateScore(1000);
_root.ship.kills = _root.ship.kills + 1;
}
}
Symbol 99 MovieClip [__Packages.Enemybomb] Frame 0
class Enemybomb extends MovieClip
{
var speed, _y, hitTest, removeMovieClip, _x;
function Enemybomb () {
super();
}
function onLoad() {
speed = -5;
}
function onEnterFrame() {
_y = _y - speed;
if (hitTest(_root.ship)) {
removeMovieClip();
_root.ship.updateHealth(-34);
}
if (hitTest(_root.shipskin.body)) {
_root.ship.updateScore(7);
_root.ships.graze(2);
}
if (_y > 620) {
removeMovieClip();
}
}
function explode() {
var _local3 = _root.attachMovie("Explosion", "Explosion" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local3._x = _x;
_local3._y = _y;
removeMovieClip();
}
}
Symbol 100 MovieClip [__Packages.EnemyMissile] Frame 0
class EnemyMissile extends MovieClip
{
var speed, _y, hitTest, removeMovieClip, _x;
function EnemyMissile () {
super();
}
function onLoad() {
speed = -10;
}
function onEnterFrame() {
_y = _y - speed;
if (hitTest(_root.ship)) {
removeMovieClip();
_root.ship.updateHealth(-34);
}
if (hitTest(_root.shipskin.body)) {
_root.ship.updateScore(3);
_root.ships.graze(1);
}
if (_y > 620) {
removeMovieClip();
}
}
function explode() {
var _local3 = _root.attachMovie("Explosion", "Explosion" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local3._x = _x;
_local3._y = _y;
removeMovieClip();
}
}
Symbol 101 MovieClip [__Packages.Rocket2] Frame 0
class Rocket2 extends MovieClip
{
var speed, _y, hitTest, removeMovieClip;
function Rocket2 () {
super();
}
function onLoad() {
speed = 10 + random(2);
}
function onEnterFrame() {
_y = _y - speed;
for (var _local3 in _root.ship.enemies) {
if (hitTest(_root.ship.enemies[_local3])) {
removeMovieClip();
_root.ship.enemies[_local3].takeDamage();
}
}
if (_y < -10) {
removeMovieClip();
}
}
}
Symbol 102 MovieClip [__Packages.Rocket] Frame 0
class Rocket extends MovieClip
{
var speed, _y, hitTest, removeMovieClip;
function Rocket () {
super();
}
function onLoad() {
speed = 10 + random(2);
}
function onEnterFrame() {
_y = _y - speed;
for (var _local3 in _root.ship.enemies) {
if (hitTest(_root.ship.enemies[_local3])) {
removeMovieClip();
_root.ship.enemies[_local3].takeDamage();
}
}
if (_y < -10) {
removeMovieClip();
}
}
}
Symbol 103 MovieClip [__Packages.Ship] Frame 0
class Ship extends MovieClip
{
var velocity, shootLimiter, shootLimiter2, shootLimiter3, enemyTimer, enemyTimer2, enemies, kills, graze, _visible, _x, _y, score, health, finalScore;
function Ship () {
super();
}
function onLoad() {
_root.kongregateServices.connect();
_root.backgroundMusic = new Sound();
_root.backgroundMusic.attachSound("SeleneLight.mp3");
_root.backgroundMusic.start(0, 1000);
velocity = 10;
shootLimiter = 0;
shootLimiter2 = 0;
shootLimiter3 = 0;
enemyTimer = 0;
enemyTimer2 = 0;
enemies = [];
resetScore();
resetHealth();
kills = 0;
graze = 0;
_visible = false;
_root.gameOverMenu._visible = false;
_root.healthMeter._x = 1000;
_root.enemyHealthMeter._visible = false;
_root.gameStartMenu.StartNowButton.onPress = function () {
_root.ship.newGame();
};
}
function onEnterFrame() {
if (_visible == true) {
shootLimiter = shootLimiter + 1;
shootLimiter2 = shootLimiter2 + 1;
shootLimiter3 = shootLimiter3 + 1;
if (Key.isDown(39)) {
_x = _x + velocity;
}
if (Key.isDown(37)) {
_x = _x - velocity;
}
if (Key.isDown(38)) {
_y = _y - velocity;
}
if (Key.isDown(40)) {
_y = _y + velocity;
}
if (Key.isDown(16)) {
velocity = 5;
} else {
velocity = 10;
}
if (Key.isDown(32) && (shootLimiter > 5)) {
shootLimiter = 0;
var _local5 = _root.attachMovie("Missile", "Missile" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local5._x = _x + 0;
_local5._y = _y - 30;
}
if (Key.isDown(32) && (shootLimiter2 > 15)) {
shootLimiter2 = 0;
var _local4 = _root.attachMovie("Rocket", "Rocket" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local4._x = _x + 20;
_local4._y = _y - 0;
}
if (Key.isDown(32) && (shootLimiter3 > 15)) {
shootLimiter3 = 0;
var _local3 = _root.attachMovie("Rocket2", "Rocket2" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local3._x = _x - 20;
_local3._y = _y - 0;
}
if (_x > 330) {
_root.ship._x = _root.ship._x - 10;
}
if (_x < 12) {
_root.ship._x = _root.ship._x + 10;
}
if (_y > 576) {
_root.ship._y = _root.ship._y - 10;
}
if (_y < 0) {
_root.ship._y = _root.ship._y + 10;
}
enemyTimer = enemyTimer + 10;
if (enemyTimer > 60) {
enemyTimer = 0;
var _local6 = _root.attachMovie("EnemyShip", "EnemyShip" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
enemies.push(_local6);
}
enemyTimer2 = enemyTimer2 + 4;
if (enemyTimer2 > 60) {
enemyTimer2 = 0;
var _local6 = _root.attachMovie("Redfairy", "Redfairy" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
enemies.push(_local6);
_local6 = _root.attachMovie("Redfairy3", "Redfairy3" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
enemies.push(_local6);
}
if (score > NaN) {
enemyTimer2 = enemyTimer2 + 0;
enemyTimer = enemyTimer + 20;
}
if (score > NaN) {
enemyTimer2 = enemyTimer2 + 2;
enemyTimer = 2;
}
if (score > NaN) {
enemyTimer2 = enemyTimer2 + 10;
enemyTimer = 0;
}
}
}
function updateScore(points) {
score = score + points;
_root.scoreText.text = score;
}
function resetScore() {
score = 0;
_root.scoreText.text = score;
}
function updateHealth(points) {
health = health + points;
if (health < 1) {
health = 0;
_root.gameOverMenu._visible = true;
explode();
}
_root.healthMeter.bar._xscale = health;
}
function resetHealth() {
health = 100;
_root.healthMeter.bar._xscale = 100;
}
function explode() {
_visible = false;
_root.shipskin._visible = false;
_root.orb1._visible = false;
_root.orb2._visible = false;
var _local4 = _root.attachMovie("Explosion", "Explosion" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local4._x = _x;
_local4._y = _y;
for (var _local3 in enemies) {
enemies[_local3].explode();
}
_root.Enemybomb._visible = false;
_root.EnemyMissile._visible = false;
gameOver();
_root.kongregateScores.submit("score", score);
}
function newGame() {
_visible = true;
_root.shipskin._visible = true;
_root.orb1._visible = true;
_root.orb2._visible = true;
_root.healthMeter._x = 360;
_root.scoreText.visible = true;
_y = 515;
_x = 212;
_root.MuteBox._x = 450;
_root.MuteBox._y = 500;
_root.controls._x = 2000;
_root.shipskin._y = 500;
_root.shipskin._x = 200;
_root.orb1._y = 520;
_root.orb1._x = 225;
_root.orb2._y = 520;
_root.orb2._x = 190;
_root.gameOverMenu._visible = false;
_root.gameStartMenu._visible = false;
resetHealth();
resetScore();
_root.scoreText._x = 419.6;
_root.line._x = 330;
graze = 0;
}
function gameOver() {
_root.gameOverMenu._visible = true;
_root.gameOverMenu.playAgainButton.onPress = function () {
_root.ship.newGame();
};
_root.gameOverMenu.killBonus.text = kills;
_root.gameOverMenu.grazeBonus.text = graze;
finalScore = score + (kills * 100);
graze * 10;
_root.gameOverMenu.finalScore.text = finalScore;
_root.kongregateStats.submit("HighScore", finalScore);
_root.kongregateStats.submit("HighScore2", finalScore);
_root.kongregateStats.submit("Kills", kills);
}
}
Symbol 104 MovieClip [__Packages.Explosion] Frame 0
class Explosion extends MovieClip
{
var _totalframes, _currentframe, removeMovieClip;
function Explosion () {
super();
}
function onEnterFrame() {
if (_currentframe == _totalframes) {
removeMovieClip();
}
}
}