Section 1
//Ammunition (cm0427.Ammunition)
package cm0427 {
import flash.display.*;
import flash.events.*;
import flash.ui.*;
import flash.filters.*;
public class Ammunition extends Sprite {
private var MINHEIGHT:int;
private var velocity:int;
public static var ammoList:Array = [];
public function Ammunition(_arg1:int, _arg2:int, _arg3:int){
MINHEIGHT = _arg3;
x = (_arg1 + (width / 2));
y = (Math.floor((Math.random() * ((_arg2 - MINHEIGHT) - (height / 2)))) + MINHEIGHT);
velocity = 10;
addEventListener(Event.ENTER_FRAME, frameMove);
velocity = 10;
addEventListener(Event.ENTER_FRAME, frameMove);
}
private function frameMove(_arg1:Event){
x = (x - velocity);
if (x < (0 - (width / 2))){
x = (stage.stageWidth + width);
y = ((Math.random() * (stage.stageHeight - height)) + height);
removeEventListener(Event.ENTER_FRAME, frameMove);
parent.removeChild(this);
};
}
public function kill(_arg1:Event){
if (x > (250 - (width / 2))){
removeEventListener(Event.ENTER_FRAME, frameMove);
parent.removeChild(this);
};
}
public static function kill(){
while (Ammunition.ammoList.width > 0) {
Ammunition.ammoList[0].kill(true);
};
}
}
}//package cm0427
Section 2
//Background (cm0427.Background)
package cm0427 {
import flash.display.*;
public dynamic class Background extends MovieClip {
}
}//package cm0427
Section 3
//Brian (cm0427.Brian)
package cm0427 {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.ui.*;
import flash.filters.*;
public class Brian extends Sprite {
private var explosion:Explosion;
private var xVelocity:Number;
private var yVelocity:Number;
private var MINHEIGHT:int;
public var wobbleAmount:int;
public var wobbleEdit:int;
public var difficultButton;
private var shootTimer:Timer;
private static const DEAD_BRIAN:String = "deadBrian";
private static const EXPLOSION:String = "explodingBrian";
public static var brianList:Array = [];
public function Brian(_arg1:int, _arg2:int, _arg3:int){
MINHEIGHT = _arg3;
brianList.push(this);
x = (_arg1 + (width / 2));
y = (Math.floor((Math.random() * ((_arg2 - MINHEIGHT) - (height / 2)))) + MINHEIGHT);
xVelocity = (Math.floor((Math.random() * 10)) + 10);
var _local4:Number = 0.5;
wobbleAmount = 0.5;
wobbleEdit = 0.5;
if (Math.random() < 0.5){
yVelocity = (Math.floor((Math.random() * 2)) + 3);
} else {
if (Math.random() > 0.5){
yVelocity = (Math.floor((Math.random() * 2)) - 3);
} else {
yVelocity = 0;
};
};
addEventListener(Event.ENTER_FRAME, enterFrame);
cacheAsBitmap = true;
var _local5:BitmapFilter = new DropShadowFilter(5, 45, 0, 50, 5, 5);
var _local6:Array = new Array();
_local6.push(_local5);
filters = _local6;
}
public function enterFrame(_arg1:Event){
x = (x - xVelocity);
moveY();
if (x < (0 - (width / 2))){
kill(false);
};
}
public function moveY(){
if ((((yVelocity > 0)) && ((y > (stage.stageHeight - (width / 2)))))){
yVelocity = (yVelocity * -1);
} else {
if ((((yVelocity < 0)) && ((y < (MINHEIGHT + (height / 2)))))){
yVelocity = (yVelocity * -1);
};
};
y = (y + yVelocity);
}
public function kill(_arg1:Boolean){
if (_arg1){
explosion = new Explosion(x, y);
stage.addChild(explosion);
};
removeEventListener(Event.ENTER_FRAME, enterFrame);
var _local2:int;
while (_local2 < brianList.length) {
if (brianList[_local2] == this){
brianList.splice(_local2, 1);
};
_local2++;
};
parent.removeChild(this);
}
public static function killAll(){
while (Brian.brianList.length > 0) {
Brian.brianList[0].kill(true);
};
}
}
}//package cm0427
Section 4
//Bullet (cm0427.Bullet)
package cm0427 {
import flash.display.*;
import flash.events.*;
public class Bullet extends Sprite {
private var speed:int;
private static const SHIP_KILL:String = "shipKill";
public function Bullet(_arg1, _arg2){
var _local3:* = new Shot2();
_local3.play();
speed = 20;
x = _arg1;
y = _arg2;
addEventListener(Event.ENTER_FRAME, enterFrame);
cacheAsBitmap = true;
}
private function enterFrame(_arg1:Event){
var _local3:*;
x = (x + speed);
if (x > (stage.stageWidth + (width / 2))){
kill();
return;
};
var _local2:int;
while (_local2 < Brian.brianList.length) {
if (this.hitTestObject(Brian.brianList[_local2])){
_local3 = new Hit();
_local3.play();
dispatchEvent(new Event(Bullet.SHIP_KILL, true));
Brian.brianList[_local2].kill(true);
kill();
break;
};
_local2++;
};
}
private function kill(){
parent.removeChild(this);
removeEventListener(Event.ENTER_FRAME, enterFrame);
}
}
}//package cm0427
Section 5
//easybutton (cm0427.easybutton)
package cm0427 {
import flash.display.*;
public dynamic class easybutton extends MovieClip {
}
}//package cm0427
Section 6
//Explosion (cm0427.Explosion)
package cm0427 {
import flash.display.*;
import flash.events.*;
public class Explosion extends MovieClip {
public function Explosion(_arg1, _arg2){
x = _arg1;
y = _arg2;
addEventListener(Event.ENTER_FRAME, enterFrame);
}
public function enterFrame(_arg1:Event){
if (currentFrame == totalFrames){
removeEventListener(Event.ENTER_FRAME, enterFrame);
stage.removeChild(this);
};
}
}
}//package cm0427
Section 7
//Explosion2 (cm0427.Explosion2)
package cm0427 {
import flash.display.*;
public dynamic class Explosion2 extends MovieClip {
}
}//package cm0427
Section 8
//Hyperspace (cm0427.Hyperspace)
package cm0427 {
import flash.display.*;
import flash.events.*;
public class Hyperspace extends Sprite {
private var velocity:int;
private var MINHEIGHT:int;
public static var hyperList:Array = [];
public function Hyperspace(_arg1:int, _arg2:int, _arg3:int){
MINHEIGHT = _arg3;
hyperList.push(this);
x = ((Math.random() * (_arg1 - width)) + (width / 2));
y = (_arg2 + (height / 2));
velocity = 6;
addEventListener(Event.ENTER_FRAME, frameMove);
}
private function frameMove(_arg1:Event){
y = (y - velocity);
if (y < (0 - (height / 2))){
killAll();
};
}
private function killAll(){
removeEventListener(Event.ENTER_FRAME, frameMove);
parent.removeChild(this);
}
}
}//package cm0427
Section 9
//Hyperspace2 (cm0427.Hyperspace2)
package cm0427 {
import flash.display.*;
public dynamic class Hyperspace2 extends MovieClip {
}
}//package cm0427
Section 10
//Key (cm0427.Key)
package cm0427 {
import flash.display.*;
import flash.events.*;
public class Key {
private static var initialized:Boolean = false;
private static var keysDown:Array = new Array();
public static function initialize(_arg1:Stage){
if (!initialized){
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
_arg1.addEventListener(KeyboardEvent.KEY_UP, keyReleased);
_arg1.addEventListener(Event.DEACTIVATE, clearKeys);
initialized = true;
};
}
public static function isDown(_arg1:uint):Boolean{
return (Boolean((_arg1 in keysDown)));
}
private static function keyPressed(_arg1:KeyboardEvent):void{
keysDown[_arg1.keyCode] = true;
}
private static function keyReleased(_arg1:KeyboardEvent):void{
if ((_arg1.keyCode in keysDown)){
delete keysDown[_arg1.keyCode];
};
}
private static function clearKeys(_arg1:Event):void{
keysDown = new Array();
}
}
}//package cm0427
Section 11
//LAARK (cm0427.LAARK)
package cm0427 {
import flash.display.*;
public class LAARK extends Sprite {
private var MINHEIGHT:int;
private var _velocity:int;
private var _midPointX:int;
private var _midPointY:int;
public static const DEAD:String = "deadLAARK";
public function LAARK(_arg1:int, _arg2:int, _arg3:int){
_midPointX = (width / 2);
_midPointY = (height / 2);
super();
velocity = 10;
x = _arg1;
y = _arg2;
MINHEIGHT = _arg3;
}
public function get velocity():int{
return (_velocity);
}
public function set velocity(_arg1:int){
_velocity = _arg1;
}
public function get midPointX():int{
return (_midPointX);
}
public function get midPointY():int{
return (_midPointY);
}
public function Kill(){
parent.removeChild(this);
}
public function Move(_arg1:String){
switch (_arg1){
case "L":
if (((x - midPointX) - velocity) >= (0 - midPointX)){
x = (x - velocity);
};
break;
case "R":
if (((x + midPointX) + velocity) <= stage.stageWidth){
x = (x + velocity);
};
break;
case "U":
if (((y - midPointY) - velocity) >= (MINHEIGHT - 20)){
y = (y - velocity);
};
break;
case "D":
if (((y + midPointY) + velocity) <= stage.stageHeight){
y = (y + velocity);
};
break;
};
}
}
}//package cm0427
Section 12
//LAARK3 (cm0427.LAARK3)
package cm0427 {
import flash.display.*;
public dynamic class LAARK3 extends MovieClip {
}
}//package cm0427
Section 13
//Nplogo (cm0427.Nplogo)
package cm0427 {
import flash.display.*;
public dynamic class Nplogo extends MovieClip {
}
}//package cm0427
Section 14
//RFoG (cm0427.RFoG)
package cm0427 {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.text.*;
import flash.ui.*;
public class RFoG extends Sprite {
public var superButton:MovieClip;
public var normalButton:MovieClip;
public var difficultButton:MovieClip;
public var ammoText:TextField;
public var scoreText:TextField;
public var loaderBar:MovieClip;
public var Nplogo:Nplogo;
public var Title:Title;
private var ship:LAARK;
private var monitor:TextField;
private var hyper:Hyperspace;
private var Ammo:Ammunition;
private var spaceLocked:Boolean;
private var brianTimer:Timer;
private var hyperTimer:Timer;
private var ammoTimer:Timer;
private var scoreTimer:Timer;
private var invulnTimer:Timer;
private var kills:int;
private var misses:int;
private var hits:int;
private var points:int;
private var invulnerable:Boolean;
private var shots:int;
private var respawnTimer:Timer;
private var normTimer:Timer;
private var diffTimer:Timer;
private var superTimer:Timer;
private var ammo:int;
private var ammostart:int;// = 25
public static var WIDTH;
public static var HEIGHT;
public static var SCOREAREA = 50;
public static var wobbleEdit:int;
public function RFoG(){
WIDTH = stage.stageWidth;
HEIGHT = stage.stageHeight;
spaceLocked = false;
loaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler);
loaderInfo.addEventListener(Event.COMPLETE, completeListener);
loaderBar.visible = true;
var _local1:* = new SoundAlien();
_local1.play(0, 99);
addEventListener("ammoHit", ammoHitListener);
addEventListener("hyperHit", hyperHitListener);
addEventListener("enemyHit", enemyHitListener);
addEventListener("shipKill", killListener);
addEventListener("deadHyper", killListener);
scoreText.visible = false;
Key.initialize(stage);
monitor = new TextField();
addChild(monitor);
}
private function enterFrame(_arg1:Event){
var _local3:int;
if (Key.isDown(Keyboard.LEFT)){
ship.Move("L");
} else {
if (Key.isDown(Keyboard.RIGHT)){
ship.Move("R");
};
};
if (Key.isDown(Keyboard.UP)){
ship.Move("U");
} else {
if (Key.isDown(Keyboard.DOWN)){
ship.Move("D");
};
};
if (invulnerable == false){
_local3 = 0;
while (_local3 < Brian.brianList.length) {
if (ship.hitTestObject(Brian.brianList[_local3])){
GameOver();
break;
};
_local3++;
};
};
var _local2:int;
while (_local2 < Hyperspace.hyperList.length) {
if (ship != null){
if (ship.hitTestObject(Hyperspace.hyperList[_local2])){
Invulnerability();
RandomLoc();
ammo = (ammo + 5);
(ammoText.text == (ammoText.text + 5));
break;
};
};
_local2++;
};
}
private function RandomLoc(){
ship.x = Math.floor((Math.random() * WIDTH));
ship.y = Math.floor((Math.random() * HEIGHT));
}
private function Invulnerability(){
invulnerable = true;
invulnTimer = new Timer(5000, 0);
invulnTimer.addEventListener("timer", invulnerabilityTimerHandler);
invulnTimer.start();
}
private function invulnerabilityTimerHandler(_arg1:TimerEvent){
invulnerable = false;
}
private function GameOver(){
var _local1:* = new Hit();
_local1.play();
ship.Kill();
ship = null;
Brian.killAll();
hyper = null;
removeEventListener(Event.ENTER_FRAME, enterFrame);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownListener);
stage.removeEventListener(KeyboardEvent.KEY_UP, keyUpListener);
stage.removeEventListener(MouseEvent.CLICK, mouseClickListener);
brianTimer.stop();
removeEventListener("timer", brianTimerHandler);
hyperTimer.stop();
removeEventListener("timer", hyperTimerHandler);
ammoTimer.stop();
removeEventListener("timer", ammoTimerHandler);
scoreTimer.stop();
removeEventListener("timer", scoreTimerHandler);
normTimer = new Timer(2000, 0);
normTimer.addEventListener("timer", normalTimerHandler);
normTimer.start();
diffTimer = new Timer(2000, 0);
diffTimer.addEventListener("timer", difficultTimerHandler);
diffTimer.start();
superTimer = new Timer(2000, 0);
superTimer.addEventListener("timer", superTimerHandler);
superTimer.start();
Title.visible = true;
Nplogo.visible = true;
}
private function normalTimerHandler(_arg1:TimerEvent){
normTimer.stop();
removeEventListener("timer", normalTimerHandler);
normalButton.visible = true;
normalButton.addEventListener(MouseEvent.CLICK, normal);
}
private function difficultTimerHandler(_arg1:TimerEvent){
diffTimer.stop();
removeEventListener("timer", difficultTimerHandler);
difficultButton.visible = true;
difficultButton.addEventListener(MouseEvent.CLICK, difficult);
}
private function superTimerHandler(_arg1:TimerEvent){
superTimer.stop();
removeEventListener("timer", superTimerHandler);
superButton.visible = true;
superButton.addEventListener(MouseEvent.CLICK, superhuman);
}
private function keyDownListener(_arg1:KeyboardEvent){
var _local2:Bullet;
if (ammo > 0){
if ((((_arg1.keyCode == Keyboard.SPACE)) && (!(spaceLocked)))){
spaceLocked = true;
_local2 = new Bullet(((ship.x + ship.midPointX) - 10), (ship.y - 5));
if (ammo > 0){
addChild(_local2);
};
ammo--;
ammoText.text = ammo.toString();
};
};
}
private function mouseClickListener(_arg1:MouseEvent){
var _local2:Bullet = new Bullet(((ship.x + ship.midPointX) - 10), (ship.y - 5));
addChild(_local2);
}
private function keyUpListener(_arg1:KeyboardEvent){
if (_arg1.keyCode == Keyboard.SPACE){
spaceLocked = false;
};
}
public function brianTimerHandler(_arg1:TimerEvent){
var _local2:Brian = new Brian(WIDTH, HEIGHT, SCOREAREA);
addChild(_local2);
}
public function hyperTimerHandler(_arg1:TimerEvent){
var _local2:Hyperspace = new Hyperspace(WIDTH, HEIGHT, SCOREAREA);
addChild(_local2);
}
public function ammoTimerHandler(_arg1:TimerEvent){
var _local2:Ammunition = new Ammunition(WIDTH, HEIGHT, SCOREAREA);
addChild(_local2);
}
public function scoreTimerHandler(_arg1:TimerEvent){
scoreText.text = String(points);
points = (points + 100);
}
private function progressHandler(_arg1:ProgressEvent){
loaderBar.meter.scaleX = (_arg1.bytesLoaded / _arg1.bytesTotal);
}
private function completeListener(_arg1:Event):void{
loaderBar.visible = false;
normalButton.visible = true;
superButton.visible = true;
difficultButton.visible = true;
Title.visible = true;
Nplogo.visible = true;
normalButton.addEventListener(MouseEvent.CLICK, normal);
difficultButton.addEventListener(MouseEvent.CLICK, difficult);
superButton.addEventListener(MouseEvent.CLICK, superhuman);
}
private function killListener(_arg1:Event){
scoreText.text = String(points);
}
private function enemyHitListener(_arg1:Event){
GameOver();
}
private function hyperHitListener(_arg1:Event){
ship.visible = false;
}
private function ammoHitListener(_arg1:Event){
ship.visible = false;
}
private function normal(_arg1:MouseEvent){
_arg1.stopImmediatePropagation();
ammo = ammostart;
addEventListener(Event.ENTER_FRAME, enterFrame);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownListener);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUpListener);
stage.addEventListener(MouseEvent.CLICK, mouseClickListener);
normalButton.visible = false;
difficultButton.visible = false;
superButton.visible = false;
Title.visible = false;
Nplogo.visible = false;
scoreText.text = String(0);
scoreText.visible = true;
ammoText.text = String(25);
ammoText.visible = true;
kills = 0;
hits = 0;
points = 0;
misses = 0;
shots = 0;
ammoText.text = String(ammo);
ammoText.visible = true;
shots = -1;
ship = new LAARK((WIDTH / 2), (HEIGHT / 2), SCOREAREA);
addChild(ship);
brianTimer = new Timer(1000, 0);
brianTimer.addEventListener("timer", brianTimerHandler);
brianTimer.start();
hyperTimer = new Timer(9000, 0);
hyperTimer.addEventListener("timer", hyperTimerHandler);
hyperTimer.start();
ammoTimer = new Timer(6000, 0);
ammoTimer.addEventListener("timer", ammoTimerHandler);
ammoTimer.start();
scoreTimer = new Timer(200, 0);
scoreTimer.addEventListener("timer", scoreTimerHandler);
scoreTimer.start();
}
private function difficult(_arg1:MouseEvent){
_arg1.stopImmediatePropagation();
ammo = ammostart;
addEventListener(Event.ENTER_FRAME, enterFrame);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownListener);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUpListener);
stage.addEventListener(MouseEvent.CLICK, mouseClickListener);
normalButton.visible = false;
difficultButton.visible = false;
superButton.visible = false;
Title.visible = false;
Nplogo.visible = false;
normalButton.removeEventListener(MouseEvent.CLICK, onPlay);
difficultButton.removeEventListener(MouseEvent.CLICK, onPlay);
superButton.removeEventListener(MouseEvent.CLICK, onPlay);
scoreText.text = String(0);
scoreText.visible = true;
ammoText.text = String(25);
ammoText.visible = true;
kills = 0;
hits = 0;
points = 0;
misses = 0;
shots = 0;
ship = new LAARK((WIDTH / 2), (HEIGHT / 2), SCOREAREA);
addChild(ship);
brianTimer = new Timer(900, 0);
brianTimer.addEventListener("timer", brianTimerHandler);
brianTimer.start();
hyperTimer = new Timer(9000, 0);
hyperTimer.addEventListener("timer", hyperTimerHandler);
hyperTimer.start();
ammoTimer = new Timer(1000, 0);
ammoTimer.addEventListener("timer", ammoTimerHandler);
ammoTimer.start();
scoreTimer = new Timer(200, 0);
scoreTimer.addEventListener("timer", scoreTimerHandler);
scoreTimer.start();
}
private function superhuman(_arg1:MouseEvent){
_arg1.stopImmediatePropagation();
ammo = ammostart;
addEventListener(Event.ENTER_FRAME, enterFrame);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownListener);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUpListener);
stage.addEventListener(MouseEvent.CLICK, mouseClickListener);
normalButton.visible = false;
difficultButton.visible = false;
superButton.visible = false;
Title.visible = false;
Nplogo.visible = false;
normalButton.removeEventListener(MouseEvent.CLICK, onPlay);
difficultButton.removeEventListener(MouseEvent.CLICK, onPlay);
superButton.removeEventListener(MouseEvent.CLICK, onPlay);
scoreText.text = String(0);
scoreText.visible = true;
ammoText.text = String(25);
ammoText.visible = true;
kills = 0;
hits = 0;
points = 0;
misses = 0;
shots = 0;
ship = new LAARK((WIDTH / 2), (HEIGHT / 2), SCOREAREA);
addChild(ship);
brianTimer = new Timer(600, 0);
brianTimer.addEventListener("timer", brianTimerHandler);
brianTimer.start();
hyperTimer = new Timer(9000, 0);
hyperTimer.addEventListener("timer", hyperTimerHandler);
hyperTimer.start();
ammoTimer = new Timer(60, 0);
ammoTimer.addEventListener("timer", ammoTimerHandler);
ammoTimer.start();
scoreTimer = new Timer(200, 0);
scoreTimer.addEventListener("timer", scoreTimerHandler);
scoreTimer.start();
}
private function onPlay(_arg1:MouseEvent){
_arg1.stopImmediatePropagation();
ammo = ammostart;
addEventListener(Event.ENTER_FRAME, enterFrame);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownListener);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUpListener);
stage.addEventListener(MouseEvent.CLICK, mouseClickListener);
normalButton.visible = false;
difficultButton.visible = false;
superButton.visible = false;
scoreText.text = String(0);
scoreText.visible = true;
kills = 0;
hits = 0;
points = 0;
misses = 0;
shots = 0;
ship = new LAARK((WIDTH / 2), (HEIGHT / 2), SCOREAREA);
addChild(ship);
brianTimer = new Timer(1000, 0);
brianTimer.addEventListener("timer", brianTimerHandler);
brianTimer.start();
hyperTimer = new Timer(9000, 0);
hyperTimer.addEventListener("timer", hyperTimerHandler);
hyperTimer.start();
ammoTimer = new Timer(6000, 0);
ammoTimer.addEventListener("timer", ammoTimerHandler);
ammoTimer.start();
}
}
}//package cm0427
Section 15
//Title (cm0427.Title)
package cm0427 {
import flash.display.*;
public dynamic class Title extends MovieClip {
}
}//package cm0427
Section 16
//a (a)
package {
import flash.media.*;
public dynamic class a extends Sound {
}
}//package
Section 17
//Hit (Hit)
package {
import flash.media.*;
public dynamic class Hit extends Sound {
}
}//package
Section 18
//Shot2 (Shot2)
package {
import flash.media.*;
public dynamic class Shot2 extends Sound {
}
}//package
Section 19
//SoundAlien (SoundAlien)
package {
import flash.media.*;
public dynamic class SoundAlien extends Sound {
}
}//package
Section 20
//SoundAlien1 (SoundAlien1)
package {
import flash.media.*;
public dynamic class SoundAlien1 extends Sound {
}
}//package
Section 21
//SoundAliena (SoundAliena)
package {
import flash.media.*;
public dynamic class SoundAliena extends Sound {
}
}//package
Section 22
//SoundEnemyShot (SoundEnemyShot)
package {
import flash.media.*;
public dynamic class SoundEnemyShot extends Sound {
}
}//package