Section 1
//BitmapAsset (mx.core.BitmapAsset)
package mx.core {
import flash.display.*;
public class BitmapAsset extends FlexBitmap implements IFlexAsset, IFlexDisplayObject {
mx_internal static const VERSION:String = "3.3.0.4852";
public function BitmapAsset(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
public function get measuredWidth():Number{
if (bitmapData){
return (bitmapData.width);
};
return (0);
}
public function get measuredHeight():Number{
if (bitmapData){
return (bitmapData.height);
};
return (0);
}
public function setActualSize(_arg1:Number, _arg2:Number):void{
width = _arg1;
height = _arg2;
}
public function move(_arg1:Number, _arg2:Number):void{
this.x = _arg1;
this.y = _arg2;
}
}
}//package mx.core
Section 2
//ByteArrayAsset (mx.core.ByteArrayAsset)
package mx.core {
import flash.utils.*;
public class ByteArrayAsset extends ByteArray implements IFlexAsset {
mx_internal static const VERSION:String = "3.3.0.4852";
}
}//package mx.core
Section 3
//FlexBitmap (mx.core.FlexBitmap)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexBitmap extends Bitmap {
mx_internal static const VERSION:String = "3.3.0.4852";
public function FlexBitmap(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
var bitmapData = _arg1;
var pixelSnapping = _arg2;
var smoothing = _arg3;
super(bitmapData, pixelSnapping, smoothing);
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 4
//FontAsset (mx.core.FontAsset)
package mx.core {
import flash.text.*;
public class FontAsset extends Font implements IFlexAsset {
mx_internal static const VERSION:String = "3.3.0.4852";
}
}//package mx.core
Section 5
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 6
//IFlexDisplayObject (mx.core.IFlexDisplayObject)
package mx.core {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.accessibility.*;
public interface IFlexDisplayObject extends IBitmapDrawable, IEventDispatcher {
function get visible():Boolean;
function get rotation():Number;
function localToGlobal(_arg1:Point):Point;
function get name():String;
function set width(_arg1:Number):void;
function get measuredHeight():Number;
function get blendMode():String;
function get scale9Grid():Rectangle;
function set name(_arg1:String):void;
function set scaleX(_arg1:Number):void;
function set scaleY(_arg1:Number):void;
function get measuredWidth():Number;
function get accessibilityProperties():AccessibilityProperties;
function set scrollRect(_arg1:Rectangle):void;
function get cacheAsBitmap():Boolean;
function globalToLocal(_arg1:Point):Point;
function get height():Number;
function set blendMode(_arg1:String):void;
function get parent():DisplayObjectContainer;
function getBounds(_arg1:DisplayObject):Rectangle;
function get opaqueBackground():Object;
function set scale9Grid(_arg1:Rectangle):void;
function setActualSize(_arg1:Number, _arg2:Number):void;
function set alpha(_arg1:Number):void;
function set accessibilityProperties(_arg1:AccessibilityProperties):void;
function get width():Number;
function hitTestPoint(_arg1:Number, _arg2:Number, _arg3:Boolean=false):Boolean;
function set cacheAsBitmap(_arg1:Boolean):void;
function get scaleX():Number;
function get scaleY():Number;
function get scrollRect():Rectangle;
function get mouseX():Number;
function get mouseY():Number;
function set height(_arg1:Number):void;
function set mask(_arg1:DisplayObject):void;
function getRect(_arg1:DisplayObject):Rectangle;
function get alpha():Number;
function set transform(_arg1:Transform):void;
function move(_arg1:Number, _arg2:Number):void;
function get loaderInfo():LoaderInfo;
function get root():DisplayObject;
function hitTestObject(_arg1:DisplayObject):Boolean;
function set opaqueBackground(_arg1:Object):void;
function set visible(_arg1:Boolean):void;
function get mask():DisplayObject;
function set x(_arg1:Number):void;
function set y(_arg1:Number):void;
function get transform():Transform;
function set filters(_arg1:Array):void;
function get x():Number;
function get y():Number;
function get filters():Array;
function set rotation(_arg1:Number):void;
function get stage():Stage;
}
}//package mx.core
Section 7
//IRepeaterClient (mx.core.IRepeaterClient)
package mx.core {
public interface IRepeaterClient {
function get instanceIndices():Array;
function set instanceIndices(_arg1:Array):void;
function get isDocument():Boolean;
function set repeaters(_arg1:Array):void;
function initializeRepeaterArrays(_arg1:IRepeaterClient):void;
function get repeaters():Array;
function set repeaterIndices(_arg1:Array):void;
function get repeaterIndices():Array;
}
}//package mx.core
Section 8
//mx_internal (mx.core.mx_internal)
package mx.core {
public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal";
}//package mx.core
Section 9
//SoundAsset (mx.core.SoundAsset)
package mx.core {
import flash.media.*;
public class SoundAsset extends Sound implements IFlexAsset {
mx_internal static const VERSION:String = "3.3.0.4852";
}
}//package mx.core
Section 10
//NameUtil (mx.utils.NameUtil)
package mx.utils {
import flash.display.*;
import mx.core.*;
import flash.utils.*;
public class NameUtil {
mx_internal static const VERSION:String = "3.3.0.4852";
private static var counter:int = 0;
public static function displayObjectToString(_arg1:DisplayObject):String{
var result:String;
var o:DisplayObject;
var s:String;
var indices:Array;
var displayObject = _arg1;
try {
o = displayObject;
while (o != null) {
if (((((o.parent) && (o.stage))) && ((o.parent == o.stage)))){
break;
};
s = o.name;
if ((o is IRepeaterClient)){
indices = IRepeaterClient(o).instanceIndices;
if (indices){
s = (s + (("[" + indices.join("][")) + "]"));
};
};
result = ((result == null)) ? s : ((s + ".") + result);
o = o.parent;
};
} catch(e:SecurityError) {
};
return (result);
}
public static function createUniqueName(_arg1:Object):String{
if (!_arg1){
return (null);
};
var _local2:String = getQualifiedClassName(_arg1);
var _local3:int = _local2.indexOf("::");
if (_local3 != -1){
_local2 = _local2.substr((_local3 + 2));
};
var _local4:int = _local2.charCodeAt((_local2.length - 1));
if ((((_local4 >= 48)) && ((_local4 <= 57)))){
_local2 = (_local2 + "_");
};
return ((_local2 + counter++));
}
}
}//package mx.utils
Section 11
//FlxAnim (org.flixel.data.FlxAnim)
package org.flixel.data {
public class FlxAnim {
public var delay:Number;
public var frames:Array;
public var looped:Boolean;
public var name:String;
public function FlxAnim(_arg1:String, _arg2:Array, _arg3:Number=0, _arg4:Boolean=true){
name = _arg1;
delay = (1 / _arg3);
frames = _arg2;
looped = _arg4;
}
}
}//package org.flixel.data
Section 12
//FlxConsole (org.flixel.data.FlxConsole)
package org.flixel.data {
import org.flixel.*;
import flash.display.*;
import flash.text.*;
public class FlxConsole extends Sprite {
protected const MAX_CONSOLE_LINES:uint = 0x0100;
protected var _lines:Array;
protected var _text:TextField;
protected var _fpsUpdate:Boolean;
protected var _console:Sprite;
protected var _Y:Number;
protected var _curFPS:uint;
protected var _fps:Array;
protected var _bx:int;
protected var _by:int;
protected var _fpsDisplay:TextField;
protected var _YT:Number;
protected var _byt:int;
public function FlxConsole(_arg1:uint, _arg2:uint, _arg3:uint){
visible = false;
x = (_arg1 * _arg3);
_by = (_arg2 * _arg3);
_byt = (_by - (FlxG.height * _arg3));
_YT = (_Y = (y = _byt));
var _local4:Bitmap = new Bitmap(new BitmapData((FlxG.width * _arg3), (FlxG.height * _arg3), true, 2130706432));
addChild(_local4);
_fps = new Array(8);
_curFPS = 0;
_fpsUpdate = true;
_text = new TextField();
_text.width = _local4.width;
_text.height = _local4.height;
_text.multiline = true;
_text.wordWrap = true;
_text.embedFonts = true;
_text.antiAliasType = AntiAliasType.NORMAL;
_text.gridFitType = GridFitType.PIXEL;
_text.defaultTextFormat = new TextFormat("system", 8, 0xFFFFFF);
addChild(_text);
_fpsDisplay = new TextField();
_fpsDisplay.width = _local4.width;
_fpsDisplay.height = 20;
_fpsDisplay.multiline = true;
_fpsDisplay.wordWrap = true;
_fpsDisplay.embedFonts = true;
_fpsDisplay.antiAliasType = AntiAliasType.NORMAL;
_fpsDisplay.gridFitType = GridFitType.PIXEL;
_fpsDisplay.defaultTextFormat = new TextFormat("system", 16, 0xFFFFFF, true, null, null, null, null, "right");
addChild(_fpsDisplay);
_lines = new Array();
}
public function log(_arg1:String):void{
var _local2:String;
var _local3:uint;
if (_arg1 == null){
_arg1 = "NULL";
};
trace(_arg1);
_lines.push(_arg1);
if (_lines.length > MAX_CONSOLE_LINES){
_lines.shift();
_local2 = "";
_local3 = 0;
while (_local3 < _lines.length) {
_local2 = (_local2 + (_lines[_local3] + "\n"));
_local3++;
};
_text.text = _local2;
} else {
_text.appendText((_arg1 + "\n"));
};
_text.scrollV = _text.height;
}
public function update():void{
var _local1:uint;
var _local2:uint;
if (visible){
_fps[_curFPS] = (1 / FlxG.elapsed);
if (++_curFPS >= _fps.length){
_curFPS = 0;
};
_fpsUpdate = !(_fpsUpdate);
if (_fpsUpdate){
_local1 = 0;
_local2 = 0;
while (_local2 < _fps.length) {
_local1 = (_local1 + _fps[_local2]);
_local2++;
};
_fpsDisplay.text = (Math.floor((_local1 / _fps.length)) + " fps");
};
};
if (_Y < _YT){
_Y = (_Y + ((FlxG.height * 10) * FlxG.elapsed));
} else {
if (_Y > _YT){
_Y = (_Y - ((FlxG.height * 10) * FlxG.elapsed));
};
};
if (_Y > _by){
_Y = _by;
} else {
if (_Y < _byt){
_Y = _byt;
visible = false;
};
};
y = Math.floor(_Y);
}
public function toggle():void{
if (_YT == _by){
_YT = _byt;
} else {
_YT = _by;
visible = true;
};
}
}
}//package org.flixel.data
Section 13
//FlxFade (org.flixel.data.FlxFade)
package org.flixel.data {
import org.flixel.*;
public class FlxFade extends FlxSprite {
protected var _delay:Number;
protected var _helper:Number;
protected var _complete:Function;
public function FlxFade(){
super(null, 0, 0, false, false, FlxG.width, FlxG.height, 0, true);
scrollFactor.x = 0;
scrollFactor.y = 0;
visible = false;
}
public function restart(_arg1:uint=0, _arg2:Number=1, _arg3:Function=null, _arg4:Boolean=false):void{
if (_arg2 == 0){
visible = false;
return;
};
if (((!(_arg4)) && (visible))){
return;
};
draw(new FlxSprite(null, 0, 0, false, false, width, height, _arg1), 0, 0);
_delay = _arg2;
_complete = _arg3;
_helper = 0;
alpha = 0;
visible = true;
}
override public function update():void{
if (((visible) && (!((alpha == 1))))){
_helper = (_helper + (FlxG.elapsed / _delay));
alpha = _helper;
if (alpha >= 1){
alpha = 1;
if (_complete != null){
_complete();
};
};
};
}
}
}//package org.flixel.data
Section 14
//FlxFlash (org.flixel.data.FlxFlash)
package org.flixel.data {
import org.flixel.*;
public class FlxFlash extends FlxSprite {
protected var _delay:Number;
protected var _helper:Number;
protected var _complete:Function;
public function FlxFlash(){
super(null, 0, 0, false, false, FlxG.width, FlxG.height, 0, true);
scrollFactor.x = 0;
scrollFactor.y = 0;
visible = false;
}
public function restart(_arg1:uint=4294967295, _arg2:Number=1, _arg3:Function=null, _arg4:Boolean=false):void{
if (_arg2 == 0){
visible = false;
return;
};
if (((!(_arg4)) && (visible))){
return;
};
draw(new FlxSprite(null, 0, 0, false, false, width, height, _arg1), 0, 0);
_delay = _arg2;
_complete = _arg3;
_helper = 1;
alpha = 1;
visible = true;
}
override public function update():void{
if (visible){
_helper = (_helper - (FlxG.elapsed / _delay));
alpha = _helper;
if (alpha <= 0){
visible = false;
if (_complete != null){
_complete();
};
};
};
}
}
}//package org.flixel.data
Section 15
//FlxKeyboard (org.flixel.data.FlxKeyboard)
package org.flixel.data {
import flash.events.*;
public class FlxKeyboard {
protected const _t:uint = 0x0100;
public var RIGHT:Boolean;
public var LEFT:Boolean;
public var FOUR:Boolean;
public var TWO:Boolean;
public var CONTROL:Boolean;
public var A:Boolean;
public var B:Boolean;
public var C:Boolean;
public var D:Boolean;
public var E:Boolean;
public var ONE:Boolean;
public var G:Boolean;
public var H:Boolean;
public var I:Boolean;
public var J:Boolean;
public var K:Boolean;
public var F:Boolean;
public var N:Boolean;
public var O:Boolean;
public var Q:Boolean;
public var R:Boolean;
public var S:Boolean;
public var T:Boolean;
public var ESC:Boolean;
public var MINUS:Boolean;
public var Y:Boolean;
public var L:Boolean;
public var Z:Boolean;
public var QUOTE:Boolean;
public var V:Boolean;
public var X:Boolean;
public var P:Boolean;
public var SHIFT:Boolean;
public var SLASH:Boolean;
public var U:Boolean;
public var EIGHT:Boolean;
public var W:Boolean;
public var M:Boolean;
public var THREE:Boolean;
public var SEMICOLON:Boolean;
public var CAPSLOCK:Boolean;
protected var _lookup:Object;
public var PLUS:Boolean;
protected var _map:Array;
public var ZERO:Boolean;
public var DOWN:Boolean;
public var F1:Boolean;
public var F2:Boolean;
public var F3:Boolean;
public var F4:Boolean;
public var F5:Boolean;
public var F6:Boolean;
public var F7:Boolean;
public var NINE:Boolean;
public var F9:Boolean;
public var ALT:Boolean;
public var F8:Boolean;
public var DELETE:Boolean;
public var LBRACKET:Boolean;
public var UP:Boolean;
public var ENTER:Boolean;
public var FIVE:Boolean;
public var SIX:Boolean;
public var COMMA:Boolean;
public var PERIOD:Boolean;
public var BACKSLASH:Boolean;
public var F10:Boolean;
public var F11:Boolean;
public var F12:Boolean;
public var SEVEN:Boolean;
public var SPACE:Boolean;
public var RBRACKET:Boolean;
public function FlxKeyboard(){
var _local1:uint;
_lookup = new Object();
_map = new Array(_t);
_local1 = 65;
while (_local1 <= 90) {
addKey(String.fromCharCode(_local1), _local1);
_local1++;
};
_local1 = 48;
var _temp1 = _local1;
_local1 = (_local1 + 1);
addKey("ZERO", _temp1);
var _temp2 = _local1;
_local1 = (_local1 + 1);
addKey("ONE", _temp2);
var _temp3 = _local1;
_local1 = (_local1 + 1);
addKey("TWO", _temp3);
var _temp4 = _local1;
_local1 = (_local1 + 1);
addKey("THREE", _temp4);
var _temp5 = _local1;
_local1 = (_local1 + 1);
addKey("FOUR", _temp5);
var _temp6 = _local1;
_local1 = (_local1 + 1);
addKey("FIVE", _temp6);
var _temp7 = _local1;
_local1 = (_local1 + 1);
addKey("SIX", _temp7);
var _temp8 = _local1;
_local1 = (_local1 + 1);
addKey("SEVEN", _temp8);
var _temp9 = _local1;
_local1 = (_local1 + 1);
addKey("EIGHT", _temp9);
var _temp10 = _local1;
_local1 = (_local1 + 1);
addKey("NINE", _temp10);
_local1 = 1;
while (_local1 <= 12) {
addKey(("F" + _local1), (111 + _local1));
_local1++;
};
addKey("ESC", 27);
addKey("MINUS", 189);
addKey("PLUS", 187);
addKey("DELETE", 8);
addKey("LBRACKET", 219);
addKey("RBRACKET", 221);
addKey("BACKSLASH", 220);
addKey("CAPSLOCK", 20);
addKey("SEMICOLON", 186);
addKey("QUOTE", 222);
addKey("ENTER", 13);
addKey("SHIFT", 16);
addKey("COMMA", 188);
addKey("PERIOD", 190);
addKey("SLASH", 191);
addKey("CONTROL", 17);
addKey("ALT", 18);
addKey("SPACE", 32);
addKey("UP", 38);
addKey("DOWN", 40);
addKey("LEFT", 37);
addKey("RIGHT", 39);
}
public function handleKeyUp(_arg1:KeyboardEvent):void{
var _local2:Object = _map[_arg1.keyCode];
if (_local2 == null){
return;
};
if (_local2.current > 0){
_local2.current = -1;
} else {
_local2.current = 0;
};
this[_local2.name] = false;
}
public function pressed(_arg1:String):Boolean{
return (this[_arg1]);
}
public function justReleased(_arg1:String):Boolean{
return ((_map[_lookup[_arg1]].current == -1));
}
public function handleKeyDown(_arg1:KeyboardEvent):void{
var _local2:Object = _map[_arg1.keyCode];
if (_local2 == null){
return;
};
if (_local2.current > 0){
_local2.current = 1;
} else {
_local2.current = 2;
};
this[_local2.name] = true;
}
public function reset():void{
var _local2:Object;
var _local1:uint;
while (_local1 < _t) {
if (_map[_local1] == null){
} else {
_local2 = _map[_local1];
this[_local2.name] = false;
_local2.current = 0;
_local2.last = 0;
};
_local1++;
};
}
public function justPressed(_arg1:String):Boolean{
return ((_map[_lookup[_arg1]].current == 2));
}
public function update():void{
var _local2:Object;
var _local1:uint;
while (_local1 < _t) {
if (_map[_local1] == null){
} else {
_local2 = _map[_local1];
if ((((_local2.last == -1)) && ((_local2.current == -1)))){
_local2.current = 0;
} else {
if ((((_local2.last == 2)) && ((_local2.current == 2)))){
_local2.current = 1;
};
};
_local2.last = _local2.current;
};
_local1++;
};
}
protected function addKey(_arg1:String, _arg2:uint):void{
_lookup[_arg1] = _arg2;
_map[_arg2] = {name:_arg1, current:0, last:0};
}
}
}//package org.flixel.data
Section 16
//FlxKong (org.flixel.data.FlxKong)
package org.flixel.data {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class FlxKong extends Sprite {
public var API;
public function init():void{
var _local1:Object = LoaderInfo(root.loaderInfo).parameters;
var _local2:String = ((_local1.api_path) || ("http://www.kongregate.com/flash/API_AS3_Local.swf"));
var _local3:URLRequest = new URLRequest(_local2);
var _local4:Loader = new Loader();
_local4.contentLoaderInfo.addEventListener(Event.COMPLETE, APILoaded);
_local4.load(_local3);
this.addChild(_local4);
}
private function APILoaded(_arg1:Event):void{
API = _arg1.target.content;
API.services.connect();
}
}
}//package org.flixel.data
Section 17
//FlxLogoPixel (org.flixel.data.FlxLogoPixel)
package org.flixel.data {
import flash.display.*;
public class FlxLogoPixel extends Sprite {
private var _curLayer:uint;
private var _layers:Array;
public function FlxLogoPixel(_arg1:int, _arg2:int, _arg3:uint, _arg4:uint, _arg5:uint){
x = _arg1;
y = _arg2;
_layers = new Array();
var _local6:Array = new Array(4294901760, 4278255360, 4278190335, 4294967040, 4278255615);
_layers.push(addChild(new Bitmap(new BitmapData(_arg3, _arg3, true, _arg5))));
var _local7:uint;
while (_local7 < _local6.length) {
_layers.push(addChild(new Bitmap(new BitmapData(_arg3, _arg3, true, _local6[_arg4]))));
++_arg4;
if (_arg4 >= _local6.length){
_arg4 = 0;
};
_local7++;
};
_curLayer = (_layers.length - 1);
}
public function update():void{
if (_curLayer == 0){
return;
};
if (_layers[_curLayer].alpha >= 0.1){
_layers[_curLayer].alpha = (_layers[_curLayer].alpha - 0.1);
} else {
_layers[_curLayer].alpha = 0;
_curLayer--;
};
}
}
}//package org.flixel.data
Section 18
//FlxMouse (org.flixel.data.FlxMouse)
package org.flixel.data {
import flash.events.*;
public class FlxMouse {
protected var _last:int;
public var x:int;
public var y:int;
protected var _current:int;
public function FlxMouse(){
x = 0;
y = 0;
_current = 0;
_last = 0;
}
public function justReleased():Boolean{
return ((_current == -1));
}
public function pressed():Boolean{
return ((_current > 0));
}
public function handleMouseUp(_arg1:MouseEvent):void{
if (_current > 0){
_current = -1;
} else {
_current = 0;
};
}
public function update(_arg1:int, _arg2:int):void{
x = _arg1;
y = _arg2;
if ((((_last == -1)) && ((_current == -1)))){
_current = 0;
} else {
if ((((_last == 2)) && ((_last == 2)))){
_current = 1;
};
};
_last = _current;
}
public function reset():void{
_current = 0;
_last = 0;
}
public function justPressed():Boolean{
return ((_current == 2));
}
public function handleMouseDown(_arg1:MouseEvent):void{
if (_current > 0){
_current = 1;
} else {
_current = 2;
};
}
}
}//package org.flixel.data
Section 19
//FlxPanel (org.flixel.data.FlxPanel)
package org.flixel.data {
import org.flixel.*;
import flash.ui.*;
public class FlxPanel extends FlxCore {
private var _close:FlxButton;
private var _digg:FlxButton;
private var _gameTitle:String;
private var _closed:Boolean;
private var _payPalID:String;
private var _donate:FlxButton;
private var ImgClose:Class;
private var _topBar:FlxSprite;
private var _ty:Number;
private var _caption:FlxText;
private var _initialized:Boolean;
private var _twitter:FlxButton;
private var _delicious:FlxButton;
private var _stumble:FlxButton;
private var ImgDelicious:Class;
private var ImgTwitter:Class;
private var _mainBar:FlxSprite;
private var _gameURL:String;
private var ImgStumble:Class;
private var ImgReddit:Class;
private var ImgDigg:Class;
private var _bottomBar:FlxSprite;
private var _payPalAmount:Number;
private var _s:Number;
private var ImgDonate:Class;
private var _reddit:FlxButton;
public function FlxPanel(){
ImgDonate = FlxPanel_ImgDonate;
ImgStumble = FlxPanel_ImgStumble;
ImgDigg = FlxPanel_ImgDigg;
ImgReddit = FlxPanel_ImgReddit;
ImgDelicious = FlxPanel_ImgDelicious;
ImgTwitter = FlxPanel_ImgTwitter;
ImgClose = FlxPanel_ImgClose;
super();
y = -21;
_ty = y;
_closed = false;
_initialized = false;
_topBar = new FlxSprite(null, 0, 0, false, false, FlxG.width, 1, 2147483647);
_topBar.scrollFactor.x = 0;
_topBar.scrollFactor.y = 0;
_mainBar = new FlxSprite(null, 0, 0, false, false, FlxG.width, 19, 2130706432);
_mainBar.scrollFactor.x = 0;
_mainBar.scrollFactor.y = 0;
_bottomBar = new FlxSprite(null, 0, 0, false, false, FlxG.width, 1, 2147483647);
_bottomBar.scrollFactor.x = 0;
_bottomBar.scrollFactor.y = 0;
_donate = new FlxButton(3, 0, new FlxSprite(ImgDonate), onDonate);
_donate.scrollFactor.x = 0;
_donate.scrollFactor.y = 0;
_stumble = new FlxButton(((((((FlxG.width / 2) - 6) - 13) - 6) - 13) - 6), 0, new FlxSprite(ImgStumble), onStumble);
_stumble.scrollFactor.x = 0;
_stumble.scrollFactor.y = 0;
_digg = new FlxButton(((((FlxG.width / 2) - 6) - 13) - 6), 0, new FlxSprite(ImgDigg), onDigg);
_digg.scrollFactor.x = 0;
_digg.scrollFactor.y = 0;
_reddit = new FlxButton(((FlxG.width / 2) - 6), 0, new FlxSprite(ImgReddit), onReddit);
_reddit.scrollFactor.x = 0;
_reddit.scrollFactor.y = 0;
_delicious = new FlxButton((((FlxG.width / 2) + 7) + 6), 0, new FlxSprite(ImgDelicious), onDelicious);
_delicious.scrollFactor.x = 0;
_delicious.scrollFactor.y = 0;
_twitter = new FlxButton((((((FlxG.width / 2) + 7) + 6) + 12) + 6), 0, new FlxSprite(ImgTwitter), onTwitter);
_twitter.scrollFactor.x = 0;
_twitter.scrollFactor.y = 0;
_caption = new FlxText((FlxG.width / 2), 0, ((FlxG.width / 2) - 19), "", 0xFFFFFF, null, 8, "right");
_caption.scrollFactor.x = 0;
_caption.scrollFactor.y = 0;
_close = new FlxButton((FlxG.width - 16), 0, new FlxSprite(ImgClose), onClose);
_close.scrollFactor.x = 0;
_close.scrollFactor.y = 0;
hide();
_s = 50;
}
public function onDelicious():void{
FlxG.openURL(((("http://delicious.com/save?v=5&noui&jump=close&url=" + encodeURIComponent(_gameURL)) + "&title=") + encodeURIComponent(_gameTitle)));
}
public function init(_arg1:String, _arg2:Number, _arg3:String, _arg4:String, _arg5:String):void{
_payPalID = _arg1;
if (_payPalID.length <= 0){
_donate.visible = false;
};
_payPalAmount = _arg2;
_gameTitle = _arg3;
_gameURL = _arg4;
_caption.text = _arg5;
_initialized = true;
}
public function onTwitter():void{
FlxG.openURL(("http://twitter.com/home?status=Playing" + encodeURIComponent((((" " + _gameTitle) + " - ") + _gameURL))));
}
public function show(_arg1:Boolean=true):void{
if (!_initialized){
FlxG.log("SUPPORT PANEL ERROR: Uninitialized.\nYou forgot to call FlxGame.setupSupportPanel()\nfrom your game constructor.");
return;
};
if (_closed){
return;
};
if (_arg1){
y = -21;
_ty = -1;
} else {
y = FlxG.height;
_ty = (FlxG.height - 20);
};
Mouse.show();
visible = true;
}
public function onStumble():void{
FlxG.openURL(("http://www.stumbleupon.com/submit?url=" + encodeURIComponent(_gameURL)));
}
override public function render():void{
if (!_initialized){
return;
};
if (_topBar.visible){
_topBar.render();
};
if (_mainBar.visible){
_mainBar.render();
};
if (_bottomBar.visible){
_bottomBar.render();
};
if (_donate.visible){
_donate.render();
};
if (_stumble.visible){
_stumble.render();
};
if (_digg.visible){
_digg.render();
};
if (_reddit.visible){
_reddit.render();
};
if (_delicious.visible){
_delicious.render();
};
if (_twitter.visible){
_twitter.render();
};
if (_caption.visible){
_caption.render();
};
if (_close.visible){
_close.render();
};
}
public function onDigg():void{
FlxG.openURL(((("http://digg.com/submit?url=" + encodeURIComponent(_gameURL)) + "&title=") + encodeURIComponent(_gameTitle)));
}
public function onReddit():void{
FlxG.openURL(("http://www.reddit.com/submit?url=" + encodeURIComponent(_gameURL)));
}
public function onDonate():void{
FlxG.openURL(((((("https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=" + encodeURIComponent(_payPalID)) + "&item_name=") + encodeURIComponent(((_gameTitle + " Contribution (") + _gameURL))) + ")¤cy_code=USD&amount=") + _payPalAmount));
}
override public function update():void{
if (!_initialized){
return;
};
if (_ty != y){
if (y < _ty){
y = (y + (FlxG.elapsed * _s));
if (y > _ty){
y = _ty;
};
} else {
y = (y - (FlxG.elapsed * _s));
if (y < _ty){
y = _ty;
};
};
};
if ((((y <= -21)) || ((y > FlxG.height)))){
visible = false;
};
_topBar.y = y;
_mainBar.y = (y + 1);
_bottomBar.y = (y + 20);
_donate.y = (y + 4);
_stumble.y = (y + 4);
_digg.y = (y + 4);
_reddit.y = (y + 4);
_delicious.y = (y + 5);
_twitter.y = (y + 4);
_caption.y = (y + 4);
_close.y = (y + 4);
if (_donate.active){
_donate.update();
};
if (_stumble.active){
_stumble.update();
};
if (_digg.active){
_digg.update();
};
if (_reddit.active){
_reddit.update();
};
if (_delicious.active){
_delicious.update();
};
if (_twitter.active){
_twitter.update();
};
if (_caption.active){
_caption.update();
};
if (_close.active){
_close.update();
};
}
public function hide():void{
if (y < 0){
_ty = -21;
} else {
_ty = FlxG.height;
};
Mouse.hide();
visible = false;
}
public function onClose():void{
_closed = true;
hide();
}
}
}//package org.flixel.data
Section 20
//FlxPanel_ImgClose (org.flixel.data.FlxPanel_ImgClose)
package org.flixel.data {
import mx.core.*;
public class FlxPanel_ImgClose extends BitmapAsset {
}
}//package org.flixel.data
Section 21
//FlxPanel_ImgDelicious (org.flixel.data.FlxPanel_ImgDelicious)
package org.flixel.data {
import mx.core.*;
public class FlxPanel_ImgDelicious extends BitmapAsset {
}
}//package org.flixel.data
Section 22
//FlxPanel_ImgDigg (org.flixel.data.FlxPanel_ImgDigg)
package org.flixel.data {
import mx.core.*;
public class FlxPanel_ImgDigg extends BitmapAsset {
}
}//package org.flixel.data
Section 23
//FlxPanel_ImgDonate (org.flixel.data.FlxPanel_ImgDonate)
package org.flixel.data {
import mx.core.*;
public class FlxPanel_ImgDonate extends BitmapAsset {
}
}//package org.flixel.data
Section 24
//FlxPanel_ImgReddit (org.flixel.data.FlxPanel_ImgReddit)
package org.flixel.data {
import mx.core.*;
public class FlxPanel_ImgReddit extends BitmapAsset {
}
}//package org.flixel.data
Section 25
//FlxPanel_ImgStumble (org.flixel.data.FlxPanel_ImgStumble)
package org.flixel.data {
import mx.core.*;
public class FlxPanel_ImgStumble extends BitmapAsset {
}
}//package org.flixel.data
Section 26
//FlxPanel_ImgTwitter (org.flixel.data.FlxPanel_ImgTwitter)
package org.flixel.data {
import mx.core.*;
public class FlxPanel_ImgTwitter extends BitmapAsset {
}
}//package org.flixel.data
Section 27
//FlxPause (org.flixel.data.FlxPause)
package org.flixel.data {
import flash.display.*;
import flash.text.*;
public class FlxPause extends Sprite {
private var InstrPic:Class;
public function FlxPause(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:Array){
var _local5:uint;
var _local7:Bitmap;
InstrPic = FlxPause_InstrPic;
super();
visible = false;
_local5 = 640;
var _local6:uint = 480;
addChild(new Bitmap(new BitmapData(640, 480, true, 4278190080)));
x = 0;
y = 0;
_local7 = (addChild(new InstrPic()) as Bitmap);
_local7.x = 4;
_local7.y = 4;
var _local8:TextField = new TextField();
_local8.width = _local5;
_local8.height = 20;
_local8.multiline = true;
_local8.wordWrap = true;
_local8.selectable = false;
_local8.embedFonts = true;
_local8.antiAliasType = AntiAliasType.NORMAL;
_local8.gridFitType = GridFitType.PIXEL;
_local8.defaultTextFormat = new TextFormat("system", 16, 0xFFFFFF, null, null, null, null, null, "center");
_local8.text = "[Click or P to resume]";
_local8.y = 460;
addChild(_local8);
}
}
}//package org.flixel.data
Section 28
//FlxPause_InstrPic (org.flixel.data.FlxPause_InstrPic)
package org.flixel.data {
import mx.core.*;
public class FlxPause_InstrPic extends BitmapAsset {
}
}//package org.flixel.data
Section 29
//FlxQuake (org.flixel.data.FlxQuake)
package org.flixel.data {
import org.flixel.*;
public class FlxQuake {
public var y:int;
protected var _length:Number;
protected var _timer:Number;
protected var _intensity:Number;
public var x:int;
protected var _zoom:uint;
public function FlxQuake(_arg1:uint){
_zoom = _arg1;
reset(0);
}
public function update():void{
if (_timer > 0){
_timer = (_timer + FlxG.elapsed);
if (_timer > _length){
_timer = 0;
x = 0;
y = 0;
} else {
x = (((((Math.random() * _intensity) * FlxG.width) * 2) - (_intensity * FlxG.width)) * _zoom);
y = (((((Math.random() * _intensity) * FlxG.height) * 2) - (_intensity * FlxG.height)) * _zoom);
};
};
}
public function reset(_arg1:Number, _arg2:Number=0.5):void{
x = 0;
y = 0;
_intensity = _arg1;
if (_intensity == 0){
_length = 0;
_timer = 0;
return;
};
_length = _arg2;
_timer = 0.01;
}
}
}//package org.flixel.data
Section 30
//FlxButton (org.flixel.FlxButton)
package org.flixel {
import flash.events.*;
import flash.geom.*;
public class FlxButton extends FlxCore {
protected var _onTO:Point;
protected var _initialized:Boolean;
protected var _pressed:Boolean;
protected var _onT:FlxText;
protected var _callback:Function;
protected var _off:FlxSprite;
protected var _onToggle:Boolean;
protected var _offTO:Point;
protected var _offT:FlxText;
protected var _on:FlxSprite;
public function FlxButton(_arg1:int, _arg2:int, _arg3:FlxSprite, _arg4:Function, _arg5:FlxSprite=null, _arg6:FlxText=null, _arg7:FlxText=null){
x = _arg1;
y = _arg2;
_off = _arg3;
if (_arg5 == null){
_on = _off;
} else {
_on = _arg5;
};
width = _off.width;
height = _off.height;
if (_arg6 != null){
_offT = _arg6;
};
if (_arg7 == null){
_onT = _offT;
} else {
_onT = _arg7;
};
if (_offT != null){
_offTO = new Point(_offT.x, _offT.y);
};
if (_onT != null){
_onTO = new Point(_onT.x, _onT.y);
};
_off.scrollFactor = scrollFactor;
_on.scrollFactor = scrollFactor;
if (_offT != null){
_offT.scrollFactor = scrollFactor;
_onT.scrollFactor = scrollFactor;
};
_callback = _arg4;
_onToggle = false;
_pressed = false;
updatePositions();
_initialized = false;
}
override public function destroy():void{
FlxG.state.parent.stage.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
}
override public function update():void{
if (!_initialized){
if (FlxG.state == null){
return;
};
if (FlxG.state.parent == null){
return;
};
if (FlxG.state.parent.stage == null){
return;
};
FlxG.state.parent.stage.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
_initialized = true;
};
super.update();
if (((((!((_off == null))) && (_off.exists))) && (_off.active))){
_off.update();
};
if (((((!((_on == null))) && (_on.exists))) && (_on.active))){
_on.update();
};
if (_offT != null){
if (((((!((_offT == null))) && (_offT.exists))) && (_offT.active))){
_offT.update();
};
if (((((!((_onT == null))) && (_onT.exists))) && (_onT.active))){
_onT.update();
};
};
visibility(false);
if (_off.overlapsPoint(FlxG.mouse.x, FlxG.mouse.y)){
if (!FlxG.mouse.pressed()){
_pressed = false;
} else {
if (!_pressed){
_pressed = true;
if (!_initialized){
_callback();
};
};
};
visibility(!(_pressed));
};
if (_onToggle){
visibility(_off.visible);
};
updatePositions();
}
private function onMouseUp(_arg1:MouseEvent):void{
if (((!(exists)) || (!(visible)))){
return;
};
if (_off.overlapsPoint((FlxG.mouse.x + ((1 - scrollFactor.x) * FlxG.scroll.x)), (FlxG.mouse.y + ((1 - scrollFactor.y) * FlxG.scroll.y)))){
_callback();
};
}
private function visibility(_arg1:Boolean):void{
if (_arg1){
_off.visible = false;
if (_offT != null){
_offT.visible = false;
};
_on.visible = true;
if (_onT != null){
_onT.visible = true;
};
} else {
_on.visible = false;
if (_onT != null){
_onT.visible = false;
};
_off.visible = true;
if (_offT != null){
_offT.visible = true;
};
};
}
override public function render():void{
super.render();
if (((((!((_off == null))) && (_off.exists))) && (_off.visible))){
_off.render();
};
if (((((!((_on == null))) && (_on.exists))) && (_on.visible))){
_on.render();
};
if (_offT != null){
if (((((!((_offT == null))) && (_offT.exists))) && (_offT.visible))){
_offT.render();
};
if (((((!((_onT == null))) && (_onT.exists))) && (_onT.visible))){
_onT.render();
};
};
}
public function switchOff():void{
_onToggle = false;
}
public function on():Boolean{
return (_onToggle);
}
private function updatePositions():void{
_off.x = x;
_off.y = y;
if (_offT){
_offT.x = (_offTO.x + x);
_offT.y = (_offTO.y + y);
};
_on.x = x;
_on.y = y;
if (_onT){
_onT.x = (_onTO.x + x);
_onT.y = (_onTO.y + y);
};
}
public function switchOn():void{
_onToggle = true;
}
}
}//package org.flixel
Section 31
//FlxCore (org.flixel.FlxCore)
package org.flixel {
import flash.geom.*;
public class FlxCore {
public var y:Number;
public var active:Boolean;
public var x:Number;
public var visible:Boolean;
protected var _flickerTimer:Number;
public var width:uint;
public var last:Point;
public var exists:Boolean;
public var height:uint;
public var dead:Boolean;
public var fixed:Boolean;
protected var _flicker:Boolean;
public var scrollFactor:Point;
public function FlxCore(){
exists = true;
active = true;
visible = true;
dead = false;
fixed = false;
width = 0;
height = 0;
x = 0;
y = 0;
last = new Point(x, y);
scrollFactor = new Point(1, 1);
_flicker = false;
_flickerTimer = -1;
}
public function onScreen():Boolean{
var _local1:Point = new Point();
getScreenXY(_local1);
if (((((((((_local1.x + width) < 0)) || ((_local1.x > FlxG.width)))) || (((_local1.y + height) < 0)))) || ((_local1.y > FlxG.height)))){
return (false);
};
return (true);
}
public function hitWall(_arg1:FlxCore=null):Boolean{
return (true);
}
public function collideArrayY(_arg1:Array):void{
var _local2:FlxCore;
if (((!(exists)) || (dead))){
return;
};
var _local3:uint = _arg1.length;
var _local4:uint;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if ((((((((_local2 === this)) || ((_local2 == null)))) || (!(_local2.exists)))) || (_local2.dead))){
} else {
collideY(_local2);
};
_local4++;
};
}
public function update():void{
last.x = x;
last.y = y;
if (flickering()){
if (_flickerTimer > 0){
_flickerTimer = (_flickerTimer - FlxG.elapsed);
if (_flickerTimer == 0){
_flickerTimer = -1;
};
};
if (_flickerTimer < 0){
flicker(-1);
} else {
_flicker = !(_flicker);
visible = !(_flicker);
};
};
}
public function reset(_arg1:Number, _arg2:Number):void{
exists = true;
active = true;
visible = true;
dead = false;
last.x = (x = _arg1);
last.y = (y = _arg2);
}
public function flicker(_arg1:Number=1):void{
_flickerTimer = _arg1;
if (_flickerTimer < 0){
_flicker = false;
visible = true;
};
}
public function overlapsPoint(_arg1:Number, _arg2:Number, _arg3:Boolean=false):Boolean{
var _local4:Number = x;
var _local5:Number = y;
if (((!((scrollFactor.x == 1))) || (!((scrollFactor.y == 1))))){
_local4 = (_local4 - Math.floor((FlxG.scroll.x * scrollFactor.x)));
_local5 = (_local5 - Math.floor((FlxG.scroll.y * scrollFactor.y)));
};
if ((((((((_arg1 <= _local4)) || ((_arg1 >= (_local4 + width))))) || ((_arg2 <= _local5)))) || ((_arg2 >= (_local5 + height))))){
return (false);
};
return (true);
}
public function collideX(_arg1:FlxCore):Boolean{
var _local2:Number;
var _local3:Rectangle = new Rectangle();
var _local4:Rectangle = new Rectangle();
if (_arg1.x > _arg1.last.x){
_local4.x = _arg1.last.x;
_local4.width = ((_arg1.x - _arg1.last.x) + _arg1.width);
} else {
_local4.x = _arg1.x;
_local4.width = ((_arg1.last.x - _arg1.x) + _arg1.width);
};
_local4.y = _arg1.last.y;
_local4.height = _arg1.height;
if (x > last.x){
_local3.x = last.x;
_local3.width = ((x - last.x) + width);
} else {
_local3.x = x;
_local3.width = ((last.x - x) + width);
};
_local3.y = last.y;
_local3.height = height;
if (((((((((_local4.x + _local4.width) <= _local3.x)) || ((_local4.x >= (_local3.x + _local3.width))))) || (((_local4.y + _local4.height) <= _local3.y)))) || ((_local4.y >= (_local3.y + _local3.height))))){
return (false);
};
var _local5:Number = (_arg1.x - _arg1.last.x);
var _local6:Number = (x - last.x);
var _local7:Boolean = (((_arg1.x < (x + width))) && (((_arg1.x + _arg1.width) > x)));
if ((((((((_local5 > 0)) && ((_local6 <= 0)))) || ((((_local5 >= 0)) && ((((_local5 > _local6)) && (_local7))))))) || ((((_local5 <= 0)) && ((((-(_local5) < -(_local6))) && (_local7))))))){
if (((fixed) && (!(_arg1.fixed)))){
if (_arg1.hitWall(this)){
_arg1.x = (x - _arg1.width);
return (true);
};
} else {
if (((!(fixed)) && (_arg1.fixed))){
if (hitWall(_arg1)){
x = (_arg1.x + _arg1.width);
return (true);
};
} else {
if (((_arg1.hitWall(this)) && (hitWall(_arg1)))){
_local2 = ((_local4.right - _local3.left) / 2);
_arg1.x = (_arg1.x - _local2);
x = (x + _local2);
return (true);
};
};
};
} else {
if ((((((((_local5 < 0)) && ((_local6 >= 0)))) || ((((_local5 >= 0)) && ((((_local5 < _local6)) && (_local7))))))) || ((((_local5 <= 0)) && ((((-(_local5) > -(_local6))) && (_local7))))))){
if (_local4.left < _local3.right){
if (((fixed) && (!(_arg1.fixed)))){
if (_arg1.hitWall(this)){
_arg1.x = (x + width);
return (true);
};
} else {
if (((!(fixed)) && (_arg1.fixed))){
if (hitWall(_arg1)){
x = (_arg1.x - width);
return (true);
};
} else {
if (((_arg1.hitWall(this)) && (hitWall(_arg1)))){
_local2 = ((_local3.right - _local4.left) / 2);
_arg1.x = (_arg1.x + _local2);
x = (x - _local2);
return (true);
};
};
};
};
};
};
return (false);
}
public function render():void{
}
public function kill():void{
exists = false;
dead = true;
}
public function collideY(_arg1:FlxCore):Boolean{
var _local2:Number;
var _local3:Rectangle = new Rectangle();
var _local4:Rectangle = new Rectangle();
if (_arg1.y > _arg1.last.y){
_local4.y = _arg1.last.y;
_local4.height = ((_arg1.y - _arg1.last.y) + _arg1.height);
} else {
_local4.y = _arg1.y;
_local4.height = ((_arg1.last.y - _arg1.y) + _arg1.height);
};
_local4.x = _arg1.x;
_local4.width = _arg1.width;
if (y > last.y){
_local3.y = last.y;
_local3.height = ((y - last.y) + height);
} else {
_local3.y = y;
_local3.height = ((last.y - y) + height);
};
_local3.x = x;
_local3.width = width;
if (((((((((_local4.x + _local4.width) <= _local3.x)) || ((_local4.x >= (_local3.x + _local3.width))))) || (((_local4.y + _local4.height) <= _local3.y)))) || ((_local4.y >= (_local3.y + _local3.height))))){
return (false);
};
var _local5:Number = (_arg1.y - _arg1.last.y);
var _local6:Number = (y - last.y);
var _local7:Boolean = (((_arg1.y < (y + height))) && (((_arg1.y + _arg1.height) > y)));
if ((((((((_local5 > 0)) && ((_local6 <= 0)))) || ((((_local5 >= 0)) && ((((_local5 > _local6)) && (_local7))))))) || ((((_local5 <= 0)) && ((((-(_local5) < -(_local6))) && (_local7))))))){
if (_local4.bottom > _local3.top){
if (((fixed) && (!(_arg1.fixed)))){
if (_arg1.hitFloor(this)){
_arg1.y = (y - _arg1.height);
return (true);
};
} else {
if (((!(fixed)) && (_arg1.fixed))){
if (hitCeiling(_arg1)){
y = (_arg1.y + _arg1.height);
return (true);
};
} else {
if (((_arg1.hitFloor(this)) && (hitCeiling(_arg1)))){
_local2 = ((_local4.bottom - _local3.top) / 2);
_arg1.y = (_arg1.y - _local2);
y = (y + _local2);
return (true);
};
};
};
};
} else {
if ((((((((_local5 < 0)) && ((_local6 >= 0)))) || ((((_local5 >= 0)) && ((((_local5 < _local6)) && (_local7))))))) || ((((_local5 <= 0)) && ((((-(_local5) > -(_local6))) && (_local7))))))){
if (_local4.top < _local3.bottom){
if (((fixed) && (!(_arg1.fixed)))){
if (_arg1.hitCeiling(this)){
_arg1.y = (y + height);
return (true);
};
} else {
if (((!(fixed)) && (_arg1.fixed))){
if (hitFloor(_arg1)){
y = (_arg1.y - height);
return (true);
};
} else {
if (((_arg1.hitCeiling(this)) && (hitFloor(_arg1)))){
_local2 = ((_local3.bottom - _local4.top) / 2);
_arg1.y = (_arg1.y + _local2);
y = (y - _local2);
return (true);
};
};
};
};
};
};
return (false);
}
public function getScreenXY(_arg1:Point):void{
_arg1.x = (Math.floor(x) + Math.floor((FlxG.scroll.x * scrollFactor.x)));
_arg1.y = (Math.floor(y) + Math.floor((FlxG.scroll.y * scrollFactor.y)));
}
public function hitFloor(_arg1:FlxCore=null):Boolean{
return (true);
}
public function hitCeiling(_arg1:FlxCore=null):Boolean{
return (true);
}
public function overlaps(_arg1:FlxCore):Boolean{
var _local2:Number = x;
var _local3:Number = y;
if (((!((scrollFactor.x == 1))) || (!((scrollFactor.y == 1))))){
_local2 = (_local2 - Math.floor((FlxG.scroll.x * scrollFactor.x)));
_local3 = (_local3 - Math.floor((FlxG.scroll.y * scrollFactor.y)));
};
var _local4:Number = _arg1.x;
var _local5:Number = _arg1.y;
if (((!((_arg1.scrollFactor.x == 1))) || (!((_arg1.scrollFactor.y == 1))))){
_local4 = (_local4 - Math.floor((FlxG.scroll.x * _arg1.scrollFactor.x)));
_local5 = (_local5 - Math.floor((FlxG.scroll.y * _arg1.scrollFactor.y)));
};
if ((((((((_local4 <= (_local2 - _arg1.width))) || ((_local4 >= (_local2 + width))))) || ((_local5 <= (_local3 - _arg1.height))))) || ((_local5 >= (_local3 + height))))){
return (false);
};
return (true);
}
public function flickering():Boolean{
return ((_flickerTimer >= 0));
}
public function destroy():void{
}
public function collideArray(_arg1:Array):void{
var _local2:FlxCore;
if (((!(exists)) || (dead))){
return;
};
var _local3:uint = _arg1.length;
var _local4:uint;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if ((((((((_local2 === this)) || ((_local2 == null)))) || (!(_local2.exists)))) || (_local2.dead))){
} else {
collide(_local2);
};
_local4++;
};
}
public function collideArrayX(_arg1:Array):void{
var _local2:FlxCore;
if (((!(exists)) || (dead))){
return;
};
var _local3:uint = _arg1.length;
var _local4:uint;
while (_local4 < _local3) {
_local2 = _arg1[_local4];
if ((((((((_local2 === this)) || ((_local2 == null)))) || (!(_local2.exists)))) || (_local2.dead))){
} else {
collideX(_local2);
};
_local4++;
};
}
public function collide(_arg1:FlxCore):Boolean{
var _local2:Boolean = collideX(_arg1);
var _local3:Boolean = collideY(_arg1);
return (((_local2) || (_local3)));
}
}
}//package org.flixel
Section 32
//FlxEmitter (org.flixel.FlxEmitter)
package org.flixel {
import flash.geom.*;
public class FlxEmitter extends FlxCore {
public var maxVelocity:Point;
protected var _maxRotation:Number;
protected var _delay:Number;
protected var _sprites:Array;
protected var _gravity:Number;
protected var _minRotation:Number;
protected var _drag:Number;
protected var _particle:uint;
protected var _timer:Number;
public var minVelocity:Point;
public function FlxEmitter(_arg1:Number, _arg2:Number, _arg3:uint, _arg4:uint, _arg5:Array=null, _arg6:Number=-1, _arg7:Number=-100, _arg8:Number=100, _arg9:Number=-100, _arg10:Number=100, _arg11:Number=-360, _arg12:Number=360, _arg13:Number=500, _arg14:Number=0, _arg15:Class=null, _arg16:uint=0, _arg17:Boolean=false, _arg18:FlxLayer=null){
var _local19:uint;
var _local20:uint;
var _local21:FlxSprite;
super();
visible = false;
x = _arg1;
y = _arg2;
width = _arg3;
height = _arg4;
minVelocity = new Point(_arg7, _arg9);
maxVelocity = new Point(_arg8, _arg10);
_minRotation = _arg11;
_maxRotation = _arg12;
_gravity = _arg13;
_drag = _arg14;
_delay = _arg6;
if (_arg15 != null){
_sprites = new Array();
_local19 = 0;
while (_local19 < _arg16) {
if (_arg17){
_local21 = new FlxSprite(_arg15, 0, 0, true);
_local21.randomFrame();
_sprites.push(_local21);
} else {
_sprites.push(new FlxSprite(_arg15));
};
_local19++;
};
_local20 = _sprites.length;
_local19 = 0;
while (_local19 < _local20) {
if (_arg18 == null){
FlxG.state.add(_sprites[_local19]);
} else {
_arg18.add(_sprites[_local19]);
};
_local19++;
};
} else {
_sprites = _arg5;
};
kill();
if (_delay > 0){
restart();
};
}
public function emit():void{
var _local1:FlxSprite = _sprites[_particle];
_local1.reset(((x - (_local1.width >> 1)) + (FlxG.random() * width)), ((y - (_local1.height >> 1)) + (FlxG.random() * height)));
_local1.velocity.x = minVelocity.x;
if (minVelocity.x != maxVelocity.x){
_local1.velocity.x = (_local1.velocity.x + (FlxG.random() * (maxVelocity.x - minVelocity.x)));
};
_local1.velocity.y = minVelocity.y;
if (minVelocity.y != maxVelocity.y){
_local1.velocity.y = (_local1.velocity.y + (FlxG.random() * (maxVelocity.y - minVelocity.y)));
};
_local1.acceleration.y = _gravity;
_local1.angularVelocity = _minRotation;
if (_minRotation != _maxRotation){
_local1.angularVelocity = (_local1.angularVelocity + (FlxG.random() * (_maxRotation - _minRotation)));
};
if (_local1.angularVelocity != 0){
_local1.angle = ((FlxG.random() * 360) - 180);
};
_local1.drag.x = _drag;
_local1.drag.y = _drag;
_particle++;
if (_particle >= _sprites.length){
_particle = 0;
};
_local1.onEmit();
}
override public function update():void{
var _local1:uint;
var _local2:uint;
_timer = (_timer + FlxG.elapsed);
if (_delay < 0){
if (_timer > -(_delay)){
kill();
return;
};
if (_sprites[0].exists){
return;
};
_local1 = _sprites.length;
_local2 = 0;
while (_local2 < _local1) {
emit();
_local2++;
};
return;
};
while (_timer > _delay) {
_timer = (_timer - _delay);
emit();
};
}
override public function kill():void{
active = false;
var _local1:uint = _sprites.length;
var _local2:uint;
while (_local2 < _local1) {
_sprites[_local2].exists = false;
_local2++;
};
}
public function restart():void{
active = true;
_timer = 0;
_particle = 0;
}
}
}//package org.flixel
Section 33
//FlxG (org.flixel.FlxG)
package org.flixel {
import flash.geom.*;
import flash.display.*;
import org.flixel.data.*;
import flash.net.*;
public class FlxG {
private static var ImgDefaultCursor:Class = FlxG_ImgDefaultCursor;
public static var kong:FlxKong;
public static var scores:Array;
public static var music:FlxSound;
public static var height:uint;
protected static var _volume:Number;
public static var buffer:BitmapData;
public static var sounds:Array;
public static var pauseType:uint = 0;
protected static var _seed:Number;
public static var debug:Boolean;
public static var LIBRARY_MINOR_VERSION:uint = 37;
public static var LIBRARY_MAJOR_VERSION:uint = 1;
public static var levels:Array;
public static var elapsed:Number;
public static var save:int;
protected static var _cache:Object;
public static var level:int;
public static var state:FlxState;
public static var score:int;
public static var saves:Array;
protected static var _scrollTarget:Point;
public static var followTarget:FlxCore;
public static var mouse:FlxMouse;
public static var followLead:Point;
public static var LIBRARY_NAME:String = "flixel";
protected static var _originalSeed:Number;
public static var width:uint;
public static var followLerp:Number;
public static var scroll:Point;
public static var _game:FlxGame;
public static var followMin:Point;
public static var followMax:Point;
public static var keys:FlxKeyboard;
protected static var _pause:Boolean;
protected static var _mute:Boolean;
public static function changeBackgroundColor(_arg1:uint):void{
_game._bgColor = _arg1;
}
public static function flash(_arg1:uint, _arg2:Number=1, _arg3:Function=null, _arg4:Boolean=false):void{
_game._flash.restart(_arg1, _arg2, _arg3, _arg4);
}
public static function collideArrays(_arg1:Array, _arg2:Array):void{
var _local3:uint;
var _local4:uint;
var _local5:FlxCore;
var _local6:FlxCore;
var _local7:uint = _arg1.length;
var _local8:uint = _arg2.length;
if (_arg1 === _arg2){
_local3 = 0;
while (_local3 < _local7) {
_local5 = _arg1[_local3];
if ((((((_local5 == null)) || (!(_local5.exists)))) || (_local5.dead))){
} else {
_local4 = (_local3 + 1);
while (_local4 < _local8) {
_local6 = _arg2[_local4];
if ((((((_local6 == null)) || (!(_local6.exists)))) || (_local6.dead))){
} else {
_local5.collide(_local6);
};
_local4++;
};
};
_local3++;
};
} else {
_local3 = 0;
while (_local3 < _local7) {
_local5 = _arg1[_local3];
if ((((((_local5 == null)) || (!(_local5.exists)))) || (_local5.dead))){
} else {
_local4 = 0;
while (_local4 < _local8) {
_local6 = _arg2[_local4];
if ((((((((_local5 === _local6)) || ((_local6 == null)))) || (!(_local6.exists)))) || (_local6.dead))){
} else {
_local5.collide(_local6);
};
_local4++;
};
};
_local3++;
};
};
}
public static function get mute():Boolean{
return (_mute);
}
public static function get volume():Number{
return (_volume);
}
protected static function changeSounds():void{
if (((!((music == null))) && (music.active))){
music.updateTransform();
};
var _local1:uint = sounds.length;
var _local2:uint;
while (_local2 < _local1) {
if (sounds[_local2].active){
sounds[_local2].updateTransform();
};
_local2++;
};
}
static function doFollow():void{
if (followTarget != null){
if (((followTarget.exists) && (!(followTarget.dead)))){
_scrollTarget.x = (((width >> 1) - followTarget.x) - (followTarget.width >> 1));
_scrollTarget.y = (((height >> 1) - followTarget.y) - (followTarget.height >> 1));
if (((!((followLead == null))) && ((followTarget is FlxSprite)))){
_scrollTarget.x = (_scrollTarget.x - ((followTarget as FlxSprite).velocity.x * followLead.x));
_scrollTarget.y = (_scrollTarget.y - ((followTarget as FlxSprite).velocity.y * followLead.y));
};
};
scroll.x = (scroll.x + (((_scrollTarget.x - scroll.x) * followLerp) * FlxG.elapsed));
scroll.y = (scroll.y + (((_scrollTarget.y - scroll.y) * followLerp) * FlxG.elapsed));
if (followMin != null){
if (scroll.x > followMin.x){
scroll.x = followMin.x;
};
if (scroll.y > followMin.y){
scroll.y = followMin.y;
};
};
if (followMax != null){
if (scroll.x < followMax.x){
scroll.x = followMax.x;
};
if (scroll.y < followMax.y){
scroll.y = followMax.y;
};
};
};
}
public static function randRange(_arg1:Number, _arg2:Number, _arg3:Boolean=true):Number{
var _local4:Number;
if (_arg1 > _arg2){
_local4 = _arg1;
_arg1 = _arg2;
_arg2 = _arg1;
};
return ((_arg1 + (random() * (_arg2 - _arg1))));
}
public static function showSupportPanel(_arg1:Boolean=true):void{
_game._panel.show(_arg1);
}
public static function addBitmap(_arg1:Class, _arg2:Boolean=false):BitmapData{
var _local6:BitmapData;
var _local7:Matrix;
var _local3:Boolean;
var _local4:String = String(_arg1);
if ((((_cache[_local4] == undefined)) || ((_cache[_local4] == null)))){
_cache[_local4] = new (_arg1).bitmapData;
if (_arg2){
_local3 = true;
};
};
var _local5:BitmapData = _cache[_local4];
if (((((!(_local3)) && (_arg2))) && ((_local5.width == new (_arg1).bitmapData.width)))){
_local3 = true;
};
if (_local3){
_local6 = new BitmapData((_local5.width << 1), _local5.height, true, 0);
_local6.draw(_local5);
_local7 = new Matrix();
_local7.scale(-1, 1);
_local7.translate(_local6.width, 0);
_local6.draw(_local5, _local7);
_local5 = _local6;
};
return (_local5);
}
public static function getMuteValue():uint{
if (_mute){
return (0);
};
return (1);
}
public static function set mute(_arg1:Boolean):void{
_mute = _arg1;
changeSounds();
}
public static function play(_arg1:Class, _arg2:Number=1, _arg3:Boolean=false):FlxSound{
var _local4:uint;
var _local5:uint = sounds.length;
_local4 = 0;
while (_local4 < _local5) {
if (!sounds[_local4].active){
break;
};
_local4++;
};
if (sounds[_local4] == null){
sounds[_local4] = new FlxSound();
};
var _local6:FlxSound = sounds[_local4];
_local6.loadEmbedded(_arg1, _arg3);
_local6.volume = _arg2;
_local6.play();
return (_local6);
}
public static function getAngle(_arg1:Number, _arg2:Number):Number{
return (((Math.atan2(_arg2, _arg1) * 180) / Math.PI));
}
public static function hideCursor():void{
if (_game._cursor == null){
return;
};
_game._buffer.removeChild(_game._cursor);
_game._cursor = null;
}
public static function set volume(_arg1:Number):void{
_volume = _arg1;
if (_volume < 0){
_volume = 0;
} else {
if (_volume > 1){
_volume = 1;
};
};
changeSounds();
}
static function setGameData(_arg1:FlxGame, _arg2:uint, _arg3:uint):void{
_game = _arg1;
_cache = new Object();
width = _arg2;
height = _arg3;
_mute = false;
_volume = 0.5;
sounds = new Array();
mouse = new FlxMouse();
keys = new FlxKeyboard();
unfollow();
FlxG.levels = new Array();
FlxG.scores = new Array();
level = 0;
score = 0;
seed = NaN;
kong = null;
pause = false;
}
public static function computeVelocity(_arg1:Number, _arg2:Number=0, _arg3:Number=0, _arg4:Number=10000):Number{
var _local5:Number;
if (_arg2 != 0){
_arg1 = (_arg1 + (_arg2 * FlxG.elapsed));
} else {
if (_arg3 != 0){
_local5 = (_arg3 * FlxG.elapsed);
if ((_arg1 - _local5) > 0){
_arg1 = (_arg1 - _local5);
} else {
if ((_arg1 + _local5) < 0){
_arg1 = (_arg1 + _local5);
} else {
_arg1 = 0;
};
};
};
};
if (((!((_arg1 == 0))) && (!((_arg4 == 10000))))){
if (_arg1 > _arg4){
_arg1 = _arg4;
} else {
if (_arg1 < -(_arg4)){
_arg1 = -(_arg4);
};
};
};
return (_arg1);
}
public static function mutate(_arg1:Number, _arg2:Number):Number{
_arg1 = (_arg1 + _arg2);
if (_arg1 > 1){
_arg1 = (_arg1 - int(_arg1));
};
return (_arg1);
}
public static function collideArraysX(_arg1:Array, _arg2:Array):void{
var _local3:uint;
var _local4:uint;
var _local5:FlxCore;
var _local6:FlxCore;
var _local7:uint = _arg1.length;
var _local8:uint = _arg2.length;
if (_arg1 === _arg2){
_local3 = 0;
while (_local3 < _local7) {
_local5 = _arg1[_local3];
if ((((((_local5 == null)) || (!(_local5.exists)))) || (_local5.dead))){
} else {
_local4 = (_local3 + 1);
while (_local4 < _local8) {
_local6 = _arg2[_local4];
if ((((((_local6 == null)) || (!(_local6.exists)))) || (_local6.dead))){
} else {
_local5.collideX(_local6);
};
_local4++;
};
};
_local3++;
};
} else {
_local3 = 0;
while (_local3 < _local7) {
_local5 = _arg1[_local3];
if ((((((_local5 == null)) || (!(_local5.exists)))) || (_local5.dead))){
} else {
_local4 = 0;
while (_local4 < _local8) {
_local6 = _arg2[_local4];
if ((((((((_local5 === _local6)) || ((_local6 == null)))) || (!(_local6.exists)))) || (_local6.dead))){
} else {
_local5.collideX(_local6);
};
_local4++;
};
};
_local3++;
};
};
}
public static function collideArraysY(_arg1:Array, _arg2:Array):void{
var _local3:uint;
var _local4:uint;
var _local5:FlxCore;
var _local6:FlxCore;
var _local7:uint = _arg1.length;
var _local8:uint = _arg2.length;
if (_arg1 === _arg2){
_local3 = 0;
while (_local3 < _local7) {
_local5 = _arg1[_local3];
if ((((((_local5 == null)) || (!(_local5.exists)))) || (_local5.dead))){
} else {
_local4 = (_local3 + 1);
while (_local4 < _local8) {
_local6 = _arg2[_local4];
if ((((((_local6 == null)) || (!(_local6.exists)))) || (_local6.dead))){
} else {
_local5.collideY(_local6);
};
_local4++;
};
};
_local3++;
};
} else {
_local3 = 0;
while (_local3 < _local7) {
_local5 = _arg1[_local3];
if ((((((_local5 == null)) || (!(_local5.exists)))) || (_local5.dead))){
} else {
_local4 = 0;
while (_local4 < _local8) {
_local6 = _arg2[_local4];
if ((((((((_local5 === _local6)) || ((_local6 == null)))) || (!(_local6.exists)))) || (_local6.dead))){
} else {
_local5.collideY(_local6);
};
_local4++;
};
};
_local3++;
};
};
}
public static function createBitmap(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:Boolean):BitmapData{
var _local7:uint;
var _local8:String;
var _local5:String = ((((_arg1 + "x") + _arg2) + ":") + _arg3);
var _local6:Boolean;
if (((((_arg4) && (!((_cache[_local8] == undefined))))) && (!((_cache[_local8] == null))))){
_local7 = 0;
do {
var _temp1 = _local7;
_local7 = (_local7 + 1);
_local8 = (_local5 + _temp1);
} while (((!((_cache[_local8] == undefined))) && (!((_cache[_local8] == null)))));
_local5 = _local8;
};
_cache[_local5] = new BitmapData(_arg1, _arg2, true, _arg3);
return (_cache[_local5]);
}
public static function playMusic(_arg1:Class, _arg2:Number=1):void{
if (music == null){
music = new FlxSound();
} else {
if (music.active){
music.stop();
};
};
music.loadEmbedded(_arg1, true);
music.volume = _arg2;
music.survive = true;
music.play();
}
public static function overlapArray(_arg1:Array, _arg2:FlxCore, _arg3:Function=null):void{
var _local4:FlxCore;
if ((((((_arg2 == null)) || (!(_arg2.exists)))) || (_arg2.dead))){
return;
};
var _local5:uint = _arg1.length;
var _local6:uint;
while (_local6 < _local5) {
_local4 = _arg1[_local6];
if ((((((((_local4 === _arg2)) || ((_local4 == null)))) || (!(_local4.exists)))) || (_local4.dead))){
} else {
if (_local4.overlaps(_arg2)){
if (_arg3 != null){
_arg3(_local4, _arg2);
} else {
_local4.kill();
_arg2.kill();
};
};
};
_local6++;
};
}
public static function log(_arg1:Object):void{
_game._console.log(_arg1.toString());
}
public static function overlapArrays(_arg1:Array, _arg2:Array, _arg3:Function=null):void{
var _local4:uint;
var _local5:uint;
var _local6:FlxCore;
var _local7:FlxCore;
var _local8:uint = _arg1.length;
var _local9:uint = _arg2.length;
if (_arg1 === _arg2){
_local4 = 0;
while (_local4 < _local8) {
_local6 = _arg1[_local4];
if ((((((_local6 == null)) || (!(_local6.exists)))) || (_local6.dead))){
} else {
_local5 = (_local4 + 1);
while (_local5 < _local9) {
_local7 = _arg2[_local5];
if ((((((_local7 == null)) || (!(_local7.exists)))) || (_local7.dead))){
} else {
if (_local6.overlaps(_local7)){
if (_arg3 != null){
_arg3(_local6, _local7);
} else {
_local6.kill();
_local7.kill();
};
};
};
_local5++;
};
};
_local4++;
};
} else {
_local4 = 0;
while (_local4 < _arg1.length) {
_local6 = _arg1[_local4];
if ((((((_local6 == null)) || (!(_local6.exists)))) || (_local6.dead))){
} else {
_local5 = 0;
while (_local5 < _arg2.length) {
_local7 = _arg2[_local5];
if ((((((((_local6 === _local7)) || ((_local7 == null)))) || (!(_local7.exists)))) || (_local7.dead))){
} else {
if (_local6.overlaps(_local7)){
if (_arg3 != null){
_arg3(_local6, _local7);
} else {
_local6.kill();
_local7.kill();
};
};
};
_local5++;
};
};
_local4++;
};
};
}
static function updateSounds():void{
if (((!((music == null))) && (music.active))){
music.update();
};
var _local1:uint = sounds.length;
var _local2:uint;
while (_local2 < _local1) {
if (sounds[_local2].active){
sounds[_local2].update();
};
_local2++;
};
}
public static function get seed():Number{
return (_originalSeed);
}
static function updateInput():void{
keys.update();
mouse.update((state.mouseX - scroll.x), (state.mouseY - scroll.y));
}
public static function stream(_arg1:String, _arg2:Number=1, _arg3:Boolean=false):FlxSound{
var _local4:uint;
var _local5:uint = sounds.length;
_local4 = 0;
while (_local4 < _local5) {
if (!sounds[_local4].active){
break;
};
_local4++;
};
if (sounds[_local4] == null){
sounds[_local4] = new FlxSound();
};
var _local6:FlxSound = sounds[_local4];
_local6.loadStream(_arg1, _arg3);
_local6.volume = _arg2;
_local6.play();
return (_local6);
}
static function unfollow():void{
followTarget = null;
followLead = null;
followLerp = 1;
followMin = null;
followMax = null;
scroll = new Point();
_scrollTarget = new Point();
}
public static function fade(_arg1:uint, _arg2:Number=1, _arg3:Function=null, _arg4:Boolean=false):void{
_game._fade.restart(_arg1, _arg2, _arg3, _arg4);
}
protected static function playSounds():void{
if (((!((music == null))) && (music.active))){
music.play();
};
var _local1:uint = sounds.length;
var _local2:uint;
while (_local2 < _local1) {
if (sounds[_local2].active){
sounds[_local2].play();
};
_local2++;
};
}
public static function followAdjust(_arg1:Number=0, _arg2:Number=0):void{
followLead = new Point(_arg1, _arg2);
}
public static function follow(_arg1:FlxCore, _arg2:Number=1):void{
followTarget = _arg1;
followLerp = _arg2;
scroll.x = (_scrollTarget.x = (((width >> 1) - followTarget.x) - (followTarget.width >> 1)));
scroll.y = (_scrollTarget.y = (((height >> 1) - followTarget.y) - (followTarget.height >> 1)));
doFollow();
}
public static function showCursor(_arg1:Class=null):void{
if (_arg1 == null){
_game._cursor = (_game._buffer.addChild(new ImgDefaultCursor()) as Bitmap);
} else {
_game._cursor = (_game._buffer.addChild(new (_arg1)) as Bitmap);
};
}
public static function getRandom(_arg1:Array):Object{
return (_arg1[int((FlxG.random() * _arg1.length))]);
}
public static function resetInput():void{
keys.reset();
mouse.reset();
}
public static function switchState(_arg1:Class):void{
_game.switchState(_arg1);
}
public static function getNonexist(_arg1:Array):FlxCore{
var _local2:uint = _arg1.length;
if (_local2 <= 0){
return (null);
};
var _local3:uint;
do {
if (!_arg1[_local3].exists){
return (_arg1[_local3]);
};
++_local3;
} while (_local3 < _local2);
return (null);
}
public static function random(_arg1:Boolean=true):Number{
var _local2:Number;
if (((_arg1) && (!(isNaN(_seed))))){
_local2 = randomize(_seed);
_seed = mutate(_seed, _local2);
return (_local2);
};
return (Math.random());
}
public static function openURL(_arg1:String):void{
navigateToURL(new URLRequest(_arg1), "_blank");
}
public static function randomize(_arg1:Number):Number{
return ((((69621 * int((_arg1 * 2147483647))) % 2147483647) / 2147483647));
}
public static function collideArray(_arg1:Array, _arg2:FlxCore):void{
var _local3:FlxCore;
if ((((((_arg2 == null)) || (!(_arg2.exists)))) || (_arg2.dead))){
return;
};
var _local4:uint = _arg1.length;
var _local5:uint;
while (_local5 < _local4) {
_local3 = _arg1[_local5];
if ((((((((_local3 === _arg2)) || ((_local3 == null)))) || (!(_local3.exists)))) || (_local3.dead))){
} else {
_local3.collide(_arg2);
};
_local5++;
};
}
public static function followBounds(_arg1:int=0, _arg2:int=0, _arg3:int=0, _arg4:int=0):void{
followMin = new Point(-(_arg1), -(_arg2));
followMax = new Point((-(_arg3) + width), (-(_arg4) + height));
if (followMax.x > followMin.x){
followMax.x = followMin.x;
};
if (followMax.y > followMin.y){
followMax.y = followMin.y;
};
doFollow();
}
public static function quake(_arg1:Number, _arg2:Number=0.5):void{
_game._quake.reset(_arg1, _arg2);
}
protected static function pauseSounds():void{
if (((!((music == null))) && (music.active))){
music.pause();
};
var _local1:uint = sounds.length;
var _local2:uint;
while (_local2 < _local1) {
if (sounds[_local2].active){
sounds[_local2].pause();
};
_local2++;
};
}
public static function set seed(_arg1:Number):void{
_seed = _arg1;
_originalSeed = _seed;
}
static function destroySounds(_arg1:Boolean=false):void{
if (sounds == null){
return;
};
if (((!((music == null))) && (((_arg1) || (!(music.survive)))))){
music.destroy();
};
var _local2:uint = sounds.length;
var _local3:uint;
while (_local3 < _local2) {
if (((_arg1) || (!(sounds[_local3].survive)))){
sounds[_local3].destroy();
};
_local3++;
};
}
public static function set pause(_arg1:Boolean):void{
var _local2:Boolean = _pause;
_pause = _arg1;
if (_pause != _local2){
if (_pause){
_game.pause();
pauseSounds();
} else {
_game.unpause();
playSounds();
};
};
}
public static function hideSupportPanel():void{
_game._panel.hide();
}
public static function rotatePoint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Point{
var _local6:Number = ((-(_arg5) / 180) * Math.PI);
var _local7:Number = (_arg1 - _arg3);
var _local8:Number = (_arg4 - _arg2);
return (new Point(((_arg3 + (Math.cos(_local6) * _local7)) - (Math.sin(_local6) * _local8)), (_arg4 - ((Math.sin(_local6) * _local7) + (Math.cos(_local6) * _local8)))));
}
public static function get pause():Boolean{
return (_pause);
}
public static function collideArrayX(_arg1:Array, _arg2:FlxCore):void{
var _local3:FlxCore;
if ((((((_arg2 == null)) || (!(_arg2.exists)))) || (_arg2.dead))){
return;
};
var _local4:uint = _arg1.length;
var _local5:uint;
while (_local5 < _local4) {
_local3 = _arg1[_local5];
if ((((((((_local3 === _arg2)) || ((_local3 == null)))) || (!(_local3.exists)))) || (_local3.dead))){
} else {
_local3.collideX(_arg2);
};
_local5++;
};
}
public static function collideArrayY(_arg1:Array, _arg2:FlxCore):void{
var _local3:FlxCore;
if ((((((_arg2 == null)) || (!(_arg2.exists)))) || (_arg2.dead))){
return;
};
var _local4:uint = _arg1.length;
var _local5:uint;
while (_local5 < _local4) {
_local3 = _arg1[_local5];
if ((((((((_local3 === _arg2)) || ((_local3 == null)))) || (!(_local3.exists)))) || (_local3.dead))){
} else {
_local3.collideY(_arg2);
};
_local5++;
};
}
}
}//package org.flixel
Section 34
//FlxG_ImgDefaultCursor (org.flixel.FlxG_ImgDefaultCursor)
package org.flixel {
import mx.core.*;
public class FlxG_ImgDefaultCursor extends BitmapAsset {
}
}//package org.flixel
Section 35
//FlxGame (org.flixel.FlxGame)
package org.flixel {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import org.flixel.data.*;
import flash.media.*;
import flash.text.*;
import flash.utils.*;
import flash.ui.*;
public class FlxGame extends Sprite {
const MAX_ELAPSED:Number = 0.0333;
var _flash:FlxFlash;
var _bmpFront:Bitmap;
private var SndFlixel:Class;
var _panel:FlxPanel;
private var SndBeep:Class;
var _console:FlxConsole;
var _curState:FlxState;
var _logoFade:Bitmap;
var _showLogo:Boolean;
var _created:Boolean;
var _zoom:uint;
var _gameXOffset:int;
var _elapsed:Number;
var _flipped:Boolean;
var _total:uint;
var _soundTrayBars:Array;
var _iState:Class;
private var junk:String;// = "FlxGame_junk"
var _helpStrings:Array;
var _bmpBack:Bitmap;
var _paused:Boolean;
var _quake:FlxQuake;
var _gameYOffset:int;
var _buffer:Sprite;
var _fc:uint;
var _bgColor:Number;
var _f:Array;
var _fSound:Class;
public var useDefaultHotKeys:Boolean;
var _poweredBy:Bitmap;
var _soundTray:Sprite;
var _frame:Class;
var _logoComplete:Boolean;
var _fade:FlxFade;
var _cursor:Bitmap;
private var ImgPoweredBy:Class;
var _pausePopup:FlxPause;
var _logoTimer:Number;
var _soundTrayTimer:Number;
public function FlxGame(_arg1:uint, _arg2:uint, _arg3:Class, _arg4:uint=2, _arg5:Number=4278190080, _arg6:Boolean=true, _arg7:Number=4294967295, _arg8:Class=null, _arg9:Class=null, _arg10:uint=0, _arg11:uint=0){
ImgPoweredBy = FlxGame_ImgPoweredBy;
SndBeep = FlxGame_SndBeep;
SndFlixel = FlxGame_SndFlixel;
super();
_zoom = _arg4;
_gameXOffset = _arg10;
_gameYOffset = _arg11;
_bgColor = _arg5;
_fc = _arg7;
FlxG.setGameData(this, _arg1, _arg2);
_created = false;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
_elapsed = 0;
_total = 0;
Mouse.hide();
_logoComplete = false;
_f = null;
_quake = new FlxQuake(_zoom);
_flash = new FlxFlash();
_fade = new FlxFade();
if (_arg8 == null){
_fSound = SndFlixel;
} else {
_fSound = _arg8;
};
_curState = null;
_frame = _arg9;
_iState = _arg3;
_paused = false;
_helpStrings = new Array();
_helpStrings.push("Button 1");
_helpStrings.push("Button 2");
_helpStrings.push("Mouse");
_helpStrings.push("Move");
_showLogo = _arg6;
_panel = new FlxPanel();
useDefaultHotKeys = false;
}
private function onEnterFrame(_arg1:Event):void{
var _local2:uint;
var _local4:Bitmap;
var _local5:uint;
var _local6:uint;
var _local7:int;
var _local8:int;
var _local9:ColorTransform;
var _local10:String;
var _local11:String;
var _local12:TextField;
var _local13:uint;
var _local14:uint;
var _local15:Bitmap;
var _local3:uint = getTimer();
_elapsed = ((_local3 - _total) / 1000);
_total = _local3;
FlxG.elapsed = _elapsed;
if (FlxG.elapsed > MAX_ELAPSED){
FlxG.elapsed = MAX_ELAPSED;
};
if (_logoComplete){
_panel.update();
_console.update();
if (_soundTrayTimer > 0){
_soundTrayTimer = (_soundTrayTimer - _elapsed);
} else {
if (_soundTray.y > -(_soundTray.height)){
_soundTray.y = (_soundTray.y - ((_elapsed * FlxG.height) * 2));
if (_soundTray.y < -(_soundTray.height)){
_soundTray.visible = false;
};
};
};
if (!_paused){
FlxG.updateInput();
if (_cursor != null){
_cursor.x = (FlxG.mouse.x + FlxG.scroll.x);
_cursor.y = (FlxG.mouse.y + FlxG.scroll.y);
};
FlxG.doFollow();
_curState.update();
FlxG.updateSounds();
_flash.update();
_fade.update();
_quake.update();
_buffer.x = _quake.x;
_buffer.y = _quake.y;
if (_flipped){
_bmpFront.bitmapData.fillRect(new Rectangle(0, 0, _bmpFront.width, _bmpFront.height), _bgColor);
FlxG.buffer = _bmpFront.bitmapData;
} else {
_bmpBack.bitmapData.fillRect(new Rectangle(0, 0, _bmpBack.width, _bmpBack.height), _bgColor);
FlxG.buffer = _bmpBack.bitmapData;
};
_curState.render();
_flash.render();
_fade.render();
_panel.render();
_bmpBack.visible = !((_bmpFront.visible = _flipped));
_flipped = !(_flipped);
};
} else {
if (_created){
if (!_showLogo){
_logoComplete = true;
FlxG.switchState(_iState);
} else {
if (_f == null){
_f = new Array();
_local5 = 1;
if (FlxG.height > 200){
_local5 = 2;
};
_local6 = (32 * _local5);
_local7 = (((FlxG.height * _zoom) / 2) - (_local6 * 2));
_local8 = (((FlxG.width * _zoom) / 2) - _local6);
_f.push((addChild(new FlxLogoPixel((_local8 + _local6), _local7, _local6, 0, _fc)) as FlxLogoPixel));
_f.push((addChild(new FlxLogoPixel(_local8, (_local7 + _local6), _local6, 1, _fc)) as FlxLogoPixel));
_f.push((addChild(new FlxLogoPixel(_local8, (_local7 + (_local6 * 2)), _local6, 2, _fc)) as FlxLogoPixel));
_f.push((addChild(new FlxLogoPixel((_local8 + _local6), (_local7 + (_local6 * 2)), _local6, 3, _fc)) as FlxLogoPixel));
_f.push((addChild(new FlxLogoPixel(_local8, (_local7 + (_local6 * 3)), _local6, 4, _fc)) as FlxLogoPixel));
_poweredBy = new ImgPoweredBy();
_poweredBy.scaleX = _local5;
_poweredBy.scaleY = _local5;
_poweredBy.x = (((FlxG.width * _zoom) / 2) - (_poweredBy.width / 2));
_poweredBy.y = ((_local7 + (_local6 * 4)) + 16);
_local9 = new ColorTransform();
_local9.color = _fc;
_poweredBy.bitmapData.colorTransform(new Rectangle(0, 0, _poweredBy.width, _poweredBy.height), _local9);
addChild(_poweredBy);
_logoFade = (addChild(new Bitmap(new BitmapData((FlxG.width * _zoom), (FlxG.height * _zoom), true, 4278190080))) as Bitmap);
_logoFade.x = (_gameXOffset * _zoom);
_logoFade.y = (_gameYOffset * _zoom);
if (_fSound != null){
new _fSound().play(0, 0, new SoundTransform(0.35, 0));
};
};
_logoTimer = (_logoTimer + _elapsed);
_local2 = 0;
while (_local2 < _f.length) {
_f[_local2].update();
_local2++;
};
if (_logoFade.alpha > 0){
_logoFade.alpha = (_logoFade.alpha - (_elapsed * 0.5));
};
if (_logoTimer > 2){
removeChild(_poweredBy);
_local2 = 0;
while (_local2 < _f.length) {
removeChild(_f[_local2]);
_local2++;
};
_f.length = 0;
removeChild(_logoFade);
FlxG.switchState(_iState);
_logoComplete = true;
};
};
} else {
if (root != null){
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.frameRate = 90;
_buffer = new Sprite();
_buffer.scaleX = _zoom;
_buffer.scaleY = _zoom;
addChild(_buffer);
_bmpBack = new Bitmap(new BitmapData(FlxG.width, FlxG.height, true, _bgColor));
_bmpBack.x = _gameXOffset;
_bmpBack.y = _gameYOffset;
_buffer.addChild(_bmpBack);
_bmpFront = new Bitmap(new BitmapData(_bmpBack.width, _bmpBack.height, true, _bgColor));
_bmpFront.x = _bmpBack.x;
_bmpFront.y = _bmpBack.y;
_buffer.addChild(_bmpFront);
_flipped = false;
_console = new FlxConsole(_gameXOffset, _gameYOffset, _zoom);
addChild(_console);
_local10 = ((((FlxG.LIBRARY_NAME + " v") + FlxG.LIBRARY_MAJOR_VERSION) + ".") + FlxG.LIBRARY_MINOR_VERSION);
if (FlxG.debug){
_local10 = (_local10 + " [debug]");
} else {
_local10 = (_local10 + " [release]");
};
_local11 = "";
_local2 = 0;
while (_local2 < (_local10.length + 32)) {
_local11 = (_local11 + "-");
_local2++;
};
FlxG.log(_local10);
FlxG.log(_local11);
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
stage.addEventListener(KeyboardEvent.KEY_UP, onKeyUp);
stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
_pausePopup = new FlxPause(_gameXOffset, _gameYOffset, _zoom, _helpStrings);
addChild(_pausePopup);
stage.addEventListener(Event.DEACTIVATE, onFocusLost);
stage.addEventListener(Event.ACTIVATE, onFocus);
_soundTray = new Sprite();
_soundTray.visible = false;
_soundTray.scaleX = 2;
_soundTray.scaleY = 2;
_local4 = new Bitmap(new BitmapData(80, 30, true, 2130706432));
_soundTray.x = (((_gameXOffset + (FlxG.width / 2)) * _zoom) - ((_local4.width / 2) * _soundTray.scaleX));
_soundTray.addChild(_local4);
_local12 = new TextField();
_local12.width = _local4.width;
_local12.height = _local4.height;
_local12.multiline = true;
_local12.wordWrap = true;
_local12.selectable = false;
_local12.embedFonts = true;
_local12.antiAliasType = AntiAliasType.NORMAL;
_local12.gridFitType = GridFitType.PIXEL;
_local12.defaultTextFormat = new TextFormat("system", 8, 0xFFFFFF, null, null, null, null, null, "center");
_soundTray.addChild(_local12);
_local12.text = "VOLUME";
_local12.y = 16;
_local13 = 10;
_local14 = 14;
_soundTrayBars = new Array();
_local2 = 0;
while (_local2 < 10) {
_local4 = new Bitmap(new BitmapData(4, (_local2 + 1), false, 0xFFFFFF));
_local4.x = _local13;
_local4.y = _local14;
_soundTrayBars.push(_soundTray.addChild(_local4));
_local13 = (_local13 + 6);
_local14--;
_local2++;
};
addChild(_soundTray);
if (_frame != null){
_local15 = new _frame();
_local15.scaleX = _zoom;
_local15.scaleY = _zoom;
addChild(_local15);
};
_created = true;
_logoTimer = 0;
};
};
};
}
protected function setupSupportPanel(_arg1:String, _arg2:Number, _arg3:String, _arg4:String, _arg5:String):void{
_panel.init(_arg1, _arg2, _arg3, _arg4, _arg5);
}
private function onFocusLost(_arg1:Event=null):void{
FlxG.pause = true;
}
private function onFocus(_arg1:Event=null):void{
FlxG.pause = false;
}
private function onKeyUp(_arg1:KeyboardEvent):void{
var _local2:int;
var _local3:String;
if (_arg1.keyCode == 192){
_console.toggle();
return;
};
if (useDefaultHotKeys){
_local2 = _arg1.keyCode;
_local3 = String.fromCharCode(_arg1.charCode);
switch (_local2){
case 48:
FlxG.mute = !(FlxG.mute);
showSoundTray();
return;
case 189:
FlxG.mute = false;
FlxG.volume = (FlxG.volume - 0.1);
showSoundTray();
return;
case 187:
FlxG.mute = false;
FlxG.volume = (FlxG.volume + 0.1);
showSoundTray();
return;
case 80:
FlxG.pause = !(FlxG.pause);
default:
break;
};
};
FlxG.keys.handleKeyUp(_arg1);
}
protected function help(_arg1:String=null, _arg2:String=null, _arg3:String=null, _arg4:String=null):void{
if (_arg1 != null){
_helpStrings[0] = _arg1;
};
if (_arg2 != null){
_helpStrings[1] = _arg2;
};
if (_arg3 != null){
_helpStrings[2] = _arg3;
};
if (_arg4 != null){
_helpStrings[3] = _arg4;
};
}
public function switchState(_arg1:Class):void{
_panel.hide();
FlxG.unfollow();
FlxG.keys.reset();
FlxG.mouse.reset();
FlxG.hideCursor();
FlxG.destroySounds();
_flash.restart(0, 0);
_fade.restart(0, 0);
_quake.reset(0);
_buffer.x = 0;
_buffer.y = 0;
var _local2:FlxState = new (_arg1);
_buffer.addChild(_local2);
if (_curState != null){
_buffer.swapChildren(_local2, _curState);
_buffer.removeChild(_curState);
_curState.destroy();
};
_curState = _local2;
}
private function onMouseDown(_arg1:MouseEvent):void{
FlxG.mouse.handleMouseDown(_arg1);
}
private function onKeyDown(_arg1:KeyboardEvent):void{
FlxG.keys.handleKeyDown(_arg1);
}
private function onMouseUp(_arg1:MouseEvent):void{
FlxG.mouse.handleMouseUp(_arg1);
}
function unpause():void{
if (!_panel.visible){
Mouse.hide();
};
_pausePopup.visible = false;
FlxG.resetInput();
_paused = false;
stage.frameRate = 90;
}
function pause():void{
if (((!((x == 0))) || (!((y == 0))))){
x = 0;
y = 0;
};
Mouse.show();
_pausePopup.visible = true;
_paused = true;
stage.frameRate = 10;
}
public function showSoundTray():void{
FlxG.play(SndBeep);
_soundTrayTimer = 1;
_soundTray.y = (_gameYOffset * _zoom);
_soundTray.visible = true;
var _local1:uint = Math.round((FlxG.volume * 10));
if (FlxG.mute){
_local1 = 0;
};
var _local2:uint;
while (_local2 < _soundTrayBars.length) {
if (_local2 < _local1){
_soundTrayBars[_local2].alpha = 1;
} else {
_soundTrayBars[_local2].alpha = 0.5;
};
_local2++;
};
}
}
}//package org.flixel
Section 36
//FlxGame_ImgPoweredBy (org.flixel.FlxGame_ImgPoweredBy)
package org.flixel {
import mx.core.*;
public class FlxGame_ImgPoweredBy extends BitmapAsset {
}
}//package org.flixel
Section 37
//FlxGame_junk (org.flixel.FlxGame_junk)
package org.flixel {
import mx.core.*;
public class FlxGame_junk extends FontAsset {
}
}//package org.flixel
Section 38
//FlxGame_SndBeep (org.flixel.FlxGame_SndBeep)
package org.flixel {
import mx.core.*;
public class FlxGame_SndBeep extends SoundAsset {
}
}//package org.flixel
Section 39
//FlxGame_SndFlixel (org.flixel.FlxGame_SndFlixel)
package org.flixel {
import mx.core.*;
public class FlxGame_SndFlixel extends SoundAsset {
}
}//package org.flixel
Section 40
//FlxLayer (org.flixel.FlxLayer)
package org.flixel {
public class FlxLayer extends FlxCore {
protected var _children:Array;
public function FlxLayer(){
_children = new Array();
}
public function add(_arg1:FlxCore):FlxCore{
_children.push(_arg1);
return (_arg1);
}
public function remove(_arg1:FlxCore):void{
var _local2:uint = _children.length;
var _local3:uint;
while (_local3 < _local2) {
if (_children[_local3] == _arg1){
_children[_local3] = null;
return;
};
_local3++;
};
}
override public function render():void{
super.render();
var _local1:uint = _children.length;
var _local2:uint;
while (_local2 < _local1) {
if (((((!((_children[_local2] == null))) && (_children[_local2].exists))) && (_children[_local2].visible))){
_children[_local2].render();
};
_local2++;
};
}
override public function update():void{
super.update();
var _local1:uint = _children.length;
var _local2:uint;
while (_local2 < _local1) {
if (((((!((_children[_local2] == null))) && (_children[_local2].exists))) && (_children[_local2].active))){
_children[_local2].update();
};
_local2++;
};
}
override public function destroy():void{
super.destroy();
var _local1:uint = _children.length;
var _local2:uint;
while (_local2 < _local1) {
_children[_local2].destroy();
_local2++;
};
_children.length = 0;
}
public function children():Array{
return (_children);
}
}
}//package org.flixel
Section 41
//FlxSound (org.flixel.FlxSound)
package org.flixel {
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
public class FlxSound extends FlxCore {
protected var _volume:Number;
protected var _channel:SoundChannel;
protected var _fadeInTimer:Number;
protected var _position:Number;
protected var _sound:Sound;
protected var _fadeOutTotal:Number;
protected var _fadeOutTimer:Number;
protected var _fadeInTotal:Number;
protected var _pauseOnFadeOut:Boolean;
protected var _looped:Boolean;
protected var _volumeAdjust:Number;
protected var _transform:SoundTransform;
protected var _init:Boolean;
protected var _radius:Number;
public var survive:Boolean;
protected var _core:FlxCore;
public function FlxSound(){
_transform = new SoundTransform();
init();
}
public function fadeOut(_arg1:Number, _arg2:Boolean=false):void{
_pauseOnFadeOut = _arg2;
_fadeInTimer = 0;
_fadeOutTimer = _arg1;
_fadeOutTotal = _fadeOutTimer;
}
public function stop():void{
_position = 0;
if (_channel != null){
_channel.stop();
stopped();
};
}
protected function looped(_arg1:Event=null):void{
if (_channel == null){
return;
};
_channel.removeEventListener(Event.SOUND_COMPLETE, looped);
_channel = null;
play();
}
public function loadStream(_arg1:String, _arg2:Boolean=false):void{
stop();
init();
_sound = new Sound(new URLRequest(_arg1));
_looped = _arg2;
updateTransform();
active = true;
}
public function loadEmbedded(_arg1:Class, _arg2:Boolean=false):void{
stop();
init();
_sound = new (_arg1);
_looped = _arg2;
updateTransform();
active = true;
}
protected function stopped(_arg1:Event=null):void{
if (!_looped){
_channel.removeEventListener(Event.SOUND_COMPLETE, stopped);
} else {
_channel.removeEventListener(Event.SOUND_COMPLETE, looped);
};
_channel = null;
active = false;
}
override public function update():void{
var _local3:Point;
var _local4:Point;
var _local5:Number;
var _local6:Number;
super.update();
var _local1:Number = 1;
var _local2:Number = 1;
if (_core != null){
_local3 = new Point();
_local4 = new Point();
_core.getScreenXY(_local3);
getScreenXY(_local4);
_local5 = (_local3.x - _local4.x);
_local6 = (_local3.y - _local4.y);
_local1 = ((_radius - Math.sqrt(((_local5 * _local5) + (_local6 * _local6)))) / _radius);
FlxG.log(_local1);
if (_local1 < 0){
_local1 = 0;
};
if (_local1 > 1){
_local1 = 1;
};
};
if (_fadeOutTimer > 0){
_fadeOutTimer = (_fadeOutTimer - FlxG.elapsed);
if (_fadeOutTimer <= 0){
if (_pauseOnFadeOut){
pause();
} else {
stop();
};
};
_local2 = (_fadeOutTimer / _fadeOutTotal);
if (_local2 < 0){
_local2 = 0;
};
} else {
if (_fadeInTimer > 0){
_fadeInTimer = (_fadeInTimer - FlxG.elapsed);
_local2 = (_fadeInTimer / _fadeOutTotal);
if (_local2 < 0){
_local2 = 0;
};
_local2 = (1 - _local2);
};
};
_volumeAdjust = (_local1 * _local2);
updateTransform();
}
public function fadeIn(_arg1:Number):void{
_fadeOutTimer = 0;
_fadeInTimer = _arg1;
_fadeInTotal = _fadeInTimer;
play();
}
public function get volume():Number{
return (_volume);
}
function updateTransform():void{
_transform.volume = (((FlxG.getMuteValue() * FlxG.volume) * _volume) * _volumeAdjust);
if (_channel != null){
_channel.soundTransform = _transform;
};
}
override public function destroy():void{
if (active){
stop();
};
}
public function play():void{
if (_position < 0){
return;
};
if (_looped){
if (_position == 0){
if (_channel == null){
_channel = _sound.play(0, 9999, _transform);
};
} else {
_channel = _sound.play(_position, 0, _transform);
if (_channel != null){
_channel.addEventListener(Event.SOUND_COMPLETE, looped);
};
};
} else {
if (_position == 0){
if (_channel == null){
_channel = _sound.play(0, 0, _transform);
if (_channel != null){
_channel.addEventListener(Event.SOUND_COMPLETE, stopped);
};
};
} else {
_channel = _sound.play(_position, 0, _transform);
};
};
_position = 0;
}
public function pause():void{
if (_channel == null){
_position = -1;
return;
};
_position = _channel.position;
_channel.stop();
while (_position >= _sound.length) {
_position = (_position - _sound.length);
};
_channel = null;
}
public function set volume(_arg1:Number):void{
_volume = _arg1;
if (_volume < 0){
_volume = 0;
} else {
if (_volume > 1){
_volume = 1;
};
};
updateTransform();
}
protected function init():void{
_sound = null;
_position = 0;
_volume = 1;
_volumeAdjust = 1;
_looped = false;
_core = null;
_radius = 0;
_fadeOutTimer = 0;
_fadeOutTotal = 0;
_pauseOnFadeOut = false;
_fadeInTimer = 0;
_fadeInTotal = 0;
active = false;
visible = false;
dead = true;
}
public function proximity(_arg1:Number, _arg2:Number, _arg3:FlxCore, _arg4:Number):void{
x = _arg1;
y = _arg2;
_core = _arg3;
_radius = _arg4;
}
}
}//package org.flixel
Section 42
//FlxSprite (org.flixel.FlxSprite)
package org.flixel {
import flash.geom.*;
import flash.display.*;
import org.flixel.data.*;
public class FlxSprite extends FlxCore {
public var acceleration:Point;
public var finished:Boolean;
public var angularAcceleration:Number;
protected var _caf:uint;
private var _alpha:Number;
protected var _animations:Array;
protected var _ct:ColorTransform;
public var offset:Point;
protected var _mtx:Matrix;
protected var _callback:Function;
protected var _curAnim:FlxAnim;
public var drag:Point;
public var angularDrag:Number;
protected var _flipped:uint;
public var pixels:BitmapData;
public var scale:Point;
protected var _pixels:BitmapData;
public var blend:String;
public var angle:Number;
public var thrust:Number;
public var maxThrust:Number;
public var velocity:Point;
public var maxAngular:Number;
public var angularVelocity:Number;
public var maxVelocity:Point;
public var health:Number;
protected var _bh:uint;
protected var _curFrame:uint;
protected var _p:Point;
protected var _bw:uint;
protected var _frameTimer:Number;
protected var _facing:uint;
protected var _r:Rectangle;
public var antialiasing:Boolean;
private var _color:uint;
protected static const _pZero:Point = new Point();
public static const LEFT:uint = 0;
public static const DOWN:uint = 3;
public static const UP:uint = 2;
public static const RIGHT:uint = 1;
public function FlxSprite(_arg1:Class=null, _arg2:int=0, _arg3:int=0, _arg4:Boolean=false, _arg5:Boolean=false, _arg6:uint=0, _arg7:uint=0, _arg8:uint=4294967295, _arg9:Boolean=false){
if (_arg1 == null){
pixels = FlxG.createBitmap(((_arg6)<=0) ? 1 : _arg6, ((_arg7)<=0) ? 1 : _arg7, _arg8, _arg9);
} else {
pixels = FlxG.addBitmap(_arg1, _arg5);
};
last.x = (x = _arg2);
last.y = (y = _arg3);
if (_arg6 == 0){
if (_arg4){
_arg6 = pixels.height;
} else {
_arg6 = pixels.width;
};
};
width = (_bw = _arg6);
if (_arg7 == 0){
if (_arg4){
_arg7 = width;
} else {
_arg7 = pixels.height;
};
};
height = (_bh = _arg7);
offset = new Point();
velocity = new Point();
acceleration = new Point();
drag = new Point();
maxVelocity = new Point(10000, 10000);
angle = 0;
angularVelocity = 0;
angularAcceleration = 0;
angularDrag = 0;
maxAngular = 10000;
thrust = 0;
scale = new Point(1, 1);
finished = false;
_facing = RIGHT;
_animations = new Array();
if (_arg5){
_flipped = (pixels.width >> 1);
} else {
_flipped = 0;
};
_curAnim = null;
_curFrame = 0;
_caf = 0;
_frameTimer = 0;
_p = new Point(x, y);
_r = new Rectangle(0, 0, _bw, _bh);
_pixels = new BitmapData(width, height);
_pixels.copyPixels(pixels, _r, _pZero);
_mtx = new Matrix();
health = 1;
_alpha = 1;
_color = 0xFFFFFF;
blend = null;
_callback = null;
}
override public function getScreenXY(_arg1:Point):void{
_arg1.x = (Math.floor((x - offset.x)) + Math.floor((FlxG.scroll.x * scrollFactor.x)));
_arg1.y = (Math.floor((y - offset.y)) + Math.floor((FlxG.scroll.y * scrollFactor.y)));
}
public function hurt(_arg1:Number):void{
if ((health = (health - _arg1)) <= 0){
kill();
};
}
override public function render():void{
if (!visible){
return;
};
getScreenXY(_p);
if ((((((((angle == 0)) && ((scale.x == 1)))) && ((scale.y == 1)))) && ((blend == null)))){
FlxG.buffer.copyPixels(_pixels, _r, _p, null, null, true);
return;
};
_mtx.identity();
_mtx.translate(-((_bw >> 1)), -((_bh >> 1)));
_mtx.scale(scale.x, scale.y);
if (angle != 0){
_mtx.rotate(((Math.PI * 2) * (angle / 360)));
};
_mtx.translate((_p.x + (_bw >> 1)), (_p.y + (_bh >> 1)));
FlxG.buffer.draw(_pixels, _mtx, null, blend, null, antialiasing);
}
public function randomFrame():void{
_curAnim = null;
_caf = int((FlxG.random() * (pixels.width / _bw)));
calcFrame();
}
override public function overlapsPoint(_arg1:Number, _arg2:Number, _arg3:Boolean=false):Boolean{
var _local4:Number = x;
var _local5:Number = y;
if (((!((scrollFactor.x == 1))) || (!((scrollFactor.y == 1))))){
_local4 = (_local4 - Math.floor((FlxG.scroll.x * scrollFactor.x)));
_local5 = (_local5 - Math.floor((FlxG.scroll.y * scrollFactor.y)));
};
if (_arg3){
return (_pixels.hitTest(new Point(0, 0), 0xFF, new Point((_arg1 - _local4), (_arg2 - _local5))));
};
if ((((((((_arg1 <= _local4)) || ((_arg1 >= (_local4 + width))))) || ((_arg2 <= _local5)))) || ((_arg2 >= (_local5 + height))))){
return (false);
};
return (true);
}
protected function calcFrame():void{
var _local1:uint = (_caf * _bw);
var _local2:uint;
var _local3:uint = (_flipped) ? _flipped : pixels.width;
if (_local1 >= _local3){
_local2 = (uint((_local1 / _local3)) * _bh);
_local1 = (_local1 % _local3);
};
if (((_flipped) && ((_facing == LEFT)))){
_local1 = (((_flipped << 1) - _local1) - _bw);
};
_pixels.copyPixels(pixels, new Rectangle(_local1, _local2, _bw, _bh), _pZero);
if (_ct != null){
_pixels.colorTransform(_r, _ct);
};
if (_callback != null){
_callback(_curAnim.name, _curFrame, _caf);
};
}
public function get color():uint{
return (_color);
}
override public function hitCeiling(_arg1:FlxCore=null):Boolean{
velocity.y = 0;
return (true);
}
override public function hitFloor(_arg1:FlxCore=null):Boolean{
velocity.y = 0;
return (true);
}
public function play(_arg1:String, _arg2:Boolean=false):void{
if (((((!(_arg2)) && (!((_curAnim == null))))) && ((_arg1 == _curAnim.name)))){
return;
};
_curFrame = 0;
_caf = 0;
_frameTimer = 0;
var _local3:uint = _animations.length;
var _local4:uint;
while (_local4 < _local3) {
if (_animations[_local4].name == _arg1){
finished = false;
_curAnim = _animations[_local4];
_caf = _curAnim.frames[_curFrame];
calcFrame();
return;
};
_local4++;
};
}
public function draw(_arg1:FlxSprite, _arg2:int=0, _arg3:int=0):void{
var _local4:BitmapData = _arg1._pixels;
if ((((((((_arg1.angle == 0)) && ((_arg1.scale.x == 1)))) && ((_arg1.scale.y == 1)))) && ((_arg1.blend == null)))){
pixels.copyPixels(_local4, new Rectangle(0, 0, _local4.width, _local4.height), new Point(_arg2, _arg3), null, null, true);
calcFrame();
return;
};
var _local5:Matrix = new Matrix();
_local5.translate(-((_arg1._bw >> 1)), -((_arg1._bh >> 1)));
_local5.scale(_arg1.scale.x, _arg1.scale.y);
if (_arg1.angle != 0){
_local5.rotate(((Math.PI * 2) * (_arg1.angle / 360)));
};
_local5.translate((_arg2 + (_arg1._bw >> 1)), (_arg3 + (_arg1._bh >> 1)));
pixels.draw(_local4, _local5, null, _arg1.blend, null, _arg1.antialiasing);
calcFrame();
}
public function set color(_arg1:uint):void{
_color = (_arg1 & 0xFFFFFF);
if (((!((_alpha == 1))) || (!((_color == 0xFFFFFF))))){
_ct = new ColorTransform((Number((_color >> 16)) / 0xFF), (Number(((_color >> 8) & 0xFF)) / 0xFF), (Number((_color & 0xFF)) / 0xFF), _alpha);
} else {
_ct = null;
};
calcFrame();
}
override public function update():void{
var _local1:Point;
var _local2:Point;
var _local3:Number;
super.update();
if (!active){
return;
};
if (((((!((_curAnim == null))) && ((_curAnim.delay > 0)))) && (((_curAnim.looped) || (!(finished)))))){
_frameTimer = (_frameTimer + FlxG.elapsed);
if (_frameTimer > _curAnim.delay){
_frameTimer = (_frameTimer - _curAnim.delay);
if (_curFrame == (_curAnim.frames.length - 1)){
if (_curAnim.looped){
_curFrame = 0;
};
finished = true;
} else {
_curFrame++;
};
_caf = _curAnim.frames[_curFrame];
calcFrame();
};
};
angle = (angle + ((angularVelocity = FlxG.computeVelocity(angularVelocity, angularAcceleration, angularDrag, maxAngular)) * FlxG.elapsed));
if (thrust != 0){
_local1 = FlxG.rotatePoint(-(thrust), 0, 0, 0, angle);
_local2 = FlxG.rotatePoint(-(maxThrust), 0, 0, 0, angle);
_local3 = Math.abs(_local2.x);
if (_local3 > Math.abs(_local2.y)){
_local2.y = _local3;
} else {
_local3 = Math.abs(_local2.y);
};
maxVelocity.x = Math.abs(_local3);
maxVelocity.y = Math.abs(_local3);
} else {
_local1 = _pZero;
};
x = (x + ((velocity.x = FlxG.computeVelocity(velocity.x, (acceleration.x + _local1.x), drag.x, maxVelocity.x)) * FlxG.elapsed));
y = (y + ((velocity.y = FlxG.computeVelocity(velocity.y, (acceleration.y + _local1.y), drag.y, maxVelocity.y)) * FlxG.elapsed));
}
public function set alpha(_arg1:Number):void{
if (_arg1 > 1){
_arg1 = 1;
};
if (_arg1 < 0){
_arg1 = 0;
};
_alpha = _arg1;
if (((!((_alpha == 1))) || (!((_color == 0xFFFFFF))))){
_ct = new ColorTransform((Number((_color >> 16)) / 0xFF), (Number(((_color >> 8) & 0xFF)) / 0xFF), (Number((_color & 0xFF)) / 0xFF), _alpha);
} else {
_ct = null;
};
calcFrame();
}
public function onEmit():void{
}
public function set facing(_arg1:uint):void{
var _local2 = !((_facing == _arg1));
_facing = _arg1;
if (_local2){
calcFrame();
};
}
public function addAnimationCallback(_arg1:Function):void{
_callback = _arg1;
}
public function specificFrame(_arg1:uint):void{
_curAnim = null;
_caf = _arg1;
calcFrame();
}
public function get facing():uint{
return (_facing);
}
public function addAnimation(_arg1:String, _arg2:Array, _arg3:Number=0, _arg4:Boolean=true):void{
_animations.push(new FlxAnim(_arg1, _arg2, _arg3, _arg4));
}
public function get alpha():Number{
return (_alpha);
}
override public function hitWall(_arg1:FlxCore=null):Boolean{
velocity.x = 0;
return (true);
}
}
}//package org.flixel
Section 43
//FlxState (org.flixel.FlxState)
package org.flixel {
import flash.display.*;
public class FlxState extends Sprite {
protected var _layer:FlxLayer;
public function FlxState(){
_layer = new FlxLayer();
FlxG.state = this;
}
public function add(_arg1:FlxCore):FlxCore{
return (_layer.add(_arg1));
}
public function render():void{
_layer.render();
}
public function update():void{
_layer.update();
}
public function destroy():void{
_layer.destroy();
}
public function remove(_arg1:FlxCore):void{
_layer.remove(_arg1);
}
}
}//package org.flixel
Section 44
//FlxText (org.flixel.FlxText)
package org.flixel {
import flash.geom.*;
import flash.display.*;
import flash.text.*;
public class FlxText extends FlxSprite {
protected var _tf:TextField;
protected var _regen:Boolean;
public function FlxText(_arg1:Number, _arg2:Number, _arg3:uint, _arg4:String="", _arg5:uint=0xFFFFFF, _arg6:String=null, _arg7:Number=8, _arg8:String=null){
if (_arg6 == null){
_arg6 = "system";
};
if (_arg4 == null){
_arg4 = "";
};
_tf = new TextField();
_tf.width = _arg3;
_tf.height = 1;
_tf.embedFonts = true;
_tf.selectable = false;
_tf.sharpness = 100;
_tf.defaultTextFormat = new TextFormat(_arg6, _arg7, 0xFFFFFF, null, null, null, null, null, _arg8);
_tf.text = _arg4;
super(null, _arg1, _arg2, false, false, _arg3, 1);
_regen = true;
color = _arg5;
}
public function get size():Number{
return ((_tf.defaultTextFormat.size as Number));
}
public function set size(_arg1:Number):void{
_tf.defaultTextFormat.size = _arg1;
_regen = true;
calcFrame();
}
public function set text(_arg1:String):void{
_tf.text = _arg1;
_regen = true;
calcFrame();
}
public function get text():String{
return (_tf.text);
}
override protected function calcFrame():void{
var _local2:uint;
var _local3:uint;
if ((((((_tf == null)) || ((_tf.text == null)))) || ((_tf.text.length <= 0)))){
_pixels.fillRect(_r, 0);
return;
};
if (_regen){
_local2 = _tf.numLines;
height = 0;
_local3 = 0;
while (_local3 < _local2) {
height = (height + _tf.getLineMetrics(_local3).height);
_local3++;
};
height = (height + 4);
_pixels = new BitmapData(width, height, true, 0);
_bh = height;
_tf.height = height;
_r = new Rectangle(0, 0, width, height);
_regen = false;
} else {
_pixels.fillRect(_r, 0);
};
var _local1:TextFormat = _tf.defaultTextFormat;
_mtx.identity();
if ((((_local1.align == "center")) && ((_tf.numLines == 1)))){
_tf.setTextFormat(new TextFormat(_local1.font, _local1.size, _local1.color, null, null, null, null, null, "left"));
_mtx.translate(Math.floor(((width - _tf.getLineMetrics(0).width) / 2)), 0);
};
_pixels.draw(_tf, _mtx, _ct);
_tf.setTextFormat(new TextFormat(_local1.font, _local1.size, _local1.color, null, null, null, null, null, _local1.align));
}
}
}//package org.flixel
Section 45
//FlxTilemap (org.flixel.FlxTilemap)
package org.flixel {
import flash.geom.*;
import flash.display.*;
public class FlxTilemap extends FlxCore {
protected var _screenRows:uint;
protected var _ci:uint;
protected var _data:Array;
protected var _pixels:BitmapData;
protected var _block:FlxCore;
protected var _callbacks:Array;
protected var _rects:Array;
protected var _screenCols:uint;
protected var _di:uint;
protected var _tileSize:uint;
protected var _p:Point;
public var heightInTiles:uint;
public var widthInTiles:uint;
public function FlxTilemap(_arg1:String, _arg2:Class, _arg3:uint, _arg4:uint=1, _arg5:uint=1){
var _local6:uint;
var _local7:Array;
super();
_ci = _arg4;
_di = _arg5;
widthInTiles = 0;
heightInTiles = 0;
_data = new Array();
var _local8:Array = _arg1.split("\n");
heightInTiles = _local8.length;
var _local9:uint;
while (_local9 < heightInTiles) {
_local7 = _local8[_local9].split(",");
if (_local7.length <= 1){
heightInTiles--;
} else {
if (widthInTiles == 0){
widthInTiles = _local7.length;
};
_local6 = 0;
while (_local6 < widthInTiles) {
_data.push(uint(_local7[_local6]));
_local6++;
};
};
_local9++;
};
_p = new Point();
_tileSize = _arg3;
width = (widthInTiles * _tileSize);
height = (heightInTiles * _tileSize);
_pixels = FlxG.addBitmap(_arg2);
var _local10:uint = (widthInTiles * heightInTiles);
_rects = new Array(_local10);
var _local11:uint;
while (_local11 < _local10) {
setTileByIndex(_local11, _data[_local11]);
_local11++;
};
_block = new FlxCore();
_block.width = _tileSize;
_block.height = _tileSize;
_block.fixed = true;
_screenRows = (Math.ceil((FlxG.height / _tileSize)) + 1);
if (_screenRows > heightInTiles){
_screenRows = heightInTiles;
};
_screenCols = (Math.ceil((FlxG.width / _tileSize)) + 1);
if (_screenCols > widthInTiles){
_screenCols = widthInTiles;
};
_callbacks = new Array();
}
public function getTile(_arg1:uint, _arg2:uint):uint{
return (_data[((_arg2 * widthInTiles) + _arg1)]);
}
public function setTileCallback(_arg1:uint, _arg2:Function, _arg3:uint=1):void{
if (_arg3 <= 0){
return;
};
var _local4:uint = _arg1;
while (_local4 < (_arg1 + _arg3)) {
_callbacks[_local4] = _arg2;
_local4++;
};
}
override public function render():void{
var _local5:uint;
var _local6:uint;
super.render();
getScreenXY(_p);
var _local1:int = Math.floor((-(_p.x) / _tileSize));
var _local2:int = Math.floor((-(_p.y) / _tileSize));
if (_local1 < 0){
_local1 = 0;
};
if (_local1 > (widthInTiles - _screenCols)){
_local1 = (widthInTiles - _screenCols);
};
if (_local2 < 0){
_local2 = 0;
};
if (_local2 > (heightInTiles - _screenRows)){
_local2 = (heightInTiles - _screenRows);
};
var _local3:int = ((_local2 * widthInTiles) + _local1);
_p.x = (_p.x + (_local1 * _tileSize));
_p.y = (_p.y + (_local2 * _tileSize));
var _local4:int = _p.x;
var _local7:uint;
while (_local7 < _screenRows) {
_local6 = _local3;
_local5 = 0;
while (_local5 < _screenCols) {
if (_rects[_local6] != null){
FlxG.buffer.copyPixels(_pixels, _rects[_local6], _p, null, null, true);
};
_local6++;
_p.x = (_p.x + _tileSize);
_local5++;
};
_local3 = (_local3 + widthInTiles);
_p.x = _local4;
_p.y = (_p.y + _tileSize);
_local7++;
};
}
public function setTileByIndex(_arg1:uint, _arg2:uint):void{
_data[_arg1] = _arg2;
var _local3:uint = (_arg2 * _tileSize);
var _local4:uint;
if (_local3 > _pixels.width){
_local4 = (uint((_local3 / _pixels.width)) * _tileSize);
_local3 = (_local3 % _pixels.width);
};
if (_arg2 >= _di){
_rects[_arg1] = new Rectangle(_local3, _local4, _tileSize, _tileSize);
} else {
_rects[_arg1] = null;
};
}
public function setTile(_arg1:uint, _arg2:uint, _arg3:uint):void{
setTileByIndex(((_arg2 * widthInTiles) + _arg1), _arg3);
}
public function follow():void{
FlxG.followBounds(x, y, width, height);
}
override public function collide(_arg1:FlxCore):Boolean{
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:Array;
_local6 = new Array();
var _local7:uint = Math.floor(((_arg1.x - x) / _tileSize));
var _local8:uint = Math.floor(((_arg1.y - y) / _tileSize));
var _local9:uint = (Math.ceil((_arg1.width / _tileSize)) + 1);
var _local10:uint = (Math.ceil((_arg1.height / _tileSize)) + 1);
var _local11:uint;
while (_local11 < _local10) {
if ((((_local11 < 0)) || ((_local11 >= heightInTiles)))){
break;
};
_local3 = (((_local8 + _local11) * widthInTiles) + _local7);
_local2 = 0;
while (_local2 < _local9) {
if ((((_local2 < 0)) || ((_local2 >= widthInTiles)))){
break;
};
_local5 = _data[(_local3 + _local2)];
if (_local5 >= _ci){
_local6.push({x:(x + ((_local7 + _local2) * _tileSize)), y:(y + ((_local8 + _local11) * _tileSize)), data:_local5});
};
_local2++;
};
_local11++;
};
var _local12:Boolean;
_local4 = 0;
while (_local4 < _local6.length) {
_block.last.x = (_block.x = _local6[_local4].x);
_block.last.y = (_block.y = _local6[_local4].y);
if (_block.collideX(_arg1)){
_local3 = _local6[_local4].data;
if (_callbacks[_local3] != null){
var _local14 = _callbacks;
_local14[_local3](_arg1, (_block.x / _tileSize), (_block.y / _tileSize), _local3);
};
_local12 = true;
};
_local4++;
};
var _local13:Boolean;
_local4 = 0;
while (_local4 < _local6.length) {
_block.last.x = (_block.x = _local6[_local4].x);
_block.last.y = (_block.y = _local6[_local4].y);
if (_block.collideY(_arg1)){
_local3 = _local6[_local4].data;
if (_callbacks[_local3] != null){
_local14 = _callbacks;
_local14[_local3](_arg1, (_block.x / _tileSize), (_block.y / _tileSize), _local3);
};
_local13 = true;
};
_local4++;
};
return (((_local12) || (_local13)));
}
public static function arrayToCSV(_arg1:Array, _arg2:int):String{
var _local3:String;
var _local6:int;
var _local4:int = (_arg1.length / _arg2);
var _local5:int;
while (_local5 < _local4) {
_local6 = 0;
while (_local6 < _arg2) {
if (_local6 == 0){
if (_local5 == 0){
_local3 = (_local3 + _arg1[0]);
} else {
_local3 = (_local3 + ("\n" + _arg1[(_local5 * _arg2)]));
};
} else {
_local3 = (_local3 + (", " + _arg1[((_local5 * _arg2) + _local6)]));
};
_local6++;
};
_local5++;
};
return (_local3);
}
}
}//package org.flixel
Section 46
//Alien (xplor.Alien)
package xplor {
import org.flixel.*;
public class Alien extends FlxSprite {
private const mapHeight:int = 84;
private const mapWidth:int = 188;
protected var BlastImage:Class;
protected var dieSnd:Class;
protected var boom:FlxEmitter;
protected var AlienImage:Class;
protected var hitSnd:Class;
protected var map:Array;
protected static const HEALTH:int = 3;
protected static const SPEED:Number = 20;
public function Alien(_arg1:int, _arg2:int, _arg3:Array){
AlienImage = Alien_AlienImage;
BlastImage = Alien_BlastImage;
dieSnd = Alien_dieSnd;
hitSnd = Alien_hitSnd;
super(AlienImage, (_arg1 * 16), (_arg2 * 16), true, true);
this.map = _arg3;
addAnimation("walk", [0, 1, 2, 3], 12, true);
play("walk");
health = HEALTH;
velocity.x = SPEED;
boom = (FlxG.state.add(new FlxEmitter(0, 0, 10, 10, null, -1, -60, 60, -60, 60, -720, 720, 10, 0, BlastImage, 8, true)) as FlxEmitter);
}
override public function hitWall(_arg1:FlxCore=null):Boolean{
this.velocity.x = -(this.velocity.x);
if (velocity.x > 0){
facing = RIGHT;
} else {
facing = LEFT;
};
return (true);
}
override public function hurt(_arg1:Number):void{
super.hurt(_arg1);
if (dead){
FlxG.play(dieSnd, Xplor.FX_VOL);
boom.x = (x + (width / 2));
boom.y = (y + (height / 2));
boom.restart();
return;
};
FlxG.play(hitSnd, Xplor.FX_VOL);
velocity.x = -(velocity.x);
if (velocity.x > 0){
facing = RIGHT;
} else {
facing = LEFT;
};
}
override public function update():void{
var _local1:int;
var _local2:int;
super.update();
_local1 = ((this.x + 8) + (velocity.x / 5));
_local2 = (this.y + 16);
_local1 = (_local1 / 16);
_local2 = (_local2 / 16);
if (map[(_local1 + (_local2 * mapWidth))] < 50){
velocity.x = -(velocity.x);
};
if (velocity.x > 0){
facing = RIGHT;
} else {
facing = LEFT;
};
}
}
}//package xplor
Section 47
//Alien_AlienImage (xplor.Alien_AlienImage)
package xplor {
import mx.core.*;
public class Alien_AlienImage extends BitmapAsset {
}
}//package xplor
Section 48
//Alien_BlastImage (xplor.Alien_BlastImage)
package xplor {
import mx.core.*;
public class Alien_BlastImage extends BitmapAsset {
}
}//package xplor
Section 49
//Alien_dieSnd (xplor.Alien_dieSnd)
package xplor {
import mx.core.*;
public class Alien_dieSnd extends SoundAsset {
}
}//package xplor
Section 50
//Alien_hitSnd (xplor.Alien_hitSnd)
package xplor {
import mx.core.*;
public class Alien_hitSnd extends SoundAsset {
}
}//package xplor
Section 51
//Alien2 (xplor.Alien2)
package xplor {
import org.flixel.*;
public class Alien2 extends FlxSprite {
protected var BlastImage:Class;
protected var dieSnd:Class;
protected var boom:FlxEmitter;
protected var AlienImage:Class;
protected var map:Array;
protected var hitSnd:Class;
protected static const HEALTH:int = 1;
protected static const SPEED:Number = 20;
public function Alien2(_arg1:int, _arg2:int, _arg3:Array){
AlienImage = Alien2_AlienImage;
BlastImage = Alien2_BlastImage;
dieSnd = Alien2_dieSnd;
hitSnd = Alien2_hitSnd;
super(AlienImage, (_arg1 * 16), (_arg2 * 16), true, true);
this.map = _arg3;
addAnimation("float", [0, 1, 2, 3], 16, true);
play("float");
health = HEALTH;
velocity.y = SPEED;
boom = (FlxG.state.add(new FlxEmitter(0, 0, 10, 10, null, -1, -60, 60, -60, 60, -720, 720, 10, 0, BlastImage, 8, true)) as FlxEmitter);
}
override public function hitCeiling(_arg1:FlxCore=null):Boolean{
this.velocity.y = SPEED;
if (Math.random() < 0.5){
this.facing = LEFT;
} else {
this.facing = RIGHT;
};
return (true);
}
override public function hurt(_arg1:Number):void{
super.hurt(_arg1);
if (dead){
FlxG.play(dieSnd, Xplor.FX_VOL);
boom.x = (x + (width / 2));
boom.y = (y + (height / 2));
boom.restart();
return;
};
FlxG.play(hitSnd, Xplor.FX_VOL);
velocity.y = -(velocity.y);
}
override public function update():void{
var _local1:int;
var _local2:int;
super.update();
}
override public function hitFloor(_arg1:FlxCore=null):Boolean{
this.velocity.y = -(SPEED);
if (Math.random() < 0.5){
this.facing = LEFT;
} else {
this.facing = RIGHT;
};
return (true);
}
}
}//package xplor
Section 52
//Alien2_AlienImage (xplor.Alien2_AlienImage)
package xplor {
import mx.core.*;
public class Alien2_AlienImage extends BitmapAsset {
}
}//package xplor
Section 53
//Alien2_BlastImage (xplor.Alien2_BlastImage)
package xplor {
import mx.core.*;
public class Alien2_BlastImage extends BitmapAsset {
}
}//package xplor
Section 54
//Alien2_dieSnd (xplor.Alien2_dieSnd)
package xplor {
import mx.core.*;
public class Alien2_dieSnd extends SoundAsset {
}
}//package xplor
Section 55
//Alien2_hitSnd (xplor.Alien2_hitSnd)
package xplor {
import mx.core.*;
public class Alien2_hitSnd extends SoundAsset {
}
}//package xplor
Section 56
//Bomb (xplor.Bomb)
package xplor {
import org.flixel.*;
public class Bomb extends FlxSprite {
private var LaserImage:Class;
protected var shootSnd:Class;
protected var hitSnd:Class;
public function Bomb(){
LaserImage = Bomb_LaserImage;
shootSnd = Bomb_shootSnd;
hitSnd = Bomb_hitSnd;
super(LaserImage, 0, 0, true, true);
exists = false;
addAnimation("shoot", [1, 2, 3, 2], 30, true);
addAnimation("pop", [1, 2, 3], 50, false);
}
override public function update():void{
acceleration.y = 420;
if (((dead) && (finished))){
exists = false;
} else {
super.update();
};
}
override public function hitCeiling(_arg1:FlxCore=null):Boolean{
hurt(0);
FlxG.play(hitSnd, Xplor.FX_VOL);
return (true);
}
override public function hurt(_arg1:Number):void{
if (dead){
return;
};
velocity.x = 0;
velocity.y = 0;
dead = true;
play("pop");
}
override public function hitFloor(_arg1:FlxCore=null):Boolean{
hurt(0);
FlxG.play(hitSnd, Xplor.FX_VOL);
return (true);
}
override public function hitWall(_arg1:FlxCore=null):Boolean{
hurt(0);
FlxG.play(hitSnd, Xplor.FX_VOL);
return (true);
}
public function shoot(_arg1:int, _arg2:int, _arg3:int, _arg4:int):void{
super.reset(_arg1, _arg2);
velocity.x = _arg3;
velocity.y = _arg4;
if (velocity.x > 0){
facing = RIGHT;
} else {
facing = LEFT;
};
FlxG.play(shootSnd, Xplor.FX_VOL);
play("shoot");
}
}
}//package xplor
Section 57
//Bomb_hitSnd (xplor.Bomb_hitSnd)
package xplor {
import mx.core.*;
public class Bomb_hitSnd extends SoundAsset {
}
}//package xplor
Section 58
//Bomb_LaserImage (xplor.Bomb_LaserImage)
package xplor {
import mx.core.*;
public class Bomb_LaserImage extends BitmapAsset {
}
}//package xplor
Section 59
//Bomb_shootSnd (xplor.Bomb_shootSnd)
package xplor {
import mx.core.*;
public class Bomb_shootSnd extends SoundAsset {
}
}//package xplor
Section 60
//Boss (xplor.Boss)
package xplor {
import org.flixel.*;
public class Boss extends FlxSprite {
protected var BlastImage:Class;
protected var maxReload:Number;
protected var dieSnd:Class;
protected var boom:FlxEmitter;
protected var player:Player;
protected var bombs:Array;
protected var AlienImage:Class;
protected var reload:Number;
protected var map:Array;
protected var hitSnd:Class;
protected static const HEALTH:int = 50;
protected static const SPEED:Number = 20;
public function Boss(_arg1:int, _arg2:int, _arg3:Array, _arg4:Array, _arg5:Player){
AlienImage = Boss_AlienImage;
BlastImage = Boss_BlastImage;
dieSnd = Boss_dieSnd;
hitSnd = Boss_hitSnd;
super(AlienImage, (_arg1 * 16), (_arg2 * 16), true, true);
this.player = _arg5;
this.bombs = _arg4;
this.map = _arg3;
addAnimation("chomp", [0, 1, 2, 3, 2, 1], 5, true);
play("chomp");
health = HEALTH;
velocity.x = SPEED;
acceleration.y = 420;
this.offset.x = 0;
this.offset.y = 28;
this.width = 64;
this.height = 34;
reload = 0;
maxReload = 1;
boom = (FlxG.state.add(new FlxEmitter(0, 28, 64, 34, null, -3, -60, 60, -60, 60, -720, 720, 10, 0, BlastImage, 30, true)) as FlxEmitter);
}
override public function update():void{
var _local1:int;
var _local2:int;
var _local3:Bomb;
if (reload){
reload = (reload - FlxG.elapsed);
if (reload < 0){
reload = 0;
};
};
_local1 = (x + (width / 2));
_local2 = (y + (height / 2));
super.update();
if (reload == 0){
reload = maxReload;
if ((((((((player.x < (x - 240))) || ((player.x > (x + 240))))) || ((player.y < (y - 180))))) || ((player.y > (y + 180))))){
return;
};
for each (_local3 in bombs) {
if (_local3.exists == false){
_local3.shoot(_local1, _local2, -120, -200);
break;
};
};
for each (_local3 in bombs) {
if (_local3.exists == false){
_local3.shoot(_local1, _local2, 120, -200);
break;
};
};
};
}
override public function hitWall(_arg1:FlxCore=null):Boolean{
this.velocity.x = -(this.velocity.x);
if (velocity.x > 0){
facing = RIGHT;
} else {
facing = LEFT;
};
return (true);
}
override public function hurt(_arg1:Number):void{
super.hurt(_arg1);
if (dead){
FlxG.play(dieSnd, Xplor.FX_VOL);
boom.x = (x + (width / 2));
boom.y = (y + (height / 2));
boom.restart();
return;
};
FlxG.play(hitSnd, Xplor.FX_VOL);
this.velocity.x = (this.velocity.x * 1.05);
maxReload = (maxReload * 0.95);
}
}
}//package xplor
Section 61
//Boss_AlienImage (xplor.Boss_AlienImage)
package xplor {
import mx.core.*;
public class Boss_AlienImage extends BitmapAsset {
}
}//package xplor
Section 62
//Boss_BlastImage (xplor.Boss_BlastImage)
package xplor {
import mx.core.*;
public class Boss_BlastImage extends BitmapAsset {
}
}//package xplor
Section 63
//Boss_dieSnd (xplor.Boss_dieSnd)
package xplor {
import mx.core.*;
public class Boss_dieSnd extends SoundAsset {
}
}//package xplor
Section 64
//Boss_hitSnd (xplor.Boss_hitSnd)
package xplor {
import mx.core.*;
public class Boss_hitSnd extends SoundAsset {
}
}//package xplor
Section 65
//Drip (xplor.Drip)
package xplor {
import org.flixel.*;
public class Drip extends FlxSprite {
protected var player:Player;
protected var BlastImage:Class;
protected var dieSnd:Class;
protected var boom:FlxEmitter;
protected var bombs:Array;
protected var AlienImage:Class;
protected var reload:Number;
protected var map:Array;
protected var hitSnd:Class;
protected static const HEALTH:int = 4;
protected static const SPEED:Number = 20;
public function Drip(_arg1:int, _arg2:int, _arg3:Array, _arg4:Array, _arg5:Player){
AlienImage = Drip_AlienImage;
BlastImage = Drip_BlastImage;
dieSnd = Drip_dieSnd;
hitSnd = Drip_hitSnd;
super(AlienImage, (_arg1 * 16), (_arg2 * 16), true, true);
this.player = _arg5;
this.bombs = _arg4;
this.map = _arg3;
addAnimation("wiggle", [0, 1, 2, 1, 0, 1, 3, 1], 10, true);
play("wiggle");
health = HEALTH;
reload = 0;
boom = (FlxG.state.add(new FlxEmitter(0, 0, 10, 10, null, -1, -60, 60, -60, 60, -720, 720, 10, 0, BlastImage, 8, true)) as FlxEmitter);
}
override public function hurt(_arg1:Number):void{
super.hurt(_arg1);
if (dead){
FlxG.play(dieSnd, Xplor.FX_VOL);
boom.x = (x + (width / 2));
boom.y = (y + (height / 2));
boom.restart();
return;
};
FlxG.play(hitSnd, Xplor.FX_VOL);
}
override public function update():void{
var _local1:int;
var _local2:int;
var _local3:Bomb;
if ((((((((player.x < (x - 240))) || ((player.x > (x + 240))))) || ((player.y < (y - 180))))) || ((player.y > (y + 180))))){
return;
};
if (reload){
reload = (reload - FlxG.elapsed);
if (reload < 0){
reload = 0;
};
};
_local1 = ((x + (width / 2)) - 4);
_local2 = (y + (height / 2));
super.update();
if (reload == 0){
reload = 1;
for each (_local3 in bombs) {
if (_local3.exists == false){
_local3.shoot(_local1, _local2, 0, 100);
break;
};
};
};
}
}
}//package xplor
Section 66
//Drip_AlienImage (xplor.Drip_AlienImage)
package xplor {
import mx.core.*;
public class Drip_AlienImage extends BitmapAsset {
}
}//package xplor
Section 67
//Drip_BlastImage (xplor.Drip_BlastImage)
package xplor {
import mx.core.*;
public class Drip_BlastImage extends BitmapAsset {
}
}//package xplor
Section 68
//Drip_dieSnd (xplor.Drip_dieSnd)
package xplor {
import mx.core.*;
public class Drip_dieSnd extends SoundAsset {
}
}//package xplor
Section 69
//Drip_hitSnd (xplor.Drip_hitSnd)
package xplor {
import mx.core.*;
public class Drip_hitSnd extends SoundAsset {
}
}//package xplor
Section 70
//InstrState (xplor.InstrState)
package xplor {
import org.flixel.*;
public class InstrState extends FlxState {
protected var BtnOnImage:Class;
protected var btn_on:FlxSprite;
protected var btn:FlxButton;
protected var CursorImage:Class;
protected var BtnOffImage:Class;
protected var btnText:FlxText;
protected var btn_off:FlxSprite;
protected var TilesImage:Class;
protected var map:FlxTilemap;
public function InstrState():void{
var _local2:int;
var _local3:int;
TilesImage = InstrState_TilesImage;
BtnOffImage = InstrState_BtnOffImage;
BtnOnImage = InstrState_BtnOnImage;
CursorImage = InstrState_CursorImage;
super();
var _local1:Array = new Array();
_local3 = 0;
while (_local3 < 15) {
_local2 = 0;
while (_local2 < 20) {
_local1[(_local2 + (_local3 * 20))] = 0;
_local2++;
};
_local3++;
};
map = new FlxTilemap(FlxTilemap.arrayToCSV(_local1, 20), TilesImage, 16, 1, 1);
this.add(map);
ItemDesc(4, 0, 3, "Jump Jets", "Press Z to jump");
ItemDesc(5, 10, 3, "Blaster", "Press X to shoot lazorz");
ItemDesc(7, 0, 5, "Super Jump Jets", "Jump again in midair");
ItemDesc(15, 10, 5, "Super Blaster", "Hold X for insane blasting");
ItemDesc(8, 0, 7, "Rocket Riser", "Down+Z to rocket upwards");
ItemDesc(9, 10, 7, "Dash Rocket", "Double-tap forward to zip");
ItemDesc(25, 0, 9, "Mega Missile", "Down+X to fire missiles");
ItemDesc(11, 10, 9, "Red Key", "Not a boxing glove");
ItemDesc(12, 0, 11, "Green Key", "Opens green gates");
ItemDesc(13, 10, 11, "Blue Key", "MYSTERY EFFECT!!!");
FlxG.scroll.x = 4;
FlxG.scroll.y = 16;
this.add(new FlxText(-4, (20 - 16), FlxG.width, "Find the kitty! Arrow keys steer your robot.", 4294967295, null, 8, "center"));
this.add(new FlxText(-4, (30 - 16), FlxG.width, "Collect power-ups to avoid being totally obsolete.", 4294967295, null, 8, "center"));
this.add(new FlxText(-4, (40 - 16), FlxG.width, "Dying adds :20 to your time. Blast aliens to subtract :01.", 4294967295, null, 8, "center"));
(this.add(new FlxText(-4, -16, FlxG.width, "Instructions", 4294967295, null, 16, "center")) as FlxText);
btn_off = new FlxSprite(BtnOffImage, 0, 0);
btn_on = new FlxSprite(BtnOnImage, 0, 0);
btnText = new FlxText(0, 4, 64, "Back", 0xFFFFFF, null, 8, "center");
btn = new FlxButton((128 - 4), (212 - 16), btn_off, BtnClick, btn_on, btnText, null);
this.add(btn);
FlxG.showCursor(CursorImage);
}
override public function update():void{
if (((FlxG.keys.Z) || (FlxG.keys.Y))){
FlxG.fade(4278190080, 0.5, onFade);
};
super.update();
}
public function ItemDesc(_arg1:int, _arg2:int, _arg3:int, _arg4:String, _arg5:String):void{
map.setTile(_arg2, _arg3, _arg1);
(this.add(new FlxText(((_arg2 * 16) + 16), ((_arg3 * 16) - 4), 200, _arg4, 4294967295, null, 8, "left")) as FlxText);
(this.add(new FlxText(((_arg2 * 16) + 16), (((_arg3 * 16) - 4) + 10), 200, _arg5, 4294967295, null, 8, "left")) as FlxText);
}
public function BtnClick():void{
FlxG.fade(4278190080, 0.5, onFade);
}
private function onFade():void{
FlxG.switchState(TitleState);
}
}
}//package xplor
Section 71
//InstrState_BtnOffImage (xplor.InstrState_BtnOffImage)
package xplor {
import mx.core.*;
public class InstrState_BtnOffImage extends BitmapAsset {
}
}//package xplor
Section 72
//InstrState_BtnOnImage (xplor.InstrState_BtnOnImage)
package xplor {
import mx.core.*;
public class InstrState_BtnOnImage extends BitmapAsset {
}
}//package xplor
Section 73
//InstrState_CursorImage (xplor.InstrState_CursorImage)
package xplor {
import mx.core.*;
public class InstrState_CursorImage extends BitmapAsset {
}
}//package xplor
Section 74
//InstrState_TilesImage (xplor.InstrState_TilesImage)
package xplor {
import mx.core.*;
public class InstrState_TilesImage extends BitmapAsset {
}
}//package xplor
Section 75
//JetFire (xplor.JetFire)
package xplor {
import org.flixel.*;
public class JetFire extends FlxSprite {
protected var p:Player;
protected var rocketPic:Class;
public function JetFire(_arg1:Player){
rocketPic = JetFire_rocketPic;
super(rocketPic, 0, 0, true, true);
this.p = _arg1;
addAnimation("idle", [0], 0, true);
play("idle");
}
override public function update():void{
x = (p.x - 4);
y = (p.y + 8);
if (facing == LEFT){
facing = RIGHT;
} else {
facing = LEFT;
};
}
}
}//package xplor
Section 76
//JetFire_rocketPic (xplor.JetFire_rocketPic)
package xplor {
import mx.core.*;
public class JetFire_rocketPic extends BitmapAsset {
}
}//package xplor
Section 77
//Kitty (xplor.Kitty)
package xplor {
import org.flixel.*;
public class Kitty extends FlxSprite {
protected var KittyImage:Class;
public function Kitty(_arg1:int, _arg2:int){
KittyImage = Kitty_KittyImage;
super(KittyImage, (_arg1 * 16), (_arg2 * 16), true, true);
addAnimation("idle", [0, 1, 0, 2], 4, true);
play("idle");
}
}
}//package xplor
Section 78
//Kitty_KittyImage (xplor.Kitty_KittyImage)
package xplor {
import mx.core.*;
public class Kitty_KittyImage extends BitmapAsset {
}
}//package xplor
Section 79
//Laser (xplor.Laser)
package xplor {
import org.flixel.*;
public class Laser extends FlxSprite {
private var LaserImage:Class;
protected var shootSnd:Class;
protected var hitSnd:Class;
public function Laser(){
LaserImage = Laser_LaserImage;
shootSnd = Laser_shootSnd;
hitSnd = Laser_hitSnd;
super(LaserImage, 0, 0, true, true);
exists = false;
addAnimation("shoot", [0]);
addAnimation("pop", [1, 2, 3], 50, false);
}
override public function update():void{
if (((dead) && (finished))){
exists = false;
} else {
super.update();
};
}
override public function hitCeiling(_arg1:FlxCore=null):Boolean{
hurt(0);
FlxG.play(hitSnd, Xplor.FX_VOL);
return (true);
}
override public function hurt(_arg1:Number):void{
if (dead){
return;
};
velocity.x = 0;
velocity.y = 0;
dead = true;
play("pop");
}
override public function hitFloor(_arg1:FlxCore=null):Boolean{
hurt(0);
FlxG.play(hitSnd, Xplor.FX_VOL);
return (true);
}
override public function hitWall(_arg1:FlxCore=null):Boolean{
hurt(0);
FlxG.play(hitSnd, Xplor.FX_VOL);
return (true);
}
public function shoot(_arg1:int, _arg2:int, _arg3:int, _arg4:int):void{
super.reset(_arg1, _arg2);
velocity.x = _arg3;
velocity.y = _arg4;
if (velocity.x > 0){
facing = RIGHT;
} else {
facing = LEFT;
};
FlxG.play(shootSnd, Xplor.FX_VOL);
play("shoot");
}
}
}//package xplor
Section 80
//Laser_hitSnd (xplor.Laser_hitSnd)
package xplor {
import mx.core.*;
public class Laser_hitSnd extends SoundAsset {
}
}//package xplor
Section 81
//Laser_LaserImage (xplor.Laser_LaserImage)
package xplor {
import mx.core.*;
public class Laser_LaserImage extends BitmapAsset {
}
}//package xplor
Section 82
//Laser_shootSnd (xplor.Laser_shootSnd)
package xplor {
import mx.core.*;
public class Laser_shootSnd extends SoundAsset {
}
}//package xplor
Section 83
//LogoState (xplor.LogoState)
package xplor {
import org.flixel.*;
import flash.display.*;
public class LogoState extends FlxState {
protected var bloop:Array;
protected var ticker:Number;
protected var logoX:Number;
protected var insBtn:FlxButton;
protected var textsUp:int;
protected var logoBitmap:Bitmap;
protected var stBtn:FlxButton;
protected var kdx:Number;
protected var kdy:Number;
protected var tileMap:FlxTilemap;
protected var LogoImage:Class;
protected var kitty:FlxSprite;
protected var title:FlxSprite;
protected var PlayerImage:Class;
protected var goto:int;
protected var texts:Array;
protected var KittyImage:Class;
protected var textClock:Number;
protected var robot:FlxSprite;
protected var bloop1:Class;
protected var bloop2:Class;
protected var bloop3:Class;
protected var bloop4:Class;
protected var bloop5:Class;
protected var bloop6:Class;
protected var ky:Number;
protected var kx:Number;
protected var TilesImage:Class;
public function LogoState():void{
LogoImage = LogoState_LogoImage;
TilesImage = LogoState_TilesImage;
PlayerImage = LogoState_PlayerImage;
KittyImage = LogoState_KittyImage;
bloop1 = LogoState_bloop1;
bloop2 = LogoState_bloop2;
bloop3 = LogoState_bloop3;
bloop4 = LogoState_bloop4;
bloop5 = LogoState_bloop5;
bloop6 = LogoState_bloop6;
super();
logoBitmap = (new LogoImage() as Bitmap);
logoBitmap.x = 640;
logoBitmap.y = ((480 - 124) / 2);
logoX = 640;
LoadTitleMap();
robot = (this.add(new FlxSprite(PlayerImage, 20, 208, true, false)) as FlxSprite);
robot.scrollFactor.x = 0;
robot.addAnimation("go", [1, 2], 10, true);
robot.play("go");
kitty = (this.add(new FlxSprite(KittyImage, 280, 188, false, false)) as FlxSprite);
kitty.scrollFactor.x = 0;
kx = 280;
ky = 188;
kdx = 0;
kdy = 0;
ticker = 0;
bloop = new Array(bloop1, bloop2, bloop3, bloop4, bloop5, bloop6);
texts = new Array();
var _local1:Array = new Array("FREE", "INTERNET", "GAMES", "TO", "THE", "MAX");
var _local2:Array = new Array(60, 90, 145, 182, 203, 231);
var _local3:int;
while (_local3 < _local1.length) {
texts[_local3] = new FlxText(_local2[_local3], 150, 100, _local1[_local3], 4294967295, null, 8, "left");
(texts[_local3] as FlxText).exists = false;
(texts[_local3] as FlxText).scrollFactor.x = 0;
add((texts[_local3] as FlxText));
_local3++;
};
textsUp = 0;
textClock = 0;
FlxG._game.addChild(logoBitmap);
}
override public function update():void{
if (logoX > ((640 - 625) / 2)){
logoX = (logoX - (FlxG.elapsed * 400));
logoBitmap.x = logoX;
} else {
textClock = (textClock + FlxG.elapsed);
if (textClock > 0.25){
textClock = (textClock - 0.25);
if (textsUp < 6){
(texts[textsUp] as FlxText).exists = true;
FlxG.play((bloop[textsUp] as Class), 0.5, false);
};
textsUp++;
};
};
if (textsUp >= 15){
logoBitmap.alpha = (logoBitmap.alpha * 0.9);
};
if (textsUp == 15){
FlxG.fade(4278190080, 0.5, onFade);
};
if (kx < 300){
kdx = (kdx + 0.02);
};
if (kx > 300){
kdx = (kdx - 0.02);
};
if (ky < 180){
kdy = (kdy + 0.02);
};
if (ky > 180){
kdy = (kdy - 0.02);
};
kx = (kx + kdx);
ky = (ky + kdy);
kitty.x = kx;
kitty.y = ky;
ticker = (ticker + FlxG.elapsed);
while (ticker >= 0.07) {
FlxG.scroll.x--;
if (FlxG.scroll.x < -31){
FlxG.scroll.x = (FlxG.scroll.x + 32);
};
ticker = (ticker - 0.07);
};
super.update();
}
public function LoadTitleMap():void{
var _local2:int;
var _local3:int;
var _local1:Array = new Array();
_local3 = 0;
while (_local3 < 15) {
_local2 = 0;
while (_local2 < 22) {
if (_local3 < 14){
_local1[(_local2 + (_local3 * 22))] = ((26 + (_local2 % 2)) + (2 * (_local3 % 2)));
} else {
_local1[(_local2 + (_local3 * 22))] = ((51 + (_local2 % 2)) + (int((_local3 == 15)) * 2));
};
_local2++;
};
_local3++;
};
tileMap = new FlxTilemap(FlxTilemap.arrayToCSV(_local1, 22), TilesImage, 16, 50, 1);
this.add(tileMap);
FlxG.scroll.x = 0;
FlxG.scroll.y = 0;
}
private function onFade():void{
FlxG._game.removeChild(logoBitmap);
FlxG.switchState(TitleState);
}
}
}//package xplor
Section 84
//LogoState_bloop1 (xplor.LogoState_bloop1)
package xplor {
import mx.core.*;
public class LogoState_bloop1 extends SoundAsset {
}
}//package xplor
Section 85
//LogoState_bloop2 (xplor.LogoState_bloop2)
package xplor {
import mx.core.*;
public class LogoState_bloop2 extends SoundAsset {
}
}//package xplor
Section 86
//LogoState_bloop3 (xplor.LogoState_bloop3)
package xplor {
import mx.core.*;
public class LogoState_bloop3 extends SoundAsset {
}
}//package xplor
Section 87
//LogoState_bloop4 (xplor.LogoState_bloop4)
package xplor {
import mx.core.*;
public class LogoState_bloop4 extends SoundAsset {
}
}//package xplor
Section 88
//LogoState_bloop5 (xplor.LogoState_bloop5)
package xplor {
import mx.core.*;
public class LogoState_bloop5 extends SoundAsset {
}
}//package xplor
Section 89
//LogoState_bloop6 (xplor.LogoState_bloop6)
package xplor {
import mx.core.*;
public class LogoState_bloop6 extends SoundAsset {
}
}//package xplor
Section 90
//LogoState_KittyImage (xplor.LogoState_KittyImage)
package xplor {
import mx.core.*;
public class LogoState_KittyImage extends BitmapAsset {
}
}//package xplor
Section 91
//LogoState_LogoImage (xplor.LogoState_LogoImage)
package xplor {
import mx.core.*;
public class LogoState_LogoImage extends BitmapAsset {
}
}//package xplor
Section 92
//LogoState_PlayerImage (xplor.LogoState_PlayerImage)
package xplor {
import mx.core.*;
public class LogoState_PlayerImage extends BitmapAsset {
}
}//package xplor
Section 93
//LogoState_TilesImage (xplor.LogoState_TilesImage)
package xplor {
import mx.core.*;
public class LogoState_TilesImage extends BitmapAsset {
}
}//package xplor
Section 94
//Missile (xplor.Missile)
package xplor {
import org.flixel.*;
public class Missile extends FlxSprite {
protected var shootSnd:Class;
private var missileImage:Class;
protected var hitSnd:Class;
protected var map:FlxTilemap;
public function Missile(_arg1:FlxTilemap){
missileImage = Missile_missileImage;
shootSnd = Missile_shootSnd;
hitSnd = Missile_hitSnd;
super(missileImage, 0, 0, true, false);
this.offset.x = 4;
this.offset.y = 0;
this.width = 8;
this.height = 13;
this.map = _arg1;
exists = false;
addAnimation("shoot", [0, 1], 10, true);
addAnimation("pop", [2, 3], 30, false);
}
override public function hitCeiling(_arg1:FlxCore=null):Boolean{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = ((x + 8) / 16);
_local3 = ((y + 8) / 16);
_local4 = (_local2 - 1);
while (_local4 <= (_local2 + 1)) {
_local5 = (_local3 - 1);
while (_local5 <= (_local3 + 1)) {
if (map.getTile(_local4, _local5) == 66){
map.setTile(_local4, _local5, 0);
};
_local5++;
};
_local4++;
};
hurt(0);
FlxG.play(hitSnd, Xplor.FX_VOL);
return (true);
}
override public function update():void{
acceleration.y = -160;
if (((dead) && (finished))){
exists = false;
} else {
super.update();
};
}
override public function hurt(_arg1:Number):void{
if (dead){
return;
};
velocity.x = 0;
velocity.y = 0;
dead = true;
play("pop");
}
override public function hitFloor(_arg1:FlxCore=null):Boolean{
hurt(0);
FlxG.play(hitSnd, Xplor.FX_VOL);
return (true);
}
override public function hitWall(_arg1:FlxCore=null):Boolean{
hurt(0);
FlxG.play(hitSnd, Xplor.FX_VOL);
return (true);
}
public function shoot(_arg1:int, _arg2:int, _arg3:int, _arg4:int):void{
super.reset(_arg1, _arg2);
velocity.x = _arg3;
velocity.y = _arg4;
FlxG.play(shootSnd, Xplor.FX_VOL);
play("shoot");
}
}
}//package xplor
Section 95
//Missile_hitSnd (xplor.Missile_hitSnd)
package xplor {
import mx.core.*;
public class Missile_hitSnd extends SoundAsset {
}
}//package xplor
Section 96
//Missile_missileImage (xplor.Missile_missileImage)
package xplor {
import mx.core.*;
public class Missile_missileImage extends BitmapAsset {
}
}//package xplor
Section 97
//Missile_shootSnd (xplor.Missile_shootSnd)
package xplor {
import mx.core.*;
public class Missile_shootSnd extends SoundAsset {
}
}//package xplor
Section 98
//Player (xplor.Player)
package xplor {
import org.flixel.*;
public class Player extends FlxSprite {
private const mapWidth:int = 188;
private const mapHeight:int = 84;
protected var dashed:Boolean;
public var rocketTime:Number;
protected var doubleTapDir:int;
protected var dieSnd:Class;
protected var missiles:Array;
protected var powers:Array;
protected var timeToDoubleTap:Number;
protected var dashTime:Number;
protected var startx:int;
protected var starty:int;
protected var jumpSnd:Class;
protected var map:FlxTilemap;
protected var reload:Number;
protected var PlayerImage:Class;
protected var powerupSnd:Class;
protected var bullets:Array;
protected var doorSnd:Class;
protected var rocketSnd:Class;
protected var jet:JetFire;
protected var airjump:int;
protected static const POWER_RAPID:int = 8;
protected static const POWER_JUMP:int = 0;
protected static const POWER_REDKEY:int = 5;
protected static const POWER_DOUBLEJUMP:int = 2;
protected static const POWER_SHOOT:int = 1;
protected static const POWER_DASH:int = 4;
protected static const POWER_ROCKET:int = 3;
protected static const GRAVITY_ACCELERATION:Number = 420;
protected static const PLAYER_RUN_SPEED:int = 80;
protected static const POWER_GRNKEY:int = 7;
protected static const JUMP_ACCELERATION:Number = 200;
protected static const POWER_MISSILE:int = 9;
protected static const POWER_BLUKEY:int = 6;
public function Player(_arg1:int, _arg2:int, _arg3:FlxTilemap, _arg4:Array, _arg5:Array){
PlayerImage = Player_PlayerImage;
dieSnd = Player_dieSnd;
jumpSnd = Player_jumpSnd;
rocketSnd = Player_rocketSnd;
powerupSnd = Player_powerupSnd;
doorSnd = Player_doorSnd;
startx = (_arg1 * 16);
starty = (_arg2 * 16);
this.map = _arg3;
super(PlayerImage, (_arg1 * 16), (_arg2 * 16), true, true);
this.offset.x = 4;
this.offset.y = 2;
this.width = 8;
this.height = 14;
drag.x = (PLAYER_RUN_SPEED * 8);
acceleration.y = GRAVITY_ACCELERATION;
maxVelocity.x = PLAYER_RUN_SPEED;
maxVelocity.y = 1200;
addAnimation("idle", [0], 15, true);
addAnimation("run", [1, 2], 8, true);
addAnimation("jump", [3], 1, true);
addAnimation("duck", [4], 0, true);
addAnimation("dash", [5], 0, true);
addAnimation("rocket", [6], 0, true);
powers = new Array();
this.bullets = _arg4;
this.missiles = _arg5;
reload = 0;
airjump = 0;
timeToDoubleTap = 0;
dashTime = 0;
dashed = false;
this.jet = (FlxG.state.add(new JetFire(this)) as JetFire);
jet.visible = false;
}
override public function hitWall(_arg1:FlxCore=null):Boolean{
var _local2:int;
var _local3:int;
var _local4:int;
if (facing == RIGHT){
_local2 = ((x + 8) / 16);
} else {
_local2 = ((x - 8) / 16);
};
_local3 = ((y + 8) / 16);
if ((((map.getTile(_local2, _local3) == 55)) && ((powers[POWER_REDKEY] == 1)))){
map.setTile(_local2, _local3, 0);
_local4 = 1;
while ((((_local4 > 0)) && ((map.getTile(_local2, (_local3 - _local4)) == 55)))) {
map.setTile(_local2, (_local3 - _local4), 0);
_local4++;
};
_local4 = 1;
while (((((_local3 + _local4) < mapHeight)) && ((map.getTile(_local2, (_local3 + _local4)) == 55)))) {
map.setTile(_local2, (_local3 + _local4), 0);
_local4++;
};
FlxG.play(doorSnd, Xplor.FX_VOL);
};
if ((((map.getTile(_local2, _local3) == 56)) && ((powers[POWER_GRNKEY] == 1)))){
map.setTile(_local2, _local3, 0);
_local4 = 1;
while ((((_local4 > 0)) && ((map.getTile(_local2, (_local3 - _local4)) == 56)))) {
map.setTile(_local2, (_local3 - _local4), 0);
_local4++;
};
_local4 = 1;
while (((((_local3 + _local4) < mapHeight)) && ((map.getTile(_local2, (_local3 + _local4)) == 56)))) {
map.setTile(_local2, (_local3 + _local4), 0);
_local4++;
};
FlxG.play(doorSnd, Xplor.FX_VOL);
};
if ((((map.getTile(_local2, _local3) == 57)) && ((powers[POWER_BLUKEY] == 1)))){
map.setTile(_local2, _local3, 0);
_local4 = 1;
while ((((_local4 > 0)) && ((map.getTile(_local2, (_local3 - _local4)) == 57)))) {
map.setTile(_local2, (_local3 - _local4), 0);
_local4++;
};
_local4 = 1;
while (((((_local3 + _local4) < mapHeight)) && ((map.getTile(_local2, (_local3 + _local4)) == 57)))) {
map.setTile(_local2, (_local3 + _local4), 0);
_local4++;
};
FlxG.play(doorSnd, Xplor.FX_VOL);
};
super.hitWall(_arg1);
return (true);
}
override public function update():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:Missile;
var _local5:int;
var _local6:Laser;
if (timeToDoubleTap > 0){
timeToDoubleTap = (timeToDoubleTap - FlxG.elapsed);
if (timeToDoubleTap < 0){
timeToDoubleTap = 0;
};
};
if (dashTime > 0){
dashTime = (dashTime - FlxG.elapsed);
if (dashTime < 0){
dashTime = 0;
};
} else {
maxVelocity.x = PLAYER_RUN_SPEED;
};
if (reload){
reload = (reload - FlxG.elapsed);
if (reload < 0){
reload = 0;
};
};
if (rocketTime > 0){
velocity.y = (-(JUMP_ACCELERATION) * 2);
rocketTime = (rocketTime - FlxG.elapsed);
if (rocketTime <= 0){
rocketTime = 0;
jet.visible = false;
};
};
acceleration.x = 0;
if (((FlxG.keys.DOWN) && ((velocity.y == 0)))){
play("duck");
if (((FlxG.keys.justPressed("Z")) || (FlxG.keys.justPressed("Y")))){
if (powers[POWER_ROCKET] == 1){
velocity.y = (-(JUMP_ACCELERATION) * 2);
rocketTime = 0.5;
FlxG.play(rocketSnd, Xplor.FX_VOL);
jet.visible = true;
play("rocket");
} else {
if (powers[POWER_JUMP] == 1){
velocity.y = -(JUMP_ACCELERATION);
FlxG.play(jumpSnd, Xplor.FX_VOL);
};
};
};
if (((((FlxG.keys.X) && ((powers[POWER_MISSILE] == 1)))) && ((reload == 0)))){
reload = 0.5;
for each (_local4 in missiles) {
if (_local4.exists == false){
_local4.shoot(x, (y - 8), 0, -80);
break;
};
};
};
} else {
if ((((((((powers[POWER_DASH] == 1)) && (FlxG.keys.justPressed("LEFT")))) && ((dashTime == 0)))) && ((dashed == false)))){
if ((((timeToDoubleTap > 0)) && ((doubleTapDir == LEFT)))){
velocity.y = 0;
velocity.x = -600;
maxVelocity.x = 600;
dashTime = 1;
FlxG.play(rocketSnd, Xplor.FX_VOL);
airjump = 1;
dashed = true;
} else {
timeToDoubleTap = 0.2;
doubleTapDir = LEFT;
};
};
if ((((((((powers[POWER_DASH] == 1)) && (FlxG.keys.justPressed("RIGHT")))) && ((dashTime == 0)))) && ((dashed == false)))){
if ((((timeToDoubleTap > 0)) && ((doubleTapDir == RIGHT)))){
velocity.y = 0;
velocity.x = 600;
maxVelocity.x = 600;
dashTime = 1;
FlxG.play(rocketSnd, Xplor.FX_VOL);
airjump = 1;
dashed = true;
} else {
timeToDoubleTap = 0.2;
doubleTapDir = RIGHT;
};
};
if (FlxG.keys.LEFT){
facing = LEFT;
acceleration.x = -(drag.x);
} else {
if (FlxG.keys.RIGHT){
facing = RIGHT;
acceleration.x = drag.x;
};
};
if (FlxG.keys.X){
if ((((powers[POWER_SHOOT] == 1)) && ((reload == 0)))){
if (facing == LEFT){
_local5 = -180;
} else {
_local5 = 180;
};
reload = 0.3;
if (powers[POWER_RAPID] == 1){
reload = 0.1;
};
for each (_local6 in bullets) {
if (_local6.exists == false){
_local6.shoot(x, y, _local5, 0);
break;
};
};
};
};
if (((FlxG.keys.justPressed("Z")) || (FlxG.keys.justPressed("Y")))){
if ((((powers[POWER_JUMP] == 1)) && (!(velocity.y)))){
velocity.y = -(JUMP_ACCELERATION);
FlxG.play(jumpSnd, Xplor.FX_VOL);
} else {
if ((((powers[POWER_DOUBLEJUMP] == 1)) && ((airjump == 0)))){
airjump = 1;
FlxG.play(jumpSnd, Xplor.FX_VOL);
velocity.y = -(JUMP_ACCELERATION);
};
};
};
if (velocity.y == 0){
if (velocity.x == 0){
play("idle");
} else {
play("run");
};
} else {
play("jump");
};
};
_local2 = ((x + 8) / 16);
_local3 = ((y + 8) / 16);
if (map.getTile(_local2, _local3) == 4){
map.setTile(_local2, _local3, 0);
powers[POWER_JUMP] = 1;
FlxG.play(powerupSnd, Xplor.FX_VOL);
PlayState(FlxG.state).SetHelp(x, y, "Press Z to jump!");
};
if (map.getTile(_local2, _local3) == 5){
map.setTile(_local2, _local3, 0);
powers[POWER_SHOOT] = 1;
FlxG.play(powerupSnd, Xplor.FX_VOL);
PlayState(FlxG.state).SetHelp(x, y, "Press X to fire deadly lazorz!");
};
if ((((map.getTile(_local2, _local3) >= 16)) && ((map.getTile(_local2, _local3) <= 23)))){
Die();
};
if (map.getTile(_local2, _local3) == 7){
map.setTile(_local2, _local3, 0);
powers[POWER_DOUBLEJUMP] = 1;
FlxG.play(powerupSnd, Xplor.FX_VOL);
PlayState(FlxG.state).SetHelp(x, y, "Now you can double-jump!");
};
if (map.getTile(_local2, _local3) == 8){
map.setTile(_local2, _local3, 0);
powers[POWER_ROCKET] = 1;
FlxG.play(powerupSnd, Xplor.FX_VOL);
PlayState(FlxG.state).SetHelp(x, y, "Hold down and press Z to rocket skyward!");
};
if (map.getTile(_local2, _local3) == 9){
map.setTile(_local2, _local3, 0);
powers[POWER_DASH] = 1;
FlxG.play(powerupSnd, Xplor.FX_VOL);
PlayState(FlxG.state).SetHelp(x, y, "Double-tap forward to rocket at ludicrous speed!");
};
if (map.getTile(_local2, _local3) == 11){
map.setTile(_local2, _local3, 0);
powers[POWER_REDKEY] = 1;
FlxG.play(powerupSnd, Xplor.FX_VOL);
PlayState(FlxG.state).SetHelp(x, y, "This is not a boxing glove.");
};
if (map.getTile(_local2, _local3) == 12){
map.setTile(_local2, _local3, 0);
powers[POWER_GRNKEY] = 1;
FlxG.play(powerupSnd, Xplor.FX_VOL);
PlayState(FlxG.state).SetHelp(x, y, "You can open Green Gates now!");
};
if (map.getTile(_local2, _local3) == 13){
map.setTile(_local2, _local3, 0);
powers[POWER_BLUKEY] = 1;
FlxG.play(powerupSnd, Xplor.FX_VOL);
PlayState(FlxG.state).SetHelp(x, y, "WHAT COULD THIS POSSIBLY DO!?!?!");
};
if (map.getTile(_local2, _local3) == 15){
map.setTile(_local2, _local3, 0);
powers[POWER_RAPID] = 1;
FlxG.play(powerupSnd, Xplor.FX_VOL);
PlayState(FlxG.state).SetHelp(x, y, "Hold X to ANNIHILATE.");
};
if (map.getTile(_local2, _local3) == 25){
map.setTile(_local2, _local3, 0);
powers[POWER_MISSILE] = 1;
FlxG.play(powerupSnd, Xplor.FX_VOL);
PlayState(FlxG.state).SetHelp(x, y, "Press X while ducking to fire missiles that smash red bricks.");
};
if (((((!((velocity.y == 0))) && ((dashTime == 0)))) && ((rocketTime == 0)))){
play("jump");
} else {
if (dashTime){
play("dash");
} else {
if (rocketTime){
play("rocket");
};
};
};
super.update();
}
override public function hitFloor(_arg1:FlxCore=null):Boolean{
var _local2:int;
var _local3:int;
velocity.y = 0;
airjump = 0;
if (dashTime == 0){
dashed = false;
};
_local2 = ((x + 8) / 16);
_local3 = ((y + 20) / 16);
var _local4:int = map.getTile(_local2, _local3);
if ((((_local4 >= 58)) && ((_local4 <= 62)))){
PlayState(FlxG.state).SetMusic(1);
} else {
if ((((_local4 >= 50)) && ((_local4 <= 54)))){
PlayState(FlxG.state).SetMusic(0);
} else {
if ((((_local4 >= 63)) && ((_local4 <= 66)))){
PlayState(FlxG.state).SetMusic(2);
};
};
};
return (true);
}
public function Die():void{
x = startx;
y = starty;
velocity.x = 0;
velocity.y = 0;
play("idle");
FlxG.play(dieSnd, Xplor.FX_VOL);
FlxG.quake(0.02, 0.5);
PlayState(FlxG.state).clock = (PlayState(FlxG.state).clock + 20);
}
}
}//package xplor
Section 99
//Player_dieSnd (xplor.Player_dieSnd)
package xplor {
import mx.core.*;
public class Player_dieSnd extends SoundAsset {
}
}//package xplor
Section 100
//Player_doorSnd (xplor.Player_doorSnd)
package xplor {
import mx.core.*;
public class Player_doorSnd extends SoundAsset {
}
}//package xplor
Section 101
//Player_jumpSnd (xplor.Player_jumpSnd)
package xplor {
import mx.core.*;
public class Player_jumpSnd extends SoundAsset {
}
}//package xplor
Section 102
//Player_PlayerImage (xplor.Player_PlayerImage)
package xplor {
import mx.core.*;
public class Player_PlayerImage extends BitmapAsset {
}
}//package xplor
Section 103
//Player_powerupSnd (xplor.Player_powerupSnd)
package xplor {
import mx.core.*;
public class Player_powerupSnd extends SoundAsset {
}
}//package xplor
Section 104
//Player_rocketSnd (xplor.Player_rocketSnd)
package xplor {
import mx.core.*;
public class Player_rocketSnd extends SoundAsset {
}
}//package xplor
Section 105
//PlayState (xplor.PlayState)
package xplor {
import org.flixel.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
public class PlayState extends FlxState {
private const mapHeight:int = 84;
private const mapData:Class;
private const mapWidth:int = 188;
protected var song1Snd:Class;
public var clock:Number;
protected var bombs:Array;
protected var missiles:Array;
protected var helpTxt2:FlxText;
protected var songStarted:Boolean;
protected var enemies:Array;
protected var helpTime:Number;
protected var bullets:Array;
protected var acidTime:Number;
protected var logoBitmap:Bitmap;
protected var money:uint;
protected var songToPlay:int;
protected var song3Snd:Class;
protected var tileMap:FlxTilemap;
protected var LogoImage:Class;
protected var songPlaying:int;
protected var kitty:Kitty;
protected var player:Player;
protected var timeTxt:FlxText;
protected var helpTxt:FlxText;
protected var timeToMusicSwitch:Number;
protected var song2Snd:Class;
protected var backMap:FlxTilemap;
protected var acidList:Array;
protected var TilesImage:Class;
protected var songs:Array;
public function PlayState(){
TilesImage = PlayState_TilesImage;
mapData = PlayState_mapData;
song1Snd = PlayState_song1Snd;
song2Snd = PlayState_song2Snd;
song3Snd = PlayState_song3Snd;
LogoImage = PlayState_LogoImage;
super();
songs = new Array();
songs[0] = new FlxSound();
FlxSound(songs[0]).loadEmbedded(song1Snd, true);
FlxSound(songs[0]).volume = 1;
songs[1] = new FlxSound();
FlxSound(songs[1]).loadEmbedded(song2Snd, true);
FlxSound(songs[1]).volume = 0;
songs[2] = new FlxSound();
FlxSound(songs[2]).loadEmbedded(song3Snd, true);
FlxSound(songs[2]).volume = 0;
FlxSound(songs[0]).play();
FlxSound(songs[1]).play();
FlxSound(songs[2]).play();
songToPlay = 0;
songPlaying = 0;
timeToMusicSwitch = 1;
songStarted = false;
enemies = new Array();
bullets = new Array();
bombs = new Array();
missiles = new Array();
acidTime = 0;
clock = 0;
money = 100;
LoadMap();
var _local1:int;
while (_local1 < 10) {
missiles.push(this.add(new Missile(tileMap)));
_local1++;
};
timeTxt = (this.add(new FlxText(0, 0, 90, "0:00")) as FlxText);
timeTxt.scrollFactor.x = 0;
timeTxt.scrollFactor.y = 0;
helpTxt = new FlxText(0, 95, 320, "Arrow keys to move!", 0xFFFFFF, null, 8, "center");
helpTxt.scrollFactor.x = 0;
helpTxt.scrollFactor.y = 0;
this.add(helpTxt);
helpTxt2 = new FlxText(0, 140, 320, "Collect power-ups to jump, shoot, and more!", 0xFFFFFF, null, 8, "center");
helpTxt2.scrollFactor.x = 0;
helpTxt2.scrollFactor.y = 0;
this.add(helpTxt2);
helpTime = -2;
logoBitmap = (new LogoImage() as Bitmap);
logoBitmap.x = (640 - 160);
logoBitmap.y = 0;
FlxG._game.addChild(logoBitmap);
}
public function SetMusic(_arg1:int):void{
if (_arg1 != songToPlay){
songToPlay = _arg1;
timeToMusicSwitch = 0;
};
}
public function LoadMap():void{
var _local3:int;
var _local4:int;
var _local1:ByteArray = (new mapData() as ByteArray);
var _local2:Array = new Array();
acidList = new Array();
_local4 = 0;
while (_local4 < mapHeight) {
_local3 = 0;
while (_local3 < mapWidth) {
_local2[(_local3 + (_local4 * mapWidth))] = ((26 + (_local3 % 2)) + (2 * (_local4 % 2)));
_local3++;
};
_local4++;
};
backMap = new FlxTilemap(FlxTilemap.arrayToCSV(_local2, mapWidth), TilesImage, 16, 50, 1);
backMap.scrollFactor.x = 0.5;
backMap.scrollFactor.y = 0.5;
this.add(backMap);
var _local5:int;
while (_local5 < 20) {
bullets.push(this.add(new Laser()));
_local5++;
};
_local5 = 0;
while (_local5 < 20) {
bombs.push(this.add(new Bomb()));
_local5++;
};
_local1.position = 0;
_local5 = 0;
while (_local5 < _local1.length) {
_local2[_local5] = int(_local1.readUnsignedByte());
_local5++;
};
tileMap = new FlxTilemap(FlxTilemap.arrayToCSV(_local2, mapWidth), TilesImage, 16, 50, 1);
this.add(tileMap);
_local3 = 0;
_local4 = 0;
_local5 = 0;
while (_local5 < _local1.length) {
_local3++;
if (_local3 == mapWidth){
_local3 = 0;
_local4++;
};
if (_local2[_local5] == 0xFF){
player = new Player((_local5 % mapWidth), (_local5 / mapWidth), tileMap, bullets, missiles);
this.add(player);
FlxG.follow(player, 2.5);
_local2[_local5] = 0;
tileMap.setTileByIndex(_local5, 0);
};
if (_local2[_local5] == 254){
_local2[_local5] = 0;
tileMap.setTileByIndex(_local5, 0);
kitty = new Kitty((_local5 % mapWidth), (_local5 / mapWidth));
this.add(kitty);
};
_local5++;
};
_local3 = 0;
_local4 = 0;
_local5 = 0;
while (_local5 < _local1.length) {
_local3++;
if (_local3 == mapWidth){
_local3 = 0;
_local4++;
};
if (_local2[_local5] == 6){
if ((((_local5 > (mapWidth - 1))) && ((_local2[(_local5 - mapWidth)] == 0)))){
_local2[_local5] = 20;
} else {
_local2[_local5] = 16;
};
acidList.push(_local5);
tileMap.setTileByIndex(_local5, _local2[_local5]);
};
if (_local2[_local5] == 58){
if (((((((((((((((IsYellow((_local3 - 1), _local4, _local2[(_local5 - 1)])) && (IsYellow((_local3 + 1), _local4, _local2[(_local5 + 1)])))) && (IsYellow(_local3, (_local4 - 1), _local2[(_local5 - mapWidth)])))) && (IsYellow(_local3, (_local4 + 1), _local2[(_local5 + mapWidth)])))) && (IsYellow((_local3 - 1), (_local4 - 1), _local2[((_local5 - 1) - mapWidth)])))) && (IsYellow((_local3 + 1), (_local4 - 1), _local2[((_local5 + 1) - mapWidth)])))) && (IsYellow((_local3 - 1), (_local4 + 1), _local2[((_local5 - 1) + mapWidth)])))) && (IsYellow((_local3 + 1), (_local4 + 1), _local2[((_local5 + 1) + mapWidth)])))){
_local2[_local5] = ((59 + (_local5 % 2)) + (2 * ((_local5 / mapWidth) % 2)));
tileMap.setTileByIndex(_local5, _local2[_local5]);
};
};
if (_local2[_local5] == 63){
_local2[_local5] = (63 + int((Math.random() * 3)));
tileMap.setTileByIndex(_local5, _local2[_local5]);
};
if (_local2[_local5] == 3){
_local2[_local5] = 0;
tileMap.setTileByIndex(_local5, 0);
enemies.push(this.add(new Alien((_local5 % mapWidth), (_local5 / mapWidth), _local2)));
};
if (_local2[_local5] == 10){
_local2[_local5] = 0;
tileMap.setTileByIndex(_local5, 0);
enemies.push(this.add(new Alien2((_local5 % mapWidth), (_local5 / mapWidth), _local2)));
};
if (_local2[_local5] == 24){
_local2[_local5] = 0;
tileMap.setTileByIndex(_local5, 0);
enemies.push(this.add(new Drip((_local5 % mapWidth), (_local5 / mapWidth), _local2, bombs, player)));
};
if (_local2[_local5] == 14){
_local2[_local5] = 0;
tileMap.setTileByIndex(_local5, 0);
enemies.push(this.add(new Boss((_local5 % mapWidth), (_local5 / mapWidth), _local2, bombs, player)));
};
if (_local2[_local5] == 50){
if (((((((((((((_local5 % 2) == 0)) && (((_local5 % mapWidth) < (mapWidth - 1))))) && ((_local2[(_local5 + 1)] == 50)))) && (((_local5 / mapWidth) < (mapHeight - 1))))) && ((_local2[(_local5 + mapWidth)] == 50)))) && ((_local2[((_local5 + mapWidth) + 1)] == 50)))){
if (Math.random() < 0.5){
_local2[_local5] = 51;
_local2[(_local5 + 1)] = 52;
_local2[(_local5 + mapWidth)] = 53;
_local2[((_local5 + mapWidth) + 1)] = 54;
tileMap.setTileByIndex(_local5, 51);
tileMap.setTileByIndex((_local5 + 1), 52);
tileMap.setTileByIndex((_local5 + mapWidth), 53);
tileMap.setTileByIndex(((_local5 + mapWidth) + 1), 54);
};
};
};
_local5++;
};
FlxG.followAdjust(0, 0);
tileMap.follow();
}
private function MissileShotGuy(_arg1:FlxSprite, _arg2:FlxSprite):void{
_arg1.hurt(0);
_arg2.hurt(20);
if (_arg2.dead){
clock = (clock - 1);
};
}
public function SetHelp(_arg1:Number, _arg2:Number, _arg3:String):void{
helpTxt.alpha = 1;
helpTxt.text = _arg3;
helpTime = 0;
}
private function PlayerBumped(_arg1:FlxSprite, _arg2:FlxSprite):void{
Player(_arg2).Die();
}
public function TimeText():void{
var _local1:String;
var _local2:int;
_local2 = int(clock);
_local1 = int((_local2 / 60)).toString();
_local1 = (_local1 + ":");
_local2 = (int(clock) % 60);
if (_local2 < 10){
_local1 = (_local1 + "0");
};
_local1 = (_local1 + _local2.toString());
timeTxt.text = _local1;
}
override public function update():void{
var _local2:int;
super.update();
timeToMusicSwitch = (timeToMusicSwitch + FlxG.elapsed);
if (songToPlay != songPlaying){
if (timeToMusicSwitch >= 2){
timeToMusicSwitch = 0;
songPlaying = songToPlay;
};
};
var _local1:int;
while (_local1 < 3) {
if (_local1 != songPlaying){
FlxSound(songs[_local1]).volume = (FlxSound(songs[_local1]).volume - FlxG.elapsed);
} else {
FlxSound(songs[_local1]).volume = (FlxSound(songs[_local1]).volume + FlxG.elapsed);
};
_local1++;
};
clock = (clock + FlxG.elapsed);
helpTime = (helpTime + FlxG.elapsed);
if (helpTime > 4){
helpTxt.alpha = (helpTxt.alpha * 0.95);
helpTxt2.alpha = (helpTxt2.alpha * 0.95);
};
TimeText();
acidTime = (acidTime + FlxG.elapsed);
while (acidTime >= 0.1) {
acidTime = (acidTime - 0.1);
for each (_local1 in acidList) {
_local2 = tileMap.getTile((_local1 % mapWidth), (_local1 / mapWidth));
if ((((_local2 >= 16)) && ((_local2 <= 23)))){
_local2++;
if (_local2 == 20){
_local2 = 16;
};
if (_local2 == 24){
_local2 = 20;
};
tileMap.setTileByIndex(_local1, _local2);
};
};
};
tileMap.collide(player);
tileMap.collideArray(enemies);
tileMap.collideArray(bullets);
tileMap.collideArray(missiles);
tileMap.collideArray(bombs);
FlxG.overlapArray(bombs, player, PlayerBumped);
FlxG.overlapArrays(bullets, enemies, LaserShotGuy);
FlxG.overlapArrays(missiles, enemies, MissileShotGuy);
FlxG.overlapArray(enemies, player, PlayerBumped);
if ((((Math.abs((player.x - kitty.x)) < 30)) && ((Math.abs((player.y - kitty.y)) < 30)))){
FlxG.score = int(clock);
FlxSound(songs[0]).destroy();
FlxSound(songs[1]).destroy();
FlxSound(songs[2]).destroy();
FlxG._game.removeChild(logoBitmap);
FlxG.switchState(WinState);
};
if (((((((FlxG.mouse.x + FlxG.scroll.x) > (320 - 80))) && (((FlxG.mouse.y + FlxG.scroll.y) < 16)))) && (FlxG.mouse.justPressed()))){
navigateToURL(new URLRequest("http://maxgames.com"), "_blank");
};
}
public function IsYellow(_arg1:int, _arg2:int, _arg3:int):Boolean{
return ((((((((((_arg1 < 0)) || ((_arg2 < 0)))) || ((_arg1 > (mapWidth - 1))))) || ((_arg2 > (mapHeight - 1))))) || ((((_arg3 >= 58)) && ((_arg3 <= 62))))));
}
private function LaserShotGuy(_arg1:FlxSprite, _arg2:FlxSprite):void{
_arg1.hurt(0);
_arg2.hurt(1);
if (_arg2.dead){
clock = (clock - 1);
};
}
}
}//package xplor
Section 106
//PlayState_LogoImage (xplor.PlayState_LogoImage)
package xplor {
import mx.core.*;
public class PlayState_LogoImage extends BitmapAsset {
}
}//package xplor
Section 107
//PlayState_mapData (xplor.PlayState_mapData)
package xplor {
import mx.core.*;
public class PlayState_mapData extends ByteArrayAsset {
}
}//package xplor
Section 108
//PlayState_song1Snd (xplor.PlayState_song1Snd)
package xplor {
import mx.core.*;
public class PlayState_song1Snd extends SoundAsset {
}
}//package xplor
Section 109
//PlayState_song2Snd (xplor.PlayState_song2Snd)
package xplor {
import mx.core.*;
public class PlayState_song2Snd extends SoundAsset {
}
}//package xplor
Section 110
//PlayState_song3Snd (xplor.PlayState_song3Snd)
package xplor {
import mx.core.*;
public class PlayState_song3Snd extends SoundAsset {
}
}//package xplor
Section 111
//PlayState_TilesImage (xplor.PlayState_TilesImage)
package xplor {
import mx.core.*;
public class PlayState_TilesImage extends BitmapAsset {
}
}//package xplor
Section 112
//TitleState (xplor.TitleState)
package xplor {
import org.flixel.*;
import flash.net.*;
public class TitleState extends FlxState {
protected var TitleImage:Class;
protected var CursorImage:Class;
protected var BtnOffImage:Class;
protected var btn_off:FlxSprite;
protected var titleSong:Class;
protected var insBtn:FlxButton;
protected var ticker:Number;
protected var BtnOnBigImage:Class;
protected var btn_onbig:FlxSprite;
protected var btn_on:FlxSprite;
protected var moreText:FlxText;
protected var InvisBtn2Image:Class;
protected var btn_off2:FlxSprite;
protected var goto:int;
protected var InvisBtnImage:Class;
protected var kdx:Number;
protected var btn2Txt:FlxText;
protected var stBtn:FlxButton;
protected var copyText:FlxText;
protected var tileMap:FlxTilemap;
protected var kdy:Number;
protected var moreGamesBtn:FlxButton;
protected var hamumuBtn:FlxButton;
protected var btn_on2:FlxSprite;
protected var title:FlxSprite;
protected var PlayerImage:Class;
protected var KittyImage:Class;
protected var petterBtn:FlxButton;
protected var kitty:FlxSprite;
protected var BtnOnImage:Class;
protected var robot:FlxSprite;
protected var kx:Number;
protected var BtnOffBigImage:Class;
protected var petterText:FlxText;
protected var btn1Txt:FlxText;
protected var ky:Number;
protected var TilesImage:Class;
protected var btn_invis1:FlxSprite;
protected var btn_invis2:FlxSprite;
protected var btn_offbig:FlxSprite;
public function TitleState():void{
TitleImage = TitleState_TitleImage;
TilesImage = TitleState_TilesImage;
PlayerImage = TitleState_PlayerImage;
KittyImage = TitleState_KittyImage;
BtnOffImage = TitleState_BtnOffImage;
BtnOnImage = TitleState_BtnOnImage;
BtnOffBigImage = TitleState_BtnOffBigImage;
BtnOnBigImage = TitleState_BtnOnBigImage;
InvisBtnImage = TitleState_InvisBtnImage;
InvisBtn2Image = TitleState_InvisBtn2Image;
CursorImage = TitleState_CursorImage;
titleSong = TitleState_titleSong;
super();
LoadTitleMap();
if ((((FlxG.music == null)) || (!(FlxG.music.active)))){
FlxG.playMusic(titleSong, 1);
};
title = (this.add(new FlxSprite(TitleImage, (160 - (164 / 2)), 10)) as FlxSprite);
title.scrollFactor.x = 0;
robot = (this.add(new FlxSprite(PlayerImage, 20, 208, true, false)) as FlxSprite);
robot.scrollFactor.x = 0;
robot.addAnimation("go", [1, 2], 10, true);
robot.play("go");
kitty = (this.add(new FlxSprite(KittyImage, 280, 188, false, false)) as FlxSprite);
kitty.scrollFactor.x = 0;
kx = 280;
ky = 188;
kdx = 0;
kdy = 0;
btn_off = new FlxSprite(BtnOffImage, 0, 0);
btn_on = new FlxSprite(BtnOnImage, 0, 0);
btn_off2 = new FlxSprite(BtnOffImage, 0, 0);
btn_on2 = new FlxSprite(BtnOnImage, 0, 0);
btn_offbig = new FlxSprite(BtnOffBigImage, 0, 0);
btn_onbig = new FlxSprite(BtnOnBigImage, 0, 0);
btn_invis1 = new FlxSprite(InvisBtnImage, 0, 0);
btn_invis2 = new FlxSprite(InvisBtn2Image, 0, 0);
btn1Txt = new FlxText(0, 5, 64, "Play Game", 0xFFFFFF, null, 8, "center");
btn2Txt = new FlxText(0, 5, 64, "Huh!?", 0xFFFFFF, null, 8, "center");
moreText = new FlxText(-1, 5, 184, "Play More Games at Maxgames.com", 0xFFFFFF, null, 8, "center");
stBtn = new FlxButton(48, 140, btn_off, StartClick, btn_on, btn1Txt, null);
stBtn.scrollFactor.x = 0;
this.add(stBtn);
insBtn = new FlxButton(208, 140, btn_off2, InsClick, btn_on2, btn2Txt, null);
insBtn.scrollFactor.x = 0;
this.add(insBtn);
moreGamesBtn = new FlxButton(68, 180, btn_offbig, MoreClick, btn_onbig, moreText, null);
moreGamesBtn.scrollFactor.x = 0;
this.add(moreGamesBtn);
ticker = 0;
copyText = new FlxText(0, 0, 171, "Copyright 2010, Hamumu Software", 0xFFFFFF, null, 8, "left");
hamumuBtn = new FlxButton(0, 228, btn_invis1, HamumuClick, null, copyText, null);
hamumuBtn.scrollFactor.x = 0;
this.add(hamumuBtn);
petterText = new FlxText(0, 0, 90, "Music by DrPetter", 0xFFFFFF, null, 8, "right");
petterBtn = new FlxButton(230, 228, btn_invis2, PetterClick, null, petterText, null);
petterBtn.scrollFactor.x = 0;
this.add(petterBtn);
FlxG.showCursor(CursorImage);
}
private function onFade():void{
if (goto == 0){
FlxG.music.destroy();
FlxG.switchState(PlayState);
} else {
FlxG.switchState(InstrState);
};
}
public function MoreClick():void{
navigateToURL(new URLRequest("http://maxgames.com"), "_blank");
}
public function LoadTitleMap():void{
var _local2:int;
var _local3:int;
var _local1:Array = new Array();
_local3 = 0;
while (_local3 < 15) {
_local2 = 0;
while (_local2 < 22) {
if (_local3 < 14){
_local1[(_local2 + (_local3 * 22))] = ((26 + (_local2 % 2)) + (2 * (_local3 % 2)));
} else {
_local1[(_local2 + (_local3 * 22))] = ((51 + (_local2 % 2)) + (int((_local3 == 15)) * 2));
};
_local2++;
};
_local3++;
};
tileMap = new FlxTilemap(FlxTilemap.arrayToCSV(_local1, 22), TilesImage, 16, 50, 1);
this.add(tileMap);
FlxG.scroll.x = 0;
FlxG.scroll.y = 0;
}
public function HamumuClick():void{
navigateToURL(new URLRequest("http://hamumu.com"), "_blank");
}
public function PetterClick():void{
navigateToURL(new URLRequest("http://drpetter.se"), "_blank");
}
public function StartClick():void{
FlxG.fade(4278190080, 0.5, onFade);
goto = 0;
}
override public function update():void{
if (((FlxG.keys.Z) || (FlxG.keys.Y))){
FlxG.fade(4278190080, 0.5, onFade);
goto = 0;
};
if (kx < 300){
kdx = (kdx + 0.02);
};
if (kx > 300){
kdx = (kdx - 0.02);
};
if (ky < 180){
kdy = (kdy + 0.02);
};
if (ky > 180){
kdy = (kdy - 0.02);
};
kx = (kx + kdx);
ky = (ky + kdy);
kitty.x = kx;
kitty.y = ky;
ticker = (ticker + FlxG.elapsed);
while (ticker >= 0.07) {
FlxG.scroll.x--;
if (FlxG.scroll.x < -31){
FlxG.scroll.x = (FlxG.scroll.x + 32);
};
ticker = (ticker - 0.07);
};
super.update();
}
public function InsClick():void{
FlxG.fade(4278190080, 0.5, onFade);
goto = 1;
}
}
}//package xplor
Section 113
//TitleState_BtnOffBigImage (xplor.TitleState_BtnOffBigImage)
package xplor {
import mx.core.*;
public class TitleState_BtnOffBigImage extends BitmapAsset {
}
}//package xplor
Section 114
//TitleState_BtnOffImage (xplor.TitleState_BtnOffImage)
package xplor {
import mx.core.*;
public class TitleState_BtnOffImage extends BitmapAsset {
}
}//package xplor
Section 115
//TitleState_BtnOnBigImage (xplor.TitleState_BtnOnBigImage)
package xplor {
import mx.core.*;
public class TitleState_BtnOnBigImage extends BitmapAsset {
}
}//package xplor
Section 116
//TitleState_BtnOnImage (xplor.TitleState_BtnOnImage)
package xplor {
import mx.core.*;
public class TitleState_BtnOnImage extends BitmapAsset {
}
}//package xplor
Section 117
//TitleState_CursorImage (xplor.TitleState_CursorImage)
package xplor {
import mx.core.*;
public class TitleState_CursorImage extends BitmapAsset {
}
}//package xplor
Section 118
//TitleState_InvisBtn2Image (xplor.TitleState_InvisBtn2Image)
package xplor {
import mx.core.*;
public class TitleState_InvisBtn2Image extends BitmapAsset {
}
}//package xplor
Section 119
//TitleState_InvisBtnImage (xplor.TitleState_InvisBtnImage)
package xplor {
import mx.core.*;
public class TitleState_InvisBtnImage extends BitmapAsset {
}
}//package xplor
Section 120
//TitleState_KittyImage (xplor.TitleState_KittyImage)
package xplor {
import mx.core.*;
public class TitleState_KittyImage extends BitmapAsset {
}
}//package xplor
Section 121
//TitleState_PlayerImage (xplor.TitleState_PlayerImage)
package xplor {
import mx.core.*;
public class TitleState_PlayerImage extends BitmapAsset {
}
}//package xplor
Section 122
//TitleState_TilesImage (xplor.TitleState_TilesImage)
package xplor {
import mx.core.*;
public class TitleState_TilesImage extends BitmapAsset {
}
}//package xplor
Section 123
//TitleState_TitleImage (xplor.TitleState_TitleImage)
package xplor {
import mx.core.*;
public class TitleState_TitleImage extends BitmapAsset {
}
}//package xplor
Section 124
//TitleState_titleSong (xplor.TitleState_titleSong)
package xplor {
import mx.core.*;
public class TitleState_titleSong extends SoundAsset {
}
}//package xplor
Section 125
//WinState (xplor.WinState)
package xplor {
import org.flixel.*;
import flash.display.*;
import flash.net.*;
public class WinState extends FlxState {
private var logoBitmap:Bitmap;
protected var pic:FlxSprite;
protected var winSnd:Class;
protected var winPic:Class;
protected var LogoImage:Class;
private var paramObj:Object;
private var txt:FlxText;
public function WinState():void{
var _local1:String;
var _local2:String;
winSnd = WinState_winSnd;
winPic = WinState_winPic;
LogoImage = WinState_LogoImage;
super();
pic = (this.add(new FlxSprite(winPic, 0, 0)) as FlxSprite);
FlxG.play(winSnd);
_local2 = int((FlxG.score % 60)).toString();
if (_local2.length < 2){
_local2 = ("0" + _local2);
};
_local1 = (((("Total time: " + int((FlxG.score / 60)).toString()) + ":") + _local2) + "!");
txt = (this.add(new FlxText(160, 0, 160, _local1, 4294967295, null, 8, "right")) as FlxText);
logoBitmap = (new LogoImage() as Bitmap);
logoBitmap.x = 2;
logoBitmap.y = (480 - 55);
FlxG._game.addChild(logoBitmap);
}
private function onFade():void{
FlxG._game.removeChild(logoBitmap);
FlxG.switchState(TitleState);
}
override public function update():void{
if (((FlxG.keys.Z) || (FlxG.keys.Y))){
FlxG.flash(4294967295, 0.75);
FlxG.fade(4278190080, 0.5, onFade);
};
if (((((((FlxG.mouse.x + FlxG.scroll.x) <= 150)) && (((FlxG.mouse.y + FlxG.scroll.y) > (240 - 28))))) && (FlxG.mouse.justPressed()))){
navigateToURL(new URLRequest("http://maxgames.com"), "_blank");
};
super.update();
}
}
}//package xplor
Section 126
//WinState_LogoImage (xplor.WinState_LogoImage)
package xplor {
import mx.core.*;
public class WinState_LogoImage extends BitmapAsset {
}
}//package xplor
Section 127
//WinState_winPic (xplor.WinState_winPic)
package xplor {
import mx.core.*;
public class WinState_winPic extends BitmapAsset {
}
}//package xplor
Section 128
//WinState_winSnd (xplor.WinState_winSnd)
package xplor {
import mx.core.*;
public class WinState_winSnd extends SoundAsset {
}
}//package xplor
Section 129
//Xplor (xplor.Xplor)
package xplor {
import org.flixel.*;
public class Xplor extends FlxGame {
public static const FX_VOL:Number = 0.7;
public function Xplor(){
super(320, 240, LogoState, 2, 4278190080, false);
useDefaultHotKeys = true;
}
}
}//package xplor