Section 1
//Component (com.bit101.components.Component)
package com.bit101.components {
import flash.events.*;
import flash.display.*;
import flash.filters.*;
public class Component extends Sprite {
protected var _enabled:Boolean;// = true
protected var _height:Number;// = 0
protected var _width:Number;// = 0
protected var _tag:int;// = -1
protected var Ronda:Class;
public static const DRAW:String = "draw";
public function Component(_arg1:DisplayObjectContainer=null, _arg2:Number=0, _arg3:Number=0){
Ronda = Component_Ronda;
super();
move(_arg2, _arg3);
if (_arg1 != null){
_arg1.addChild(this);
};
init();
}
protected function addChildren():void{
}
public function get enabled():Boolean{
return (_enabled);
}
public function setSize(_arg1:Number, _arg2:Number):void{
_width = _arg1;
_height = _arg2;
invalidate();
}
public function set enabled(_arg1:Boolean):void{
_enabled = _arg1;
mouseEnabled = (mouseChildren = _enabled);
tabEnabled = _arg1;
alpha = (_enabled) ? 1 : 0.5;
}
public function draw():void{
dispatchEvent(new Event(Component.DRAW));
}
override public function get width():Number{
return (_width);
}
override public function set height(_arg1:Number):void{
_height = _arg1;
invalidate();
dispatchEvent(new Event(Event.RESIZE));
}
protected function init():void{
addChildren();
invalidate();
}
public function move(_arg1:Number, _arg2:Number):void{
x = Math.round(_arg1);
y = Math.round(_arg2);
}
override public function set width(_arg1:Number):void{
_width = _arg1;
invalidate();
dispatchEvent(new Event(Event.RESIZE));
}
protected function getShadow(_arg1:Number, _arg2:Boolean=false):DropShadowFilter{
return (new DropShadowFilter(_arg1, 45, Style.DROPSHADOW, 1, _arg1, _arg1, 0.3, 1, _arg2));
}
public function get tag():int{
return (_tag);
}
override public function get height():Number{
return (_height);
}
override public function set x(_arg1:Number):void{
super.x = Math.round(_arg1);
}
override public function set y(_arg1:Number):void{
super.y = Math.round(_arg1);
}
public function set tag(_arg1:int):void{
_tag = _arg1;
}
protected function onInvalidate(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, onInvalidate);
draw();
}
protected function invalidate():void{
addEventListener(Event.ENTER_FRAME, onInvalidate);
}
public static function initStage(_arg1:Stage):void{
_arg1.align = StageAlign.TOP_LEFT;
_arg1.scaleMode = StageScaleMode.NO_SCALE;
}
}
}//package com.bit101.components
Section 2
//Component_Ronda (com.bit101.components.Component_Ronda)
package com.bit101.components {
import mx.core.*;
public class Component_Ronda extends FontAsset {
}
}//package com.bit101.components
Section 3
//Label (com.bit101.components.Label)
package com.bit101.components {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class Label extends Component {
protected var _text:String;// = ""
protected var _autoSize:Boolean;// = true
protected var _tf:TextField;
public function Label(_arg1:DisplayObjectContainer=null, _arg2:Number=0, _arg3:Number=0, _arg4:String=""){
this.text = _arg4;
super(_arg1, _arg2, _arg3);
}
override protected function addChildren():void{
_height = 18;
_tf = new TextField();
_tf.height = _height;
_tf.embedFonts = Style.embedFonts;
_tf.selectable = false;
_tf.mouseEnabled = false;
_tf.defaultTextFormat = new TextFormat(Style.fontName, Style.fontSize, Style.LABEL_TEXT);
_tf.text = _text;
addChild(_tf);
draw();
}
override public function draw():void{
super.draw();
_tf.text = _text;
if (_autoSize){
_tf.autoSize = TextFieldAutoSize.LEFT;
_width = _tf.width;
dispatchEvent(new Event(Event.RESIZE));
} else {
_tf.autoSize = TextFieldAutoSize.NONE;
_tf.width = _width;
};
_height = (_tf.height = 18);
}
public function set autoSize(_arg1:Boolean):void{
_autoSize = _arg1;
}
public function get text():String{
return (_text);
}
override protected function init():void{
super.init();
mouseEnabled = false;
mouseChildren = false;
}
public function get textField():TextField{
return (_tf);
}
public function get autoSize():Boolean{
return (_autoSize);
}
public function set text(_arg1:String):void{
_text = _arg1;
if (_text == null){
_text = "";
};
invalidate();
}
}
}//package com.bit101.components
Section 4
//Panel (com.bit101.components.Panel)
package com.bit101.components {
import flash.display.*;
public class Panel extends Component {
protected var _showGrid:Boolean;// = false
protected var _gridSize:int;// = 10
protected var _background:Sprite;
protected var _mask:Sprite;
protected var _color:int;// = -1
public var content:Sprite;
protected var _gridColor:uint;// = 0xD0D0D0
protected var _shadow:Boolean;// = true
public function Panel(_arg1:DisplayObjectContainer=null, _arg2:Number=0, _arg3:Number=0){
super(_arg1, _arg2, _arg3);
}
override protected function addChildren():void{
_background = new Sprite();
addChild(_background);
_mask = new Sprite();
_mask.mouseEnabled = false;
addChild(_mask);
content = new Sprite();
addChild(content);
content.mask = _mask;
filters = [getShadow(2, true)];
}
public function set shadow(_arg1:Boolean):void{
_shadow = _arg1;
if (_shadow){
filters = [getShadow(2, true)];
} else {
filters = [];
};
}
override public function draw():void{
super.draw();
_background.graphics.clear();
_background.graphics.lineStyle(1, 0, 0.1);
if (_color == -1){
_background.graphics.beginFill(Style.PANEL);
} else {
_background.graphics.beginFill(_color);
};
_background.graphics.drawRect(0, 0, _width, _height);
_background.graphics.endFill();
drawGrid();
_mask.graphics.clear();
_mask.graphics.beginFill(0xFF0000);
_mask.graphics.drawRect(0, 0, _width, _height);
_mask.graphics.endFill();
}
public function set gridSize(_arg1:int):void{
_gridSize = _arg1;
invalidate();
}
override protected function init():void{
super.init();
setSize(100, 100);
}
public function set color(_arg1:int):void{
_color = _arg1;
invalidate();
}
public function set showGrid(_arg1:Boolean):void{
_showGrid = _arg1;
invalidate();
}
public function get shadow():Boolean{
return (_shadow);
}
public function get color():int{
return (_color);
}
public function get gridSize():int{
return (_gridSize);
}
protected function drawGrid():void{
if (!_showGrid){
return;
};
_background.graphics.lineStyle(0, _gridColor);
var _local1:int;
while (_local1 < _width) {
_background.graphics.moveTo(_local1, 0);
_background.graphics.lineTo(_local1, _height);
_local1 = (_local1 + _gridSize);
};
_local1 = 0;
while (_local1 < _height) {
_background.graphics.moveTo(0, _local1);
_background.graphics.lineTo(_width, _local1);
_local1 = (_local1 + _gridSize);
};
}
public function set gridColor(_arg1:uint):void{
_gridColor = _arg1;
invalidate();
}
public function get showGrid():Boolean{
return (_showGrid);
}
public function get gridColor():uint{
return (_gridColor);
}
}
}//package com.bit101.components
Section 5
//PushButton (com.bit101.components.PushButton)
package com.bit101.components {
import flash.events.*;
import flash.display.*;
public class PushButton extends Component {
protected var _down:Boolean;// = false
protected var _labelText:String;// = ""
protected var _back:Sprite;
protected var _over:Boolean;// = false
protected var _selected:Boolean;// = false
protected var _label:Label;
protected var _toggle:Boolean;// = false
protected var _face:Sprite;
public function PushButton(_arg1:DisplayObjectContainer=null, _arg2:Number=0, _arg3:Number=0, _arg4:String="", _arg5:Function=null){
super(_arg1, _arg2, _arg3);
if (_arg5 != null){
addEventListener(MouseEvent.CLICK, _arg5);
};
this.label = _arg4;
}
override protected function addChildren():void{
_back = new Sprite();
_back.filters = [getShadow(2, true)];
_back.mouseEnabled = false;
addChild(_back);
_face = new Sprite();
_face.mouseEnabled = false;
_face.filters = [getShadow(1)];
_face.x = 1;
_face.y = 1;
addChild(_face);
_label = new Label();
addChild(_label);
addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
addEventListener(MouseEvent.ROLL_OVER, onMouseOver);
}
protected function onMouseDown(_arg1:MouseEvent):void{
_down = true;
_face.filters = [getShadow(1, true)];
stage.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
}
override public function draw():void{
super.draw();
_back.graphics.clear();
_back.graphics.beginFill(Style.BACKGROUND);
_back.graphics.drawRect(0, 0, _width, _height);
_back.graphics.endFill();
_face.graphics.clear();
_face.graphics.beginFill(Style.BUTTON_FACE);
_face.graphics.drawRect(0, 0, (_width - 2), (_height - 2));
_face.graphics.endFill();
_label.autoSize = true;
_label.text = _labelText;
if (_label.width > (_width - 4)){
_label.autoSize = false;
_label.width = (_width - 4);
} else {
_label.autoSize = true;
};
_label.draw();
_label.move(((_width / 2) - (_label.width / 2)), ((_height / 2) - (_label.height / 2)));
}
override protected function init():void{
super.init();
buttonMode = true;
useHandCursor = true;
setSize(100, 20);
}
protected function onMouseOver(_arg1:MouseEvent):void{
_over = true;
addEventListener(MouseEvent.ROLL_OUT, onMouseOut);
}
public function get toggle():Boolean{
return (_toggle);
}
protected function onMouseUp(_arg1:MouseEvent):void{
if (((_toggle) && (_over))){
_selected = !(_selected);
};
_down = _selected;
_face.filters = [getShadow(1, _selected)];
stage.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
}
public function get selected():Boolean{
return (_selected);
}
protected function onMouseOut(_arg1:MouseEvent):void{
_over = false;
if (!_down){
_face.filters = [getShadow(1)];
};
removeEventListener(MouseEvent.ROLL_OUT, onMouseOut);
}
public function set label(_arg1:String):void{
_labelText = _arg1;
draw();
}
public function set selected(_arg1:Boolean):void{
if (!_toggle){
_arg1 = false;
};
_selected = _arg1;
_down = _selected;
_face.filters = [getShadow(1, _selected)];
}
public function set toggle(_arg1:Boolean):void{
_toggle = _arg1;
}
public function get label():String{
return (_labelText);
}
}
}//package com.bit101.components
Section 6
//Style (com.bit101.components.Style)
package com.bit101.components {
public class Style {
public static var PROGRESS_BAR:uint = 0xFFFFFF;
public static var PANEL:uint = 0xF3F3F3;
public static var INPUT_TEXT:uint = 0x333333;
public static var BUTTON_FACE:uint = 0xFFFFFF;
public static var BACKGROUND:uint = 0xCCCCCC;
public static var DROPSHADOW:uint = 0;
public static var embedFonts:Boolean = true;
public static var fontSize:Number = 8;
public static var LABEL_TEXT:uint = 0x666666;
public static var fontName:String = "PF Ronda Seven";
}
}//package com.bit101.components
Section 7
//Window (com.bit101.components.Window)
package com.bit101.components {
import flash.events.*;
import flash.display.*;
public class Window extends Component {
protected var _panel:Panel;
protected var _minimized:Boolean;// = false
protected var _closeButton:PushButton;
protected var _draggable:Boolean;// = true
protected var _minimizeButton:Sprite;
protected var _titleLabel:Label;
protected var _hasMinimizeButton:Boolean;// = false
protected var _shadow:Boolean;// = true
protected var _title:String;
protected var _grips:Shape;
protected var _color:int;// = -1
protected var _hasCloseButton:Boolean;
protected var _titleBar:Panel;
public function Window(_arg1:DisplayObjectContainer=null, _arg2:Number=0, _arg3:Number=0, _arg4:String="Window"){
_title = _arg4;
super(_arg1, _arg2, _arg3);
}
public function get minimized():Boolean{
return (_minimized);
}
public function set minimized(_arg1:Boolean):void{
_minimized = _arg1;
if (_minimized){
if (contains(_panel)){
removeChild(_panel);
};
_minimizeButton.rotation = -90;
} else {
if (!contains(_panel)){
addChild(_panel);
};
_minimizeButton.rotation = 0;
};
dispatchEvent(new Event(Event.RESIZE));
}
public function get draggable():Boolean{
return (_draggable);
}
override protected function init():void{
super.init();
setSize(100, 100);
}
public function set draggable(_arg1:Boolean):void{
_draggable = _arg1;
_titleBar.buttonMode = _draggable;
_titleBar.useHandCursor = _draggable;
}
protected function onMinimize(_arg1:MouseEvent):void{
minimized = !(minimized);
}
public function get shadow():Boolean{
return (_shadow);
}
public function get titleBar():Panel{
return (_titleBar);
}
override public function get height():Number{
if (contains(_panel)){
return (super.height);
};
return (20);
}
public function get hasMinimizeButton():Boolean{
return (_hasMinimizeButton);
}
public function set hasCloseButton(_arg1:Boolean):void{
_hasCloseButton = _arg1;
if (_hasCloseButton){
_titleBar.content.addChild(_closeButton);
} else {
if (_titleBar.content.contains(_closeButton)){
_titleBar.content.removeChild(_closeButton);
};
};
invalidate();
}
public function set title(_arg1:String):void{
_title = _arg1;
_titleLabel.text = _title;
}
public function set titleBar(_arg1:Panel):void{
_titleBar = _arg1;
}
override protected function addChildren():void{
_titleBar = new Panel(this);
_titleBar.filters = [];
_titleBar.buttonMode = true;
_titleBar.useHandCursor = true;
_titleBar.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
_titleBar.height = 20;
_titleLabel = new Label(_titleBar.content, 5, 1, _title);
_grips = new Shape();
var _local1:int;
while (_local1 < 4) {
_grips.graphics.lineStyle(1, 0xFFFFFF, 0.55);
_grips.graphics.moveTo(0, (3 + (_local1 * 4)));
_grips.graphics.lineTo(100, (3 + (_local1 * 4)));
_grips.graphics.lineStyle(1, 0, 0.125);
_grips.graphics.moveTo(0, (4 + (_local1 * 4)));
_grips.graphics.lineTo(100, (4 + (_local1 * 4)));
_local1++;
};
_titleBar.content.addChild(_grips);
_grips.visible = false;
_panel = new Panel(this, 0, 20);
_panel.visible = !(_minimized);
_minimizeButton = new Sprite();
_minimizeButton.graphics.beginFill(0, 0);
_minimizeButton.graphics.drawRect(-10, -10, 20, 20);
_minimizeButton.graphics.endFill();
_minimizeButton.graphics.beginFill(0, 0.35);
_minimizeButton.graphics.moveTo(-5, -3);
_minimizeButton.graphics.lineTo(5, -3);
_minimizeButton.graphics.lineTo(0, 4);
_minimizeButton.graphics.lineTo(-5, -3);
_minimizeButton.graphics.endFill();
_minimizeButton.x = 10;
_minimizeButton.y = 10;
_minimizeButton.useHandCursor = true;
_minimizeButton.buttonMode = true;
_minimizeButton.addEventListener(MouseEvent.CLICK, onMinimize);
_closeButton = new PushButton(null, 86, 6, "", onClose);
_closeButton.setSize(8, 8);
filters = [getShadow(4, false)];
}
protected function onMouseUp(_arg1:MouseEvent):void{
this.stopDrag();
stage.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
}
public function set color(_arg1:int):void{
_color = _arg1;
invalidate();
}
public function set shadow(_arg1:Boolean):void{
_shadow = _arg1;
if (_shadow){
filters = [getShadow(4, false)];
} else {
filters = [];
};
}
override public function draw():void{
super.draw();
_titleBar.color = _color;
_panel.color = _color;
_titleBar.width = width;
_titleBar.draw();
_titleLabel.x = (_hasMinimizeButton) ? 20 : 5;
_closeButton.x = (_width - 14);
_grips.x = (_titleLabel.x + _titleLabel.width);
if (_hasCloseButton){
_grips.width = ((_closeButton.x - _grips.x) - 2);
} else {
_grips.width = ((_width - _grips.x) - 2);
};
_panel.setSize(_width, (_height - 20));
_panel.draw();
}
protected function onMouseDown(_arg1:MouseEvent):void{
if (_draggable){
this.startDrag();
stage.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
parent.addChild(this);
};
dispatchEvent(new Event(Event.SELECT));
}
public function get hasCloseButton():Boolean{
return (_hasCloseButton);
}
public function set hasMinimizeButton(_arg1:Boolean):void{
_hasMinimizeButton = _arg1;
if (_hasMinimizeButton){
addChild(_minimizeButton);
} else {
if (contains(_minimizeButton)){
removeChild(_minimizeButton);
};
};
invalidate();
}
public function get title():String{
return (_title);
}
protected function onClose(_arg1:MouseEvent):void{
dispatchEvent(new Event(Event.CLOSE));
}
public function get grips():Shape{
return (_grips);
}
public function get color():int{
return (_color);
}
public function get content():DisplayObjectContainer{
return (_panel.content);
}
}
}//package com.bit101.components
Section 8
//GTween (com.gskinner.motion.GTween)
package com.gskinner.motion {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
public class GTween {
protected var _rangeValues:Object;
public var autoPlay:Boolean;// = true
protected var _delay:Number;// = 0
public var ratio:Number;
public var pluginData:Object;
public var useFrames:Boolean;
protected var _position:Number;// = 0
public var target:Object;
public var duration:Number;
public var onInit:Function;
public var calculatedPosition:Number;
public var calculatedPositionOld:Number;
public var ratioOld:Number;
public var data;
public var suppressEvents:Boolean;
public var repeatCount:int;// = 1
public var nextTween:GTween;
protected var _referenceTime:Number;
public var reflect:Boolean;
public var positionOld:Number;
protected var _values:Object;
public var onComplete:Function;
protected var _paused:Boolean;// = true
protected var _inited:Boolean;
public var ease:Function;
protected var _proxy:TargetProxy;
protected var _initValues:Object;
public var onChange:Function;
public var timeScale:Number;// = 1
protected static var plugins:Object = {};
protected static var shape:Shape;
public static var timeScaleAll:Number = 1;
protected static var gcLockList:Dictionary = new Dictionary(false);
public static var pauseAll:Boolean = false;
protected static var time:Number;
public static var defaultEase:Function = linearEase;
protected static var hasStarPlugins:Boolean = false;
protected static var tickList:Dictionary = new Dictionary(true);
public function GTween(_arg1:Object=null, _arg2:Number=1, _arg3:Object=null, _arg4:Object=null, _arg5:Object=null){
var _local6:Boolean;
super();
ease = defaultEase;
this.target = _arg1;
this.duration = _arg2;
this.pluginData = copy(_arg5, {});
if (_arg4){
_local6 = _arg4.swapValues;
delete _arg4.swapValues;
};
copy(_arg4, this);
resetValues(_arg3);
if (_local6){
swapValues();
};
if ((((((this.duration == 0)) && ((delay == 0)))) && (autoPlay))){
position = 0;
};
}
public function get delay():Number{
return (_delay);
}
public function getInitValue(_arg1:String):Number{
return (_initValues[_arg1]);
}
public function set delay(_arg1:Number):void{
if (_position <= 0){
_position = -(_arg1);
};
_delay = _arg1;
}
public function init():void{
var _local1:String;
var _local2:Array;
var _local3:uint;
var _local4:Number;
var _local5:uint;
_inited = true;
_initValues = {};
_rangeValues = {};
for (_local1 in _values) {
if (plugins[_local1]){
_local2 = plugins[_local1];
_local3 = _local2.length;
_local4 = ((_local1 in target)) ? target[_local1] : NaN;
_local5 = 0;
while (_local5 < _local3) {
_local4 = _local2[_local5].init(this, _local1, _local4);
_local5++;
};
if (!isNaN(_local4)){
_rangeValues[_local1] = (_values[_local1] - (_initValues[_local1] = _local4));
};
} else {
_rangeValues[_local1] = (_values[_local1] - (_initValues[_local1] = target[_local1]));
};
};
if (hasStarPlugins){
_local2 = plugins["*"];
_local3 = _local2.length;
_local5 = 0;
while (_local5 < _local3) {
_local2[_local5].init(this, "*", NaN);
_local5++;
};
};
if (((!((onInit == null))) && (!(suppressEvents)))){
onInit(this);
};
}
public function getValues():Object{
return (copy(_values, {}));
}
public function setValues(_arg1:Object):void{
copy(_arg1, _values, true);
invalidate();
}
public function get position():Number{
return (_position);
}
protected function setGCLock(_arg1:Boolean):void{
if (_arg1){
if ((target is IEventDispatcher)){
target.addEventListener("_", setGCLock);
} else {
gcLockList[this] = true;
};
} else {
if ((target is IEventDispatcher)){
target.removeEventListener("_", setGCLock);
};
delete gcLockList[this];
};
}
public function swapValues():void{
var _local2:String;
var _local3:Number;
if (!_inited){
init();
};
var _local1:Object = _values;
_values = _initValues;
_initValues = _local1;
for (_local2 in _rangeValues) {
_rangeValues[_local2] = (_rangeValues[_local2] * -1);
};
if (_position < 0){
_local3 = positionOld;
position = 0;
_position = positionOld;
positionOld = _local3;
} else {
position = _position;
};
}
public function setValue(_arg1:String, _arg2:Number):void{
_values[_arg1] = _arg2;
invalidate();
}
public function get paused():Boolean{
return (_paused);
}
public function getValue(_arg1:String):Number{
return (_values[_arg1]);
}
protected function invalidate():void{
_inited = false;
if (_position > 0){
_position = 0;
};
if (autoPlay){
paused = false;
};
}
protected function copy(_arg1:Object, _arg2:Object, _arg3:Boolean=false):Object{
var _local4:String;
for (_local4 in _arg1) {
if (((_arg3) && ((_arg1[_local4] == null)))){
delete _arg2[_local4];
} else {
_arg2[_local4] = _arg1[_local4];
};
};
return (_arg2);
}
public function deleteValue(_arg1:String):Boolean{
delete _rangeValues[_arg1];
delete _initValues[_arg1];
return (delete _values[_arg1]);
}
public function resetValues(_arg1:Object=null):void{
_values = {};
setValues(_arg1);
}
public function set position(_arg1:Number):void{
var _local4:String;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Array;
var _local9:uint;
var _local10:uint;
positionOld = _position;
ratioOld = ratio;
calculatedPositionOld = calculatedPosition;
var _local2:Number = (repeatCount * duration);
var _local3:Boolean = (((_arg1 >= _local2)) && ((repeatCount > 0)));
if (_local3){
if (calculatedPositionOld == _local2){
return;
};
_position = _local2;
calculatedPosition = (((reflect) && (!((repeatCount & 1))))) ? 0 : duration;
} else {
_position = ((_arg1)<-(_delay)) ? -(_delay) : _arg1;
calculatedPosition = ((_position < 0)) ? 0 : (_position % duration);
if (((reflect) && (((_position / duration) & 1)))){
calculatedPosition = (duration - calculatedPosition);
};
};
ratio = ((((duration == 0)) && ((_position >= 0)))) ? 1 : ease((calculatedPosition / duration), 0, 1, 1);
if (((((target) && ((((_position >= 0)) || ((positionOld >= 0)))))) && (!((_position == positionOld))))){
if (!_inited){
init();
};
for (_local4 in _values) {
_local5 = _initValues[_local4];
_local6 = _rangeValues[_local4];
_local7 = (_local5 + (_local6 * ratio));
_local8 = plugins[_local4];
if (_local8){
_local9 = _local8.length;
_local10 = 0;
while (_local10 < _local9) {
_local7 = _local8[_local10].tween(this, _local4, _local7, _local5, _local6, ratio, _local3);
_local10++;
};
if (!isNaN(_local7)){
target[_local4] = _local7;
};
} else {
target[_local4] = _local7;
};
};
};
if (hasStarPlugins){
_local8 = plugins["*"];
_local9 = _local8.length;
_local10 = 0;
while (_local10 < _local9) {
_local8[_local10].tween(this, "*", NaN, NaN, NaN, ratio, _local3);
_local10++;
};
};
if (((!((onChange == null))) && (!(suppressEvents)))){
onChange(this);
};
if (_local3){
paused = true;
if (nextTween){
nextTween.paused = false;
};
if (((!((onComplete == null))) && (!(suppressEvents)))){
onComplete(this);
};
};
}
public function end():void{
position = ((repeatCount)>0) ? (repeatCount * duration) : duration;
}
public function beginning():void{
position = 0;
paused = true;
}
public function set paused(_arg1:Boolean):void{
if (_arg1 == _paused){
return;
};
_paused = _arg1;
if (_paused){
delete tickList[this];
setGCLock(false);
} else {
if (((!((repeatCount == 0))) && ((_position >= (repeatCount * duration))))){
_inited = false;
_position = -(delay);
};
tickList[this] = true;
setGCLock(true);
};
}
public function get proxy():TargetProxy{
if (_proxy == null){
_proxy = new TargetProxy(this);
};
return (_proxy);
}
public static function installPlugin(_arg1:Object, _arg2:Array, _arg3:Boolean=false):void{
var _local5:String;
var _local4:uint;
while (_local4 < _arg2.length) {
_local5 = _arg2[_local4];
if (_local5 == "*"){
hasStarPlugins = true;
};
if (plugins[_local5] == null){
plugins[_local5] = [_arg1];
} else {
if (_arg3){
plugins[_local5].unshift(_arg1);
} else {
plugins[_local5].push(_arg1);
};
};
_local4++;
};
}
protected static function staticTick(_arg1:Event):void{
var _local4:Object;
var _local5:GTween;
var _local2:Number = time;
time = (getTimer() / 1000);
if (pauseAll){
return;
};
var _local3:Number = ((time - _local2) * timeScaleAll);
for (_local4 in tickList) {
_local5 = (_local4 as GTween);
(_local4 as GTween).position = (_local5._position + ((_local5.useFrames) ? timeScaleAll : _local3 * _local5.timeScale));
};
}
public static function linearEase(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (_arg1);
}
protected static function staticInit():void{
(shape = new Shape()).addEventListener(Event.ENTER_FRAME, staticTick);
time = (getTimer() / 1000);
}
staticInit();
}
}//package com.gskinner.motion
import flash.utils.*;
dynamic class TargetProxy extends Proxy {
private var tween:GTween;
private function TargetProxy(_arg1:GTween):void{
this.tween = _arg1;
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function deleteProperty(_arg1):Boolean{
tween.deleteValue(_arg1);
return (true);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
if ((((((_arg2 is Boolean)) || ((_arg2 is String)))) || (isNaN(_arg2)))){
tween.target[_arg1] = _arg2;
} else {
tween.setValue(String(_arg1), Number(_arg2));
};
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function callProperty(_arg1, ... _args){
return (tween.target[_arg1].apply(null, _args));
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
var _local2:Number = tween.getValue(_arg1);
return ((isNaN(_local2)) ? tween.target[_arg1] : _local2);
}
}
Section 9
//GTweener (com.gskinner.motion.GTweener)
package com.gskinner.motion {
import flash.utils.*;
public class GTweener {
protected static var tweens:Dictionary;
protected static var instance:GTweener;
public function init(_arg1:GTween, _arg2:String, _arg3:Number):Number{
return (_arg3);
}
public function tween(_arg1:GTween, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean):Number{
if (((_arg7) && (_arg1.pluginData.GTweener))){
remove(_arg1);
};
return (_arg3);
}
public static function add(_arg1:GTween):void{
var _local2:Object = _arg1.target;
var _local3:Array = tweens[_local2];
if (_local3){
clearValues(_local2, _arg1.getValues());
} else {
_local3 = (tweens[_local2] = []);
};
_local3.push(_arg1);
_arg1.pluginData.GTweener = true;
}
public static function resumeTweens(_arg1:Object):void{
pauseTweens(_arg1, false);
}
public static function getTweens(_arg1:Object):Array{
return (((tweens[_arg1]) || ([])));
}
public static function from(_arg1:Object=null, _arg2:Number=1, _arg3:Object=null, _arg4:Object=null, _arg5:Object=null):GTween{
var _local6:GTween = to(_arg1, _arg2, _arg3, _arg4, _arg5);
_local6.swapValues();
return (_local6);
}
public static function remove(_arg1:GTween):void{
delete _arg1.pluginData.GTweener;
var _local2:Array = tweens[_arg1.target];
if (_local2 == null){
return;
};
var _local3:uint = _local2.length;
var _local4:uint;
while (_local4 < _local3) {
if (_local2[_local4] == _arg1){
_local2.splice(_local4, 1);
return;
};
_local4++;
};
}
public static function removeTweens(_arg1:Object):void{
pauseTweens(_arg1);
var _local2:Array = tweens[_arg1];
if (_local2 == null){
return;
};
var _local3:uint = _local2.length;
var _local4:uint;
while (_local4 < _local3) {
delete _local2[_local4].pluginData.GTweener;
_local4++;
};
delete tweens[_arg1];
}
protected static function staticInit():void{
tweens = new Dictionary(true);
instance = new (GTweener);
GTween.installPlugin(instance, ["*"]);
}
protected static function clearValues(_arg1:Object, _arg2:Object):void{
var n:String;
var tween:GTween;
var target = _arg1;
var values = _arg2;
for (n in values) {
tween = getTween(target, n);
try {
if (tween){
tween.deleteValue(n);
};
} catch(e:Error) {
};
};
}
public static function to(_arg1:Object=null, _arg2:Number=1, _arg3:Object=null, _arg4:Object=null, _arg5:Object=null):GTween{
var _local6:GTween = new GTween(_arg1, _arg2, _arg3, _arg4, _arg5);
add(_local6);
return (_local6);
}
public static function getTween(_arg1:Object, _arg2:String):GTween{
var _local6:GTween;
var _local3:Array = tweens[_arg1];
if (_local3 == null){
return (null);
};
var _local4:uint = _local3.length;
var _local5:uint;
while (_local5 < _local4) {
_local6 = _local3[_local5];
if (!isNaN(_local6.getValue(_arg2))){
return (_local6);
};
_local5++;
};
return (null);
}
public static function pauseTweens(_arg1:Object, _arg2:Boolean=true):void{
var _local3:Array = tweens[_arg1];
if (_local3 == null){
return;
};
var _local4:uint = _local3.length;
var _local5:uint;
while (_local5 < _local4) {
_local3[_local5].paused = _arg2;
_local5++;
};
}
staticInit();
}
}//package com.gskinner.motion
Section 10
//AdLoader (CPMStar.AdLoader)
package CPMStar {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.system.*;
public class AdLoader extends Sprite {
private var cpmstarLoader:Loader;
private var contentspotid:String;
public function AdLoader(_arg1:String){
this.contentspotid = _arg1;
addEventListener(Event.ADDED, addedHandler);
}
private function dispatchHandler(_arg1:Event):void{
dispatchEvent(_arg1);
}
private function addedHandler(_arg1:Event):void{
removeEventListener(Event.ADDED, addedHandler);
Security.allowDomain("server.cpmstar.com");
var _local2 = "http://server.cpmstar.com/adviewas3.swf";
var _local3:DisplayObjectContainer = parent;
cpmstarLoader = new Loader();
cpmstarLoader.contentLoaderInfo.addEventListener(Event.INIT, dispatchHandler);
cpmstarLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, dispatchHandler);
cpmstarLoader.load(new URLRequest(((_local2 + "?contentspotid=") + contentspotid)));
addChild(cpmstarLoader);
}
}
}//package CPMStar
Section 11
//bullet (halfbot.game.gameObjects.bullet)
package halfbot.game.gameObjects {
import org.flixel.*;
public class bullet extends FlxSprite {
private var SoundEffect1:Class;
private var ImgBullet:Class;
public function bullet(){
ImgBullet = bullet_ImgBullet;
SoundEffect1 = bullet_SoundEffect1;
super();
loadGraphic(ImgBullet, true);
width = 6;
height = 6;
offset.x = 1;
offset.y = 1;
exists = false;
addAnimation("left", [0]);
addAnimation("right", [0]);
addAnimation("poof", [1, 2], 20, false);
}
override public function hitTop(_arg1:FlxObject, _arg2:Number):void{
kill();
}
override public function render():void{
super.render();
}
override public function update():void{
if (((dead) && (finished))){
exists = false;
} else {
super.update();
};
}
override public function hitLeft(_arg1:FlxObject, _arg2:Number):void{
kill();
}
override public function kill():void{
if (dead){
return;
};
velocity.x = 0;
velocity.y = 0;
if (onScreen()){
FlxG.play(SoundEffect1, 0.2);
};
dead = true;
solid = false;
play("poof");
}
override public function hitBottom(_arg1:FlxObject, _arg2:Number):void{
kill();
}
public function shoot(_arg1:int, _arg2:int, _arg3:int, _arg4:int):void{
super.reset(_arg1, _arg2);
solid = true;
velocity.x = _arg3;
velocity.y = _arg4;
if (velocity.x < 0){
play("left");
} else {
if (velocity.x > 0){
play("right");
};
};
}
}
}//package halfbot.game.gameObjects
Section 12
//bullet_ImgBullet (halfbot.game.gameObjects.bullet_ImgBullet)
package halfbot.game.gameObjects {
import mx.core.*;
public class bullet_ImgBullet extends BitmapAsset {
}
}//package halfbot.game.gameObjects
Section 13
//bullet_SoundEffect1 (halfbot.game.gameObjects.bullet_SoundEffect1)
package halfbot.game.gameObjects {
import mx.core.*;
public class bullet_SoundEffect1 extends SoundAsset {
}
}//package halfbot.game.gameObjects
Section 14
//camera_block (halfbot.game.gameObjects.camera_block)
package halfbot.game.gameObjects {
import org.flixel.*;
public class camera_block extends FlxSprite {
protected var _followObject:FlxSprite;// = null
public function camera_block(_arg1:int, _arg2:int, _arg3:FlxSprite){
super(_arg1, _arg2, null);
_followObject = _arg3;
}
override public function update():void{
if (acceleration.y != 0){
super.update();
};
if (_followObject){
if ((((_followObject.acceleration.y > 0)) && ((y > (_followObject.y + 32))))){
y = (_followObject.y + 32);
};
};
}
}
}//package halfbot.game.gameObjects
Section 15
//cannon_ball (halfbot.game.gameObjects.cannon_ball)
package halfbot.game.gameObjects {
import flash.utils.*;
import org.flixel.*;
import flash.geom.*;
import halfbot.game.system.*;
public class cannon_ball extends game_object {
private var dd:Number;// = 100000
private var curHeight;// = 0
private var cannonBallSpeed:Number;// = 350
private var isDone:Boolean;// = false
private var lastTick:Number;// = 0
private var startPoint:Point;
private var startingHeight;// = 0
private var currentHPos:Point;
private var ticksTotal:Number;// = 0
private var smoke:Array;// = null
private var gravity:Number;// = 0
private var curVSpd:Number;// = 0
private var endPoint:Point;
private var depthOffset:int;// = 0
private var cannonShadow:FlxSprite;// = null
private var direction:Point;
public function cannon_ball(_arg1:int, _arg2:int, _arg3:FlxSprite, _arg4:Array){
startPoint = new Point();
endPoint = new Point();
direction = new Point();
currentHPos = new Point();
super(_arg1, _arg2);
loadGraphic(HB_GameData.GAME_RES.image_cannon_ball, true);
addAnimation("idle", [0], 0, false);
play("idle");
cannonShadow = _arg3;
cannonShadow.x = _arg1;
cannonShadow.y = _arg2;
smoke = _arg4;
smoke;
}
override public function update():void{
var _local4:FlxSprite;
super.update();
var _local1:* = getTimer();
var _local2:Number = ((_local1 - lastTick) / 1000);
lastTick = _local1;
ticksTotal = (ticksTotal + _local2);
currentHPos.x = (currentHPos.x + ((direction.x * cannonBallSpeed) * _local2));
currentHPos.y = (currentHPos.y + ((direction.y * cannonBallSpeed) * _local2));
curVSpd = (gravity * ticksTotal);
var _local3:Number = (((0.5 * gravity) * ticksTotal) * ticksTotal);
if (curHeight > _local3){
x = currentHPos.x;
y = (currentHPos.y - (curHeight - _local3));
depthOffset = (dd + (curHeight - _local3));
cannonShadow.x = (currentHPos.x - (cannonShadow.width / 4));
cannonShadow.y = currentHPos.y;
} else {
dd = 0;
x = endPoint.x;
y = endPoint.y;
if (!isDone){
_local4 = smoke[0];
_local4.x = (endPoint.x - (_local4.width / 4));
_local4.y = endPoint.y;
_local4.play("explode");
_local4.visible = true;
};
visible = false;
cannonShadow.visible = false;
isDone = true;
};
}
public function fireCannon(_arg1:Point, _arg2:Point, _arg3:int){
isDone = false;
startPoint = _arg1;
endPoint = _arg2;
startPoint.y = (startPoint.y + _arg3);
curHeight = _arg3;
startingHeight = _arg3;
currentHPos = _arg1;
ticksTotal = 0;
lastTick = getTimer();
x = _arg1.x;
y = _arg1.y;
cannonShadow.x = currentHPos.x;
cannonShadow.y = currentHPos.y;
cannonShadow.visible = true;
startPoint.y = (startPoint.y + _arg3);
direction = endPoint.subtract(startPoint);
var _local4:Number = (direction.length / cannonBallSpeed);
gravity = ((2 * _arg3) / (_local4 * _local4));
direction.normalize(1);
}
override public function render():void{
super.render();
}
}
}//package halfbot.game.gameObjects
Section 16
//crate (halfbot.game.gameObjects.crate)
package halfbot.game.gameObjects {
import flash.utils.*;
import org.flixel.*;
public class crate extends FlxSprite {
protected var _others:Array;
public var lastY:int;// = -10000
private var ImgCrate16:Class;
private var ImgCrate32x16:Class;
public var belowObject:FlxSprite;
private var SoundEffect1:Class;
private var SoundEffect2:Class;
public var offsetDustX:int;// = 0
public var offsetDustY:int;// = 0
public var lastTime:int;// = 0
private var ImgBigDust:Class;
public var delayDeath:int;// = 10
private var ImgCrate16x32:Class;
private var gibs:FlxEmitter;
private var ImgSmallDust:Class;
public var dust:FlxSprite;
private var ImgCrate32:Class;
public function crate(_arg1:Number, _arg2:Number, _arg3:Array){
var _local5:int;
ImgCrate32 = crate_ImgCrate32;
ImgCrate16 = crate_ImgCrate16;
ImgCrate16x32 = crate_ImgCrate16x32;
ImgSmallDust = crate_ImgSmallDust;
ImgBigDust = crate_ImgBigDust;
ImgCrate32x16 = crate_ImgCrate32x16;
SoundEffect1 = crate_SoundEffect1;
SoundEffect2 = crate_SoundEffect2;
super(_arg1, _arg2);
_others = _arg3;
var _local4:int = randRange(0, 5);
gibs = new FlxEmitter();
gibs.delay = -2;
gibs.gravity = 500;
gibs.setYSpeed(-300, 100);
gibs.setXSpeed(-300, 300);
if ((((((_local4 == 0)) || ((_local4 == 4)))) || ((_local4 == 5)))){
loadGraphic(ImgCrate32, true, false, 32, 32);
addAnimation("idle", [randRange(0, 2)], 0, true);
_local5 = 0;
while (_local5 < 8) {
gibs.add(new gib(ImgCrate32, 8));
_local5++;
};
this.width = 32;
this.height = 32;
dust = new FlxSprite(0, this.height);
dust.loadGraphic(ImgBigDust, true, false, 64, 16);
dust.addAnimation("dust", [0, 1, 2, 3, 4], 8, false);
} else {
if (_local4 == 1){
loadGraphic(ImgCrate16, true, false, 16, 16);
addAnimation("idle", [randRange(0, 1)], 0, true);
_local5 = 0;
while (_local5 < 8) {
gibs.add(new gib(ImgCrate16, 6));
_local5++;
};
this.width = 16;
this.height = 16;
dust = new FlxSprite(0, this.height);
dust.loadGraphic(ImgSmallDust, true, false, 32, 8);
dust.addAnimation("dust", [0, 1, 2, 3, 4], 8, false);
} else {
if (_local4 == 2){
loadGraphic(ImgCrate16x32, true, false, 16, 32);
addAnimation("idle", [randRange(0, 1)], 0, true);
_local5 = 0;
while (_local5 < 8) {
gibs.add(new gib(ImgCrate16x32, 8));
_local5++;
};
this.width = 16;
this.height = 32;
offsetDustX = 0;
offsetDustY = 8;
dust = new FlxSprite(0, this.height);
dust.loadGraphic(ImgSmallDust, true, false, 32, 8);
dust.addAnimation("dust", [0, 1, 2, 3, 4], 8, false);
} else {
if (_local4 == 3){
loadGraphic(ImgCrate32x16, true, false, 32, 16);
addAnimation("idle", [randRange(0, 1)], 0, true);
_local5 = 0;
while (_local5 < 8) {
gibs.add(new gib(ImgCrate32x16, 8));
_local5++;
};
this.width = 32;
this.height = 16;
offsetDustX = 0;
offsetDustY = -8;
dust = new FlxSprite(0, this.height);
dust.loadGraphic(ImgBigDust, true, false, 64, 16);
dust.addAnimation("dust", [0, 1, 2, 3, 4], 8, false);
};
};
};
};
dust.play("dust");
dust.visible = false;
velocity.y = 200;
fixed = true;
play("idle");
}
override public function update():void{
super.update();
if (dead){
if ((getTimer() - lastTime) > 2000){
kill();
};
gibs.update();
return;
};
if (((dust.finished) && (dust.visible))){
dust.visible = false;
};
if (dust.visible){
dust.x = (((x + origin.x) - width) + offsetDustX);
dust.y = ((y + origin.y) + offsetDustY);
dust.update();
};
if ((((_point.y > (FlxG.height + 64))) && ((velocity.y == 0)))){
kill();
};
var _local1:Boolean;
if ((((_point.y > (FlxG.height - 16))) && (!((velocity.y == 0))))){
_local1 = true;
y = (y - ((FlxG.height - 16) - _point.y));
velocity.y = 0;
};
if ((((((((belowObject == null)) || (belowObject.dead))) || (!((belowObject.velocity.y == 0))))) || ((Math.abs((belowObject.y - y)) > (height + 3))))){
if ((((((Math.abs((_point.y - FlxG.height)) > 32)) && (((!((belowObject == null))) && (belowObject.onScreen()))))) && (!(_local1)))){
velocity.y = 250;
};
};
}
override public function render():void{
if (dead){
gibs.render();
} else {
super.render();
if (dust.visible){
dust.render();
};
};
}
private function randRange(_arg1:Number, _arg2:Number):Number{
return ((Math.floor((Math.random() * ((_arg2 - _arg1) + 1))) + _arg1));
}
public function killbygunfire(){
lastTime = getTimer();
dead = true;
solid = false;
gibs.x = (x + origin.x);
gibs.y = (y + origin.y);
gibs.start();
}
public function delayDeathFunction(_arg1):void{
this.kill();
}
}
}//package halfbot.game.gameObjects
Section 17
//crate_ImgBigDust (halfbot.game.gameObjects.crate_ImgBigDust)
package halfbot.game.gameObjects {
import mx.core.*;
public class crate_ImgBigDust extends BitmapAsset {
}
}//package halfbot.game.gameObjects
Section 18
//crate_ImgCrate16 (halfbot.game.gameObjects.crate_ImgCrate16)
package halfbot.game.gameObjects {
import mx.core.*;
public class crate_ImgCrate16 extends BitmapAsset {
}
}//package halfbot.game.gameObjects
Section 19
//crate_ImgCrate16x32 (halfbot.game.gameObjects.crate_ImgCrate16x32)
package halfbot.game.gameObjects {
import mx.core.*;
public class crate_ImgCrate16x32 extends BitmapAsset {
}
}//package halfbot.game.gameObjects
Section 20
//crate_ImgCrate32 (halfbot.game.gameObjects.crate_ImgCrate32)
package halfbot.game.gameObjects {
import mx.core.*;
public class crate_ImgCrate32 extends BitmapAsset {
}
}//package halfbot.game.gameObjects
Section 21
//crate_ImgCrate32x16 (halfbot.game.gameObjects.crate_ImgCrate32x16)
package halfbot.game.gameObjects {
import mx.core.*;
public class crate_ImgCrate32x16 extends BitmapAsset {
}
}//package halfbot.game.gameObjects
Section 22
//crate_ImgSmallDust (halfbot.game.gameObjects.crate_ImgSmallDust)
package halfbot.game.gameObjects {
import mx.core.*;
public class crate_ImgSmallDust extends BitmapAsset {
}
}//package halfbot.game.gameObjects
Section 23
//crate_SoundEffect1 (halfbot.game.gameObjects.crate_SoundEffect1)
package halfbot.game.gameObjects {
import mx.core.*;
public class crate_SoundEffect1 extends SoundAsset {
}
}//package halfbot.game.gameObjects
Section 24
//crate_SoundEffect2 (halfbot.game.gameObjects.crate_SoundEffect2)
package halfbot.game.gameObjects {
import mx.core.*;
public class crate_SoundEffect2 extends SoundAsset {
}
}//package halfbot.game.gameObjects
Section 25
//game_object (halfbot.game.gameObjects.game_object)
package halfbot.game.gameObjects {
import org.flixel.*;
import halfbot.game.system.*;
public class game_object extends FlxSprite {
public var state:int;
public var paused:Boolean;// = false
public function game_object(_arg1:Number=0, _arg2:Number=0, _arg3:Class=null){
state = HB_GameData.STATE_IDLE;
super(_arg1, _arg2, _arg3);
}
}
}//package halfbot.game.gameObjects
Section 26
//gib (halfbot.game.gameObjects.gib)
package halfbot.game.gameObjects {
import org.flixel.*;
public class gib extends FlxSprite {
public function gib(_arg1:Class, _arg2:int=2){
if (_arg2 == 2){
loadGraphic(_arg1, true);
} else {
loadGraphic(_arg1, true, false, _arg2, _arg2);
};
width = (width / 2);
height = (height / 2);
offset.x = (width / 2);
offset.y = (height / 2);
randomFrame();
exists = false;
}
override public function hitLeft(_arg1:FlxObject, _arg2:Number):void{
if (_arg2 != 0){
super.hitLeft(_arg1, _arg2);
} else {
velocity.x = (velocity.x * -0.8);
};
}
override public function hitBottom(_arg1:FlxObject, _arg2:Number):void{
if (_arg2 != 0){
super.hitBottom(_arg1, _arg2);
} else {
velocity.x = (velocity.x * 0.5);
velocity.y = (velocity.y * -0.5);
};
}
}
}//package halfbot.game.gameObjects
Section 27
//player (halfbot.game.gameObjects.player)
package halfbot.game.gameObjects {
import org.flixel.*;
public class player extends FlxSprite {
public var playerHasMoved:Boolean;// = false
public var PARTICLES:int;// = 10
private var numAirJumps:int;// = 1
private var _curBullet:uint;
private var ImgPlayer:Class;
private var SoundEffect:Class;
private var SoundShoot:Class;
private var _bullets:Array;
private var gibs:FlxEmitter;
private var ImgGibs:Class;
private var _wallJump:Boolean;// = false
private var _bulletVel:int;
private var SoundJump:Class;
public function player(_arg1:Number, _arg2:Number, _arg3:Array){
ImgPlayer = player_ImgPlayer;
ImgGibs = player_ImgGibs;
SoundEffect = player_SoundEffect;
SoundJump = player_SoundJump;
SoundShoot = player_SoundShoot;
super(_arg1, _arg2);
loadGraphic(ImgPlayer, true, true);
playerHasMoved = false;
maxVelocity.x = 130;
acceleration.y = 400;
drag.x = (maxVelocity.x * 4);
width = 12;
height = 16;
offset.x = 10;
offset.y = 16;
addAnimation("idle", [0], 10, true);
addAnimation("walk", [1, 2, 3, 4, 0], 30, true);
addAnimation("flail", [6], 18, true);
addAnimation("jump", [5], 0, true);
addAnimation("shoot", [7, 8, 9, 10, 11], 30, true);
addAnimation("scrape", [13, 14], 15, true);
addAnimation("grab", [12], 30, true);
_bullets = _arg3;
_curBullet = 0;
_bulletVel = 360;
gibs = new FlxEmitter();
gibs.delay = -2;
gibs.gravity = 500;
gibs.setYSpeed(-300, 100);
gibs.setXSpeed(-300, 300);
var _local4:* = 0;
while (_local4 < PARTICLES) {
gibs.add(new gib(ImgGibs));
_local4++;
};
}
override public function hitLeft(_arg1:FlxObject, _arg2:Number):void{
super.hitLeft(_arg1, _arg2);
_wallJump = true;
}
override public function render():void{
if (dead){
gibs.render();
} else {
super.render();
};
}
override public function hitRight(_arg1:FlxObject, _arg2:Number):void{
super.hitRight(_arg1, _arg2);
_wallJump = true;
}
override public function kill():void{
FlxG.play(SoundEffect);
dead = true;
solid = false;
gibs.x = (x + origin.x);
gibs.y = (y + origin.y);
gibs.start();
}
override public function update():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
if (dead){
gibs.update();
return;
};
if (((_wallJump) && ((velocity.y < 0)))){
acceleration.y = 400;
} else {
if (((_wallJump) && ((velocity.y > 0)))){
acceleration.y = 200;
} else {
acceleration.y = 400;
};
};
acceleration.x = 0;
if (x < 0){
x = 0;
};
if (x > (FlxG.width - width)){
x = (FlxG.width - width);
};
if (((FlxG.keys.LEFT) || (FlxG.keys.A))){
facing = LEFT;
acceleration.x = (acceleration.x - drag.x);
} else {
if (((FlxG.keys.RIGHT) || (FlxG.keys.D))){
facing = RIGHT;
acceleration.x = (acceleration.x + drag.x);
};
};
if (((((FlxG.keys.justPressed("X")) || (FlxG.keys.justPressed("UP")))) || (FlxG.keys.justPressed("W")))){
playerHasMoved = true;
if (onFloor){
FlxG.play(SoundJump);
velocity.y = (-(acceleration.y) * 0.51);
play("jump");
} else {
if ((((facing == LEFT)) && (_wallJump))){
FlxG.play(SoundJump);
velocity.y = (-(acceleration.y) * 0.85);
play("jump");
} else {
if ((((facing == RIGHT)) && (_wallJump))){
FlxG.play(SoundJump);
velocity.y = (-(acceleration.y) * 0.85);
play("jump");
} else {
if (numAirJumps > 0){
FlxG.play(SoundJump);
numAirJumps--;
velocity.y = (-(acceleration.y) * 0.51);
play("jump");
};
};
};
};
} else {
if (onFloor){
numAirJumps = 1;
if (velocity.x != 0){
playerHasMoved = true;
play("walk");
} else {
if (((FlxG.keys.justPressed("C")) || (FlxG.keys.justPressed("SPACE")))){
playerHasMoved = true;
_local1 = 0;
_local2 = 0;
_local3 = x;
_local4 = (y + 4);
if (facing == RIGHT){
_local3 = (_local3 + (width - 4));
_local1 = _bulletVel;
} else {
_local3 = (_local3 - (_bullets[_curBullet].width - 4));
_local1 = -(_bulletVel);
};
_bullets[_curBullet].shoot(_local3, _local4, _local1, _local2);
if (++_curBullet >= _bullets.length){
_curBullet = 0;
};
FlxG.play(SoundShoot);
this.play("shoot");
} else {
if (this.finished){
play("idle");
};
};
};
} else {
if (velocity.y < 0){
if (((this._wallJump) && ((Math.abs(velocity.y) < 20)))){
play("grab");
} else {
play("jump");
};
} else {
if (_wallJump){
play("scrape");
} else {
play("flail");
};
};
};
};
_wallJump = false;
super.update();
}
}
}//package halfbot.game.gameObjects
Section 28
//player_ImgGibs (halfbot.game.gameObjects.player_ImgGibs)
package halfbot.game.gameObjects {
import mx.core.*;
public class player_ImgGibs extends BitmapAsset {
}
}//package halfbot.game.gameObjects
Section 29
//player_ImgPlayer (halfbot.game.gameObjects.player_ImgPlayer)
package halfbot.game.gameObjects {
import mx.core.*;
public class player_ImgPlayer extends BitmapAsset {
}
}//package halfbot.game.gameObjects
Section 30
//player_SoundEffect (halfbot.game.gameObjects.player_SoundEffect)
package halfbot.game.gameObjects {
import mx.core.*;
public class player_SoundEffect extends SoundAsset {
}
}//package halfbot.game.gameObjects
Section 31
//player_SoundJump (halfbot.game.gameObjects.player_SoundJump)
package halfbot.game.gameObjects {
import mx.core.*;
public class player_SoundJump extends SoundAsset {
}
}//package halfbot.game.gameObjects
Section 32
//player_SoundShoot (halfbot.game.gameObjects.player_SoundShoot)
package halfbot.game.gameObjects {
import mx.core.*;
public class player_SoundShoot extends SoundAsset {
}
}//package halfbot.game.gameObjects
Section 33
//scrollingSprites (halfbot.game.gameObjects.scrollingSprites)
package halfbot.game.gameObjects {
import org.flixel.*;
public class scrollingSprites extends FlxSprite {
protected var _y:Number;
protected var _offset:int;// = -1
public function scrollingSprites(_arg1:int, _arg2:int, _arg3:Class, _arg4:int=-1){
super(_arg1, _arg2, _arg3);
_y = _arg2;
_offset = _arg4;
}
override public function update():void{
if (acceleration.y != 0){
super.update();
};
getScreenXY(_point);
if (_point.y > FlxG.height){
if (_offset == -1){
y = (y - ((FlxG.height + (FlxU.random() * 5)) + (FlxU.random() * 30)));
} else {
y = (y - _offset);
};
};
}
}
}//package halfbot.game.gameObjects
Section 34
//StartFloor (halfbot.game.gameObjects.StartFloor)
package halfbot.game.gameObjects {
import org.flixel.*;
public class StartFloor extends FlxSprite {
private var wall:Class;
public function StartFloor(_arg1:Number, _arg2:Number){
wall = StartFloor_wall;
super(_arg1, _arg2);
loadGraphic(wall, true, false, 320, 95);
maxVelocity.x = 0;
acceleration.y = 0;
drag.x = 0;
this.fixed = true;
width = 320;
height = 95;
offset.x = 0;
offset.y = 0;
addAnimation("idle", [0], 0, false);
}
override public function update():void{
super.update();
}
}
}//package halfbot.game.gameObjects
Section 35
//StartFloor_wall (halfbot.game.gameObjects.StartFloor_wall)
package halfbot.game.gameObjects {
import mx.core.*;
public class StartFloor_wall extends BitmapAsset {
}
}//package halfbot.game.gameObjects
Section 36
//blockPause (halfbot.game.gameScreen.blockPause)
package halfbot.game.gameScreen {
import org.flixel.*;
import halfbot.game.system.*;
public class blockPause extends FlxGroup {
private var ImgKeyP:Class;
private var ImgKey0:Class;
private var ImgKeyPlus:Class;
private var ImgKeyMinus:Class;
public function blockPause(){
var _local2:uint;
ImgKeyMinus = blockPause_ImgKeyMinus;
ImgKeyPlus = blockPause_ImgKeyPlus;
ImgKey0 = blockPause_ImgKey0;
ImgKeyP = blockPause_ImgKeyP;
super();
scrollFactor.x = 0;
scrollFactor.y = 0;
var _local1:uint = 120;
_local2 = 100;
x = ((FlxG.width - _local1) / 2);
y = ((FlxG.height - _local2) / 2);
add(new FlxSprite().createGraphic(_local1, _local2, 2852126720, true), true);
(add(new FlxText(0, 0, _local1, (HB.GAME_NAME + " is")), true) as FlxText).alignment = "center";
add(new FlxText(0, 10, _local1, "PAUSED").setFormat(null, 16, 0xFFFFFF, "center"), true);
add(new FlxSprite(4, 36, ImgKeyP), true);
add(new FlxText(16, 36, (_local1 - 16), "Pause Game"), true);
add(new FlxSprite(4, 50, ImgKey0), true);
add(new FlxText(16, 50, (_local1 - 16), "Mute Sound"), true);
add(new FlxSprite(4, 64, ImgKeyMinus), true);
add(new FlxText(16, 64, (_local1 - 16), "Sound Down"), true);
add(new FlxSprite(4, 78, ImgKeyPlus), true);
add(new FlxText(16, 78, (_local1 - 16), "Sound Up"), true);
}
}
}//package halfbot.game.gameScreen
Section 37
//blockPause_ImgKey0 (halfbot.game.gameScreen.blockPause_ImgKey0)
package halfbot.game.gameScreen {
import mx.core.*;
public class blockPause_ImgKey0 extends BitmapAsset {
}
}//package halfbot.game.gameScreen
Section 38
//blockPause_ImgKeyMinus (halfbot.game.gameScreen.blockPause_ImgKeyMinus)
package halfbot.game.gameScreen {
import mx.core.*;
public class blockPause_ImgKeyMinus extends BitmapAsset {
}
}//package halfbot.game.gameScreen
Section 39
//blockPause_ImgKeyP (halfbot.game.gameScreen.blockPause_ImgKeyP)
package halfbot.game.gameScreen {
import mx.core.*;
public class blockPause_ImgKeyP extends BitmapAsset {
}
}//package halfbot.game.gameScreen
Section 40
//blockPause_ImgKeyPlus (halfbot.game.gameScreen.blockPause_ImgKeyPlus)
package halfbot.game.gameScreen {
import mx.core.*;
public class blockPause_ImgKeyPlus extends BitmapAsset {
}
}//package halfbot.game.gameScreen
Section 41
//BlocksGameScreen (halfbot.game.gameScreen.BlocksGameScreen)
package halfbot.game.gameScreen {
import flash.events.*;
import flash.net.*;
import com.gskinner.motion.*;
import flash.utils.*;
import org.flixel.*;
import flash.display.*;
import com.bit101.components.*;
import flash.geom.*;
import halfbot.game.system.*;
import SWFStats.*;
import halfbot.game.gameObjects.*;
import flash.ui.*;
import flash.system.*;
import org.flixel.data.*;
public class BlocksGameScreen extends FlxState {
private var lastScroll:Number;// = 0
private var ImgDebris:Class;
private var background_image:Class;
private var highScore:FlxText;
public var loader:URLLoader;
public var waitforload:Boolean;// = true
public var nextGameState:FlxState;
private var maxHeightSmall:FlxText;
public var restartRequested;// = false
public var restartGameShadow:FlxText;
public var waitTimeOut:int;// = 10
private var background_beam:Class;
private var ImgBG:Class;
private var _forGround:FlxGroup;
private var background_city_image:Class;
private var twitterButtonBig:FlxButton;
private var nameSmall:FlxText;
private var background_overlay:Class;
public var bestScoresArray:Array;
private var lastQuakeTime:Number;// = 0
private var playerJustStarted:Boolean;// = true
private var ImgTwitter:Class;
private var initialsInput:FlxInputText;
private var SoundEffectQuake:Class;
private var highScoreShadow:FlxText;
public var theMusic:Class;
private var waitForLoadVars:Boolean;// = false
private var beam1:FlxSprite;
private var submitButton:FlxButton;
public var l:Loader;
private var animations:MovieClip;
private var startingMeters:int;// = -2
public var moreGames:FlxButton;
private var background_banner1:Class;
private var sideBar1:FlxSprite;
private var sideBar2:FlxSprite;
private var localCamera:camera_block;
private var scoreBox2:FlxText;
private var sideBar0:FlxSprite;
private var distanceHeight:uint;// = 1
public var loader2:URLLoader;
public var HighScoreModuleLoadingComplete:Boolean;
private var _bullets:FlxGroup;
private var lastTime:Number;// = 0
private var ImgHelp:Class;
private var banner1:FlxSprite;
private var banner2:FlxSprite;
private var enterName:FlxText;
public var HighScoreModule;// = null
private var twitterButton:FlxButton;
private var background_banner2:Class;
private var ImgTwitterBig:Class;
private var enterNameShadow:FlxText;
private var ImgSubmit:Class;
public var mc:MovieClip;// = null
public var restartGame:FlxText;
private var ImgTiles:Class;
private var _blocks:FlxGroup;
private var gameOverShadow:FlxText;
private var maxHeight:FlxText;
private var bestbar:FlxSprite;
private var gameIsOver:Boolean;// = false
private var thePlayer:player;
private var gibs:FlxEmitter;
private var ImgMap:Class;
private var maxHeightShadow:FlxText;
private var ImgBestLine:Class;
public var HighScoreModuleLoader:Loader;
private var bottomLine:FlxSprite;
var trans:Class;
private var _background:FlxGroup;
private var SoundEffect1:Class;
private var SoundEffect2:Class;
private var _objects:FlxGroup;
private var waitingForVariable:Boolean;// = false
private var scoreBox:FlxText;
public var helpButton:FlxButton;
private var maxHeightNum:int;// = 0
private var gameOver:FlxText;
private var topLine:FlxSprite;
public var creditsRequested:Boolean;// = false
private var ImgGibs:Class;
public function BlocksGameScreen(){
ImgMap = BlocksGameScreen_ImgMap;
ImgTiles = BlocksGameScreen_ImgTiles;
ImgBG = BlocksGameScreen_ImgBG;
ImgGibs = BlocksGameScreen_ImgGibs;
ImgBestLine = BlocksGameScreen_ImgBestLine;
ImgTwitter = BlocksGameScreen_ImgTwitter;
ImgTwitterBig = BlocksGameScreen_ImgTwitterBig;
ImgSubmit = BlocksGameScreen_ImgSubmit;
SoundEffect1 = BlocksGameScreen_SoundEffect1;
SoundEffect2 = BlocksGameScreen_SoundEffect2;
SoundEffectQuake = BlocksGameScreen_SoundEffectQuake;
ImgDebris = BlocksGameScreen_ImgDebris;
ImgHelp = BlocksGameScreen_ImgHelp;
background_image = BlocksGameScreen_background_image;
background_city_image = BlocksGameScreen_background_city_image;
background_overlay = BlocksGameScreen_background_overlay;
background_beam = BlocksGameScreen_background_beam;
background_banner1 = BlocksGameScreen_background_banner1;
background_banner2 = BlocksGameScreen_background_banner2;
loader = new URLLoader();
loader2 = new URLLoader();
HighScoreModuleLoader = new Loader();
bestScoresArray = new Array();
theMusic = BlocksGameScreen_theMusic;
trans = BlocksGameScreen_trans;
super();
}
protected function submitButtonPress():void{
if ((((initialsInput.getText() == "")) || (!(submitButton.visible)))){
return;
};
waitingForVariable = true;
HighScores.Submit(initialsInput.getText(), uint((startingMeters + (distanceHeight / 8))), "HighScores", oncomplete, false);
GTweener.to(this, 10, {waitTimeOut:0}, {onComplete:timeOut});
initialsInput.visible = false;
submitButton.visible = false;
enterName.visible = false;
enterNameShadow.visible = false;
}
public function varsLoaded2(_arg1:Event):void{
var _local2:int;
while (_local2 < 10) {
if (((loader2.data) && (loader2.data[("name" + (_local2 + 1))]))){
HB_Data_Engine.sharedObject.data[("name" + _local2)] = loader2.data[("name" + (_local2 + 1))];
HB_Data_Engine.sharedObject.data[("score" + _local2)] = loader2.data[("score" + (_local2 + 1))];
} else {
HB_Data_Engine.sharedObject.data[("score" + _local2)] = 0;
HB_Data_Engine.sharedObject.data[("name" + _local2)] = "Empty";
};
_local2++;
};
HB_Data_Engine.lastScoreObtain = getTimer();
HB_Data_Engine.saveData();
waitingForVariable = false;
}
override public function create():void{
var _local1:FlxSprite;
var _local2:FlxSprite;
_local1 = new FlxSprite(0, 0, background_image);
_local1.scrollFactor.y = 0;
add(_local1);
_local2 = new FlxSprite(0, 100, background_city_image);
_local2.scrollFactor.y = 0.3;
add(_local2);
gibs = new FlxEmitter();
gibs.delay = -10;
gibs.gravity = 100;
gibs.setYSpeed(-100, 100);
gibs.setXSpeed(-50, 50);
var _local3:int;
while (_local3 < 8) {
gibs.add(new gib(ImgDebris));
_local3++;
};
add(gibs);
FlxG.mouse.hide();
Mouse.show();
if (HB.EDITOR){
setupEditor();
};
restart();
animations = MovieClip(new trans());
animations.addEventListener(Event.COMPLETE, onComplete);
addChild(animations);
FlxG.play(theMusic, 0.5, true);
}
public function restart(){
var _local1:FlxTileblock;
var _local4:FlxSprite;
var _local5:URLRequest;
var _local6:int;
var _local7:String;
if (((HB.IS_GAME_BUTLER) && (!(HB.KONG)))){
Security.allowDomain("http://www.gamesbutler.com/");
addChild(HighScoreModuleLoader);
_local5 = new URLRequest(("http://gamesbutler.com/HighScoreModule?rnd=" + Math.random()));
HighScoreModuleLoader.contentLoaderInfo.addEventListener(Event.INIT, HighScoreModuleInitHandler);
HighScoreModuleLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, HighScoreModuleInitHandler);
HighScoreModuleLoader.load(_local5);
} else {
if (HB.KONG){
if (!FlxG.kong){
(FlxG.kong = (parent.addChild(new FlxKong()) as FlxKong)).init();
};
};
};
_blocks = new FlxGroup();
_objects = new FlxGroup();
_forGround = new FlxGroup();
_background = new FlxGroup();
_bullets = new FlxGroup();
_local1 = new FlxTileblock(0, (480 - 16), 320, 16);
_local1.loadGraphic(ImgTiles);
beam1 = new scrollingSprites(0, (-(FlxG.height) / 10), background_beam);
beam1.scrollFactor.y = 0.8;
_background.add(beam1);
if (HB_Data_Engine.bestHeight >= 10){
bestbar = new FlxSprite(0, ((FlxG.height - 95) - (HB_Data_Engine.bestHeight * 8)), ImgBestLine);
_background.add(bestbar);
bestbar.alpha = 0.6;
bestbar.scrollFactor.y = 1;
bestbar.visible = true;
nameSmall = new FlxText(20, (((FlxG.height - 95) - (HB_Data_Engine.bestHeight * 8)) - 6), (FlxG.width - 20));
nameSmall.scrollFactor.y = 1;
nameSmall.alpha = bestbar.alpha;
nameSmall.setFormat("system", 8, 268435455, "left");
_background.add(nameSmall);
nameSmall.text = "BEST";
nameSmall.visible = true;
maxHeightSmall = new FlxText(-20, (((FlxG.height - 95) - (HB_Data_Engine.bestHeight * 8)) - 6), FlxG.width);
maxHeightSmall.scrollFactor.y = 1;
maxHeightSmall.alpha = bestbar.alpha;
maxHeightSmall.setFormat("system", 8, 268435455, "right");
_background.add(maxHeightSmall);
maxHeightSmall.text = (HB_Data_Engine.bestHeight + "m");
maxHeightSmall.visible = true;
bestScoresArray.push(bestbar);
bestScoresArray.push(nameSmall);
bestScoresArray.push(maxHeightSmall);
};
var _local2:int;
while (_local2 < 5) {
_local6 = HB_Data_Engine.sharedObject.data[("score" + _local2)];
_local7 = HB_Data_Engine.sharedObject.data[("name" + _local2)];
if (((((!((_local6 == 0))) && (!((_local7 == null))))) && ((_local6 > 50)))){
trace(((("Loaded " + _local7) + " with score ") + _local6));
bestbar = new FlxSprite(0, ((FlxG.height - 95) - (_local6 * 8)), ImgBestLine);
_background.add(bestbar);
bestbar.alpha = 0.6;
bestbar.scrollFactor.y = 1;
bestbar.visible = false;
bestbar.color = 16563018;
nameSmall = new FlxText(20, (((FlxG.height - 95) - (_local6 * 8)) - 6), (FlxG.width - 20));
nameSmall.scrollFactor.y = 1;
nameSmall.alpha = bestbar.alpha;
nameSmall.setFormat("system", 8, 268435455, "left");
_background.add(nameSmall);
nameSmall.text = _local7.toUpperCase();
nameSmall.visible = false;
nameSmall.color = 16563018;
maxHeightSmall = new FlxText(-20, (((FlxG.height - 95) - (_local6 * 8)) - 6), FlxG.width);
maxHeightSmall.scrollFactor.y = 1;
maxHeightSmall.alpha = bestbar.alpha;
maxHeightSmall.setFormat("system", 8, 268435455, "right");
_background.add(maxHeightSmall);
maxHeightSmall.text = (_local6 + "m");
maxHeightSmall.visible = false;
maxHeightSmall.color = 16563018;
bestScoresArray.push(bestbar);
bestScoresArray.push(nameSmall);
bestScoresArray.push(maxHeightSmall);
};
_local2++;
};
banner1 = new FlxSprite(0, ((FlxG.height - 95) - 113), background_banner1);
banner1.scrollFactor.y = 1;
banner1.visible = true;
_background.add(banner1);
banner2 = new FlxSprite(0, ((FlxG.height - 95) - 700), background_banner2);
banner2.scrollFactor.y = 1;
banner2.visible = true;
_background.add(banner2);
add(_background);
background_banner1;
if (HB_Data_Engine.bestHeight < 10){
};
thePlayer = new player(170, (480 - 100), _bullets.members);
add(thePlayer);
var _local3:* = 0;
while (_local3 < 8) {
_bullets.add(new bullet());
_local3++;
};
_blocks.add(new StartFloor(0, (480 - 95)));
localCamera = new camera_block(thePlayer.x, thePlayer.y, thePlayer);
localCamera.visible = false;
add(localCamera);
add(_objects);
add(_blocks);
add(_bullets);
FlxU.collide(thePlayer, _objects);
FlxU.collide(thePlayer, _blocks);
FlxU.collide(_blocks, _objects);
FlxU.collide(_objects, _objects);
FlxU.overlap(thePlayer, _blocks, blockCollidePlayer);
FlxU.overlap(thePlayer, _objects, blockCollidePlayer);
FlxU.overlap(_objects, _objects, blockCollided);
FlxU.overlap(_blocks, _objects, blockCollided);
FlxU.overlap(_bullets, _objects, overlapped);
FlxG.follow(localCamera, 1);
FlxG.followAdjust(0, 0);
FlxG.followBounds(0, -20000000, 320, 480);
sideBar0 = new scrollingSprites(0, 0, background_overlay, 753);
sideBar0.scrollFactor.y = 1.5;
_forGround.add(sideBar0);
sideBar1 = new scrollingSprites(0, 251, background_overlay, 753);
sideBar1.scrollFactor.y = 1.5;
_forGround.add(sideBar1);
sideBar2 = new scrollingSprites(0, -251, background_overlay, 753);
sideBar2.scrollFactor.y = 1.5;
_forGround.add(sideBar2);
sideBar2 = new scrollingSprites(0, -251, background_overlay, 753);
sideBar2.scrollFactor.y = 1.5;
_forGround.add(sideBar2);
add(_forGround);
scoreBox2 = new FlxText((FlxG.width / 2), 0, (FlxG.width / 2));
scoreBox2.scrollFactor.y = 0;
scoreBox2.scrollFactor.x = 0;
scoreBox2.setFormat("system", 32, 0, "right");
add(scoreBox2);
scoreBox = new FlxText(((FlxG.width / 2) + 1), (0 + 1), (FlxG.width / 2));
scoreBox.scrollFactor.y = 0;
scoreBox.scrollFactor.x = 0;
scoreBox.setFormat("system", 32, 268435455, "right");
scoreBox.scale.x = 1;
scoreBox.scale.y = 1;
add(scoreBox);
gameOverShadow = new FlxText(1, ((FlxG.height / 4) + 1), FlxG.width);
gameOverShadow.scrollFactor.y = 0;
gameOverShadow.scrollFactor.x = 0;
gameOverShadow.setFormat("system", 32, 0, "center");
add(gameOverShadow);
gameOverShadow.text = "GAME OVER";
gameOverShadow.visible = false;
gameOver = new FlxText(0, (FlxG.height / 4), FlxG.width);
gameOver.scrollFactor.y = 0;
gameOver.scrollFactor.x = 0;
gameOver.setFormat("system", 32, 268435455, "center");
add(gameOver);
gameOver.text = "GAME OVER";
gameOver.visible = false;
highScoreShadow = new FlxText(1, (((FlxG.height / 4) + 30) + 1), FlxG.width);
highScoreShadow.scrollFactor.y = 0;
highScoreShadow.scrollFactor.x = 0;
highScoreShadow.setFormat("system", 32, 0, "center");
add(highScoreShadow);
highScoreShadow.text = (("" + 200) + "m");
highScoreShadow.visible = false;
highScore = new FlxText(0, ((FlxG.height / 4) + 30), FlxG.width);
highScore.scrollFactor.y = 0;
highScore.scrollFactor.x = 0;
highScore.setFormat("system", 32, 268435455, "center");
add(highScore);
highScore.text = (("" + 200) + "m");
highScore.visible = false;
enterNameShadow = new FlxText(1, (((FlxG.height / 4) + 70) + 1), FlxG.width);
enterNameShadow.scrollFactor.y = 0;
enterNameShadow.scrollFactor.x = 0;
enterNameShadow.setFormat("system", 16, 0, "center");
add(enterNameShadow);
enterNameShadow.text = "ENTER YOUR NAME:";
enterNameShadow.visible = false;
enterName = new FlxText(0, ((FlxG.height / 4) + 70), FlxG.width);
enterName.scrollFactor.y = 0;
enterName.scrollFactor.x = 0;
enterName.setFormat("system", 16, 268435455, "center");
add(enterName);
enterName.text = "ENTER YOUR NAME:";
enterName.visible = false;
twitterButton = new FlxButton((FlxG.width - 20), (FlxG.height - 20), twitterButtonPress);
_local4 = new FlxSprite(0, 0, ImgTwitter);
twitterButton.scrollFactor.y = 0;
_local4.scale.x = 1;
_local4.scale.y = 1;
twitterButton.loadGraphic(_local4);
add(twitterButton);
maxHeightNum = HB_Data_Engine.bestHeight;
maxHeightShadow = new FlxText(-19, (FlxG.height - 18), FlxG.width);
maxHeightShadow.scrollFactor.y = 0;
maxHeightShadow.scrollFactor.x = 0;
maxHeightShadow.setFormat("system", 8, 0, "right");
add(maxHeightShadow);
maxHeightShadow.text = (("BEST " + HB_Data_Engine.bestHeight) + "m");
maxHeightShadow.visible = true;
maxHeight = new FlxText(-20, (FlxG.height - 18), FlxG.width);
maxHeight.scrollFactor.y = 0;
maxHeight.scrollFactor.x = 0;
maxHeight.setFormat("system", 8, 268435455, "right");
add(maxHeight);
maxHeight.text = (("BEST " + HB_Data_Engine.bestHeight) + "m");
maxHeight.visible = true;
helpButton = new FlxButton(5, (FlxG.height - 40), helpButtonPress);
_local4 = new FlxSprite(0, 0, ImgHelp);
helpButton.scrollFactor.y = 0;
helpButton.visible = false;
_local4.scale.x = 1;
_local4.scale.y = 1;
helpButton.loadGraphic(_local4);
add(helpButton);
}
public function showGameOver(){
gameIsOver = true;
highScoreShadow.text = (("" + uint((startingMeters + (distanceHeight / 8)))) + "m");
highScore.text = (("" + uint((startingMeters + (distanceHeight / 8)))) + "m");
maxHeightNum = ((uint((startingMeters + (distanceHeight / 8))) > maxHeightNum)) ? uint((startingMeters + (distanceHeight / 8))) : maxHeightNum;
Log.LevelAverageMetric("Death", 1, uint((startingMeters + (distanceHeight / 8))));
if (HB_Data_Engine.bestHeight < 10000000){
HB_Data_Engine.bestHeight = maxHeightNum;
HB_Data_Engine.saveData();
} else {
HB_Data_Engine.bestHeight = 0;
HB_Data_Engine.saveData();
};
helpButton.visible = true;
var _local1 = 195;
initialsInput = (new FlxInputText(((FlxG.width - _local1) / 2), (enterName.y + 25), _local1, 35, HB_Data_Engine.lastNameEntered, 0xFFFFFF, null, 32) as FlxInputText);
submitButton = new FlxButton((FlxG.width / 2), (enterName.y + 65), submitButtonPress);
submitButton.loadGraphic(new FlxSprite(0, 0, this.ImgSubmit));
submitButton.scrollFactor.y = 0;
submitButton.scrollFactor.x = 0;
submitButton.x = (submitButton.x - (submitButton.width / 2));
if (((HB.IS_GENERIC) || (HB.KONG))){
initialsInput.setMaxLength(5);
initialsInput.filterMode = FlxInputText.ONLY_ALPHA;
initialsInput.forceUpperCase = true;
initialsInput.active = true;
add(initialsInput);
add(submitButton);
enterName.visible = true;
enterNameShadow.visible = true;
if (HB.KONG){
if (FlxG.kong){
FlxG.kong.API.stats.submitArray([{name:"Best Height", value:HB_Data_Engine.bestHeight}, {name:"Total Distance", value:uint((startingMeters + (distanceHeight / 8)))}]);
};
};
} else {
if (((HB.IS_GAME_BUTLER) && (!(HB.KONG)))){
HighScoreModule.showSubmitScore(uint((startingMeters + (distanceHeight / 8))), submitComplete);
};
};
gameOver.visible = true;
highScore.visible = true;
gameOverShadow.visible = true;
highScoreShadow.visible = true;
restartGameShadow = new FlxText(1, ((FlxG.height - 50) + 1), FlxG.width);
restartGameShadow.scrollFactor.y = 0;
restartGameShadow.scrollFactor.x = 0;
restartGameShadow.setFormat("system", 8, 0, "center");
add(restartGameShadow);
restartGameShadow.text = "SPACE BAR TO RESTART";
restartGame = new FlxText(0, (FlxG.height - 50), FlxG.width);
restartGame.scrollFactor.y = 0;
restartGame.scrollFactor.x = 0;
restartGame.setFormat("system", 8, 268435455, "center");
add(restartGame);
restartGame.text = "SPACE BAR TO RESTART";
fadeStart(null);
}
protected function HighScoreModuleInitHandler(_arg1){
if (!HighScoreModuleLoadingComplete){
HighScoreModule = HighScoreModuleLoader.content;
HighScoreModule.init("4346", "Blocks Cometh");
HighScoreModuleLoadingComplete = true;
};
}
public function blockCollidePlayer(_arg1:FlxSprite, _arg2:FlxSprite){
if (thePlayer.y > _arg2.y){
thePlayer.kill();
showGameOver();
};
}
protected function helpButtonPress():void{
if (((((!(waitingForVariable)) && (!(creditsRequested)))) && (!(restartRequested)))){
creditsRequested = true;
mc.gotoAndPlay(0);
nextGameState = new creditsScreen();
(nextGameState as creditsScreen).backtogame = true;
this.initialsInput.visible = false;
};
}
function oncomplete(_arg1:Boolean){
if (_arg1){
ShowScores();
};
}
public function timeOut(_arg1):void{
waitingForVariable = false;
}
private function randRange(_arg1:Number, _arg2:Number):Number{
return ((Math.floor((Math.random() * ((_arg2 - _arg1) + 1))) + _arg1));
}
public function fadeStart(_arg1):void{
if (restartGame.alpha == 1){
GTweener.to(restartGame, 1.5, {alpha:0}, {onComplete:fadeStart});
GTweener.to(restartGameShadow, 1.5, {alpha:0});
} else {
GTweener.to(restartGame, 1.5, {alpha:1}, {onComplete:fadeStart});
GTweener.to(restartGameShadow, 1.5, {alpha:1});
};
}
public function varsLoaded(_arg1:Event):void{
var urlReq:URLRequest;
var event = _arg1;
try {
urlReq = new URLRequest("http://www.halfbot.com/scoreUpload/blocks_c/get_score2.php?flash=1");
urlReq.method = URLRequestMethod.GET;
loader2.dataFormat = URLLoaderDataFormat.VARIABLES;
loader2.addEventListener(Event.COMPLETE, varsLoaded2);
loader2.addEventListener(IOErrorEvent.IO_ERROR, serverError);
loader2.load(urlReq);
GTweener.to(this, 10, {waitTimeOut:0}, {onComplete:timeOut});
} catch(error:Error) {
};
}
public function setupEditor(){
var _local1:Window = new Window(this, (HB.SCREEN_WIDTH / 4), 0, "Tools");
_local1.width = (HB.SCREEN_WIDTH / 2);
_local1.height = (HB.SCREEN_HEIGHT / 4);
_local1.hasMinimizeButton = true;
_local1.minimized = true;
var _local2:* = new PushButton(_local1.content, 10, 10, "New Crumb", onClick);
_local2 = new PushButton(_local1.content, 10, 30, "Delete Selected", onClick);
Mouse.show();
}
private function onComplete(_arg1:Event):void{
l = (animations.getChildAt(0) as Loader);
mc = (l.content as MovieClip);
mc.gotoAndPlay(13);
waitforload = false;
}
function DisplayScores(_arg1:Array):void{
var _local3:Object;
var _local2:* = 0;
while (_local2 < 10) {
if (((!((_arg1 == null))) && ((_local2 < _arg1.length)))){
_local3 = _arg1[_local2];
trace(((("Got gcore with name " + _local3.Name) + " and score ") + _local3.Points));
HB_Data_Engine.sharedObject.data[("name" + _local2)] = _local3.Name;
HB_Data_Engine.sharedObject.data[("score" + _local2)] = _local3.Points;
} else {
HB_Data_Engine.sharedObject.data[("score" + _local2)] = 0;
HB_Data_Engine.sharedObject.data[("name" + _local2)] = "Empty";
};
_local2++;
};
waitingForVariable = false;
}
public function blockCollided(_arg1:FlxSprite, _arg2:FlxSprite){
if (((!((_arg1.velocity.y == 0))) && ((_arg1.y < _arg2.y)))){
_arg1.y = (_arg2.y - _arg1.height);
(_arg1 as crate).belowObject = _arg2;
if ((((_arg1.width == 16)) && ((_arg2.velocity.y == 0)))){
FlxG.play(SoundEffect2, 0.1, false);
} else {
if (_arg2.velocity.y == 0){
FlxG.play(SoundEffect2, 0.2, false);
};
};
_arg1.velocity.y = 0;
if ((_arg1 is crate)){
(_arg1 as crate).dust.play("dust");
(_arg1 as crate).dust.visible = true;
};
} else {
_arg2.y = (_arg1.y - _arg2.height);
(_arg2 as crate).belowObject = _arg1;
if ((((_arg2.width == 16)) && ((_arg1.velocity.y == 0)))){
FlxG.play(SoundEffect2, 0.1, false);
} else {
if (_arg1.velocity.y == 0){
FlxG.play(SoundEffect2, 0.2, false);
};
};
_arg2.velocity.y = 0;
if ((_arg2 is crate)){
(_arg2 as crate).dust.play("dust");
(_arg2 as crate).dust.visible = true;
};
};
}
public function serverError(_arg1:Event):void{
trace("Server Error!");
waitingForVariable = false;
}
function ShowScores():void{
HighScores.Scores(false, "HighScores", this.DisplayScores);
}
override public function render():void{
if (waitforload){
return;
};
super.render();
}
protected function overlapped(_arg1:FlxObject, _arg2:FlxObject):void{
if ((_arg1 is bullet)){
_arg1.kill();
};
if ((_arg2 is crate)){
(_arg2 as crate).killbygunfire();
};
}
protected function twitterButtonPress():void{
Log.CustomMetric("Clicked Twitter Button");
if (HB.IS_GENERIC){
FlxU.openURL(("http://twitter.com/home?status=" + encodeURIComponent((("Climbed to " + HB_Data_Engine.bestHeight) + "m in #TheBlocksCometh. Dare you to do better! Play it at http://www.halfbot.com"))));
} else {
if (HB.IS_GAME_BUTLER){
FlxU.openURL(("http://twitter.com/home?status=" + encodeURIComponent((("Climbed to " + HB_Data_Engine.bestHeight) + "m in #TheBlocksCometh. Dare you to do better! Play it at http://www.gamesbutler.com/"))));
};
};
}
override public function update():void{
var _local10:int;
var _local11:crate;
var _local12:int;
var _local13:crate;
var _local14:int;
var _local15:crate;
var _local16:int;
super.update();
if (gameIsOver){
if (((((restartRequested) || (creditsRequested))) && ((mc.currentFrame == 12)))){
FlxG.state = nextGameState;
};
submitButton.visible = ((!((initialsInput.getText().length == 0))) && (initialsInput.visible));
};
if (thePlayer.dead){
if (waitingForVariable){
restartGameShadow.text = "UPLOADING SCORE...";
restartGame.text = "UPLOADING SCORE...";
} else {
restartGameShadow.text = "SPACE BAR TO RESTART";
restartGame.text = "SPACE BAR TO RESTART";
};
if (((((FlxG.keys.justPressed("SPACE")) && (!(waitingForVariable)))) && (!(restartRequested)))){
this.initialsInput.visible = false;
nextGameState = new BlocksGameScreen();
restartRequested = true;
mc.gotoAndPlay(0);
};
};
var _local1:int;
while (_local1 < bestScoresArray.length) {
if ((bestScoresArray[_local1] as FlxSprite).onScreen()){
(bestScoresArray[_local1] as FlxSprite).visible = true;
(bestScoresArray[(_local1 + 1)] as FlxSprite).visible = true;
(bestScoresArray[(_local1 + 2)] as FlxSprite).visible = true;
} else {
(bestScoresArray[_local1] as FlxSprite).visible = false;
(bestScoresArray[(_local1 + 1)] as FlxSprite).visible = false;
(bestScoresArray[(_local1 + 2)] as FlxSprite).visible = false;
};
_local1 = (_local1 + 3);
};
FlxU.collide(thePlayer, _objects);
FlxU.collide(thePlayer, _blocks);
FlxU.collide(_blocks, _objects);
FlxU.collide(_objects, _objects);
FlxU.overlap(thePlayer, _blocks, blockCollidePlayer);
FlxU.overlap(thePlayer, _objects, blockCollidePlayer);
FlxU.overlap(_objects, _objects, blockCollided);
FlxU.overlap(_blocks, _objects, blockCollided);
FlxU.overlap(_bullets, _objects, overlapped);
if (!thePlayer.playerHasMoved){
return;
};
var _local2:int = getTimer();
if ((_local2 - lastQuakeTime) >= 20000){
lastQuakeTime = _local2;
playerJustStarted = true;
};
if (playerJustStarted){
gibs.y = ((localCamera.y - FlxG.height) - 50);
gibs.x = (320 / 2);
gibs.start();
FlxG.quake.start(0.004, 3.5);
FlxG.play(SoundEffectQuake, 0.4, false);
playerJustStarted = false;
};
var _local3:int = ((startingMeters + distanceHeight) / 8);
var _local4:int = (((500 - _local3) >= 500)) ? (500 - _local3) : 500;
if (((((_local2 - lastTime) > _local4)) && (!(thePlayer.dead)))){
_local10 = (randRange(0, 320) / 16);
lastTime = getTimer();
_local11 = new crate((_local10 * 16), (localCamera.y - FlxG.height), _objects.members);
if ((((_local3 > 50)) && ((uint((startingMeters + (distanceHeight / 8))) < 100)))){
_local11.velocity.y = 220;
} else {
if ((((_local3 > 100)) && ((uint((startingMeters + (distanceHeight / 8))) < 120)))){
_local11.velocity.y = 230;
} else {
if ((((_local3 > 120)) && ((uint((startingMeters + (distanceHeight / 8))) < 150)))){
_local11.velocity.y = 240;
} else {
if (_local3 >= 150){
_local11.velocity.y = 250;
};
};
};
};
_objects.add(_local11);
if ((((((((_local3 >= 120)) && (!((_local10 == 0))))) && (!((_local10 == 1))))) && ((randRange(0, 2) == 1)))){
_local12 = (randRange(0, (_local10 * 16)) / 16);
_local13 = new crate((_local12 * 16), ((localCamera.y - FlxG.height) - 32), _objects.members);
if ((((_local3 > 50)) && ((uint((startingMeters + (distanceHeight / 8))) < 100)))){
_local13.velocity.y = 220;
} else {
if ((((_local3 > 100)) && ((uint((startingMeters + (distanceHeight / 8))) < 120)))){
_local13.velocity.y = 230;
} else {
if ((((_local3 > 120)) && ((uint((startingMeters + (distanceHeight / 8))) < 150)))){
_local13.velocity.y = 250;
} else {
if (_local3 >= 150){
_local13.velocity.y = 260;
};
};
};
};
_objects.add(_local13);
};
if ((((((((_local3 >= 170)) && (!((_local10 == 19))))) && (!((_local10 == 20))))) && ((randRange(0, 2) == 1)))){
_local14 = (randRange((_local10 * 16), 320) / 16);
_local15 = new crate((_local12 * 16), ((localCamera.y - FlxG.height) - 32), _objects.members);
if ((((_local3 > 50)) && ((uint((startingMeters + (distanceHeight / 8))) < 100)))){
_local15.velocity.y = 220;
} else {
if ((((_local3 > 100)) && ((uint((startingMeters + (distanceHeight / 8))) < 120)))){
_local15.velocity.y = 230;
} else {
if ((((_local3 > 120)) && ((uint((startingMeters + (distanceHeight / 8))) < 150)))){
_local15.velocity.y = 250;
} else {
if (_local3 >= 150){
_local15.velocity.y = 260;
};
};
};
};
_objects.add(_local15);
};
};
var _local5:Number = 100;
var _local6:Number = 500;
if (((HB.IS_GAME_BUTLER) && (!(HB.KONG)))){
if ((((uint((startingMeters + (distanceHeight / 8))) > _local5)) && ((uint((startingMeters + (distanceHeight / 8))) < (_local5 + 10))))){
HighScoreModule.submitAchievement("comethapi001", "Got To 100m");
} else {
if ((((uint((startingMeters + (distanceHeight / 8))) > _local6)) && ((uint((startingMeters + (distanceHeight / 8))) < (_local6 + 10))))){
HighScoreModule.submitAchievement("comethapi002", "Got To 500m");
};
};
};
var _local7:int = (FlxG.height - 95);
var _local8:uint = (-(thePlayer.y) + _local7);
if ((((_local8 > distanceHeight)) && (!(thePlayer.dead)))){
distanceHeight = _local8;
scoreBox.text = (uint((startingMeters + (distanceHeight / 8))) + "m");
scoreBox2.text = (uint((startingMeters + (distanceHeight / 8))) + "m");
};
if (thePlayer.dead){
};
var _local9:int;
if (_local3 < 50){
_local9 = (5000 / 16);
} else {
if ((((_local3 >= 50)) && ((_local3 < 100)))){
_local9 = (4000 / 16);
} else {
if ((((_local3 >= 100)) && ((_local3 < 150)))){
_local9 = (3750 / 16);
} else {
if (_local3 >= 150){
_local9 = (3400 / 16);
};
};
};
};
if ((_local2 - lastScroll) > _local9){
lastScroll = _local2;
_local16 = 1;
if ((((_local3 > 50)) && ((_local3 < 100)))){
_local16 = 1.5;
} else {
if ((((_local3 > 100)) && ((_local3 < 150)))){
_local16 = 2;
} else {
if (_local3 > 150){
_local16 = 2.5;
};
};
};
localCamera.y = (localCamera.y - _local16);
};
if ((((thePlayer.getScreenXY().y > FlxG.height)) && (!(thePlayer.dead)))){
thePlayer.kill();
showGameOver();
};
if ((((thePlayer.y > (FlxG.height - 95))) && (!(thePlayer.dead)))){
thePlayer.kill();
distanceHeight = 0;
scoreBox.text = (uint(0) + "m");
scoreBox2.text = (uint(0) + "m");
thePlayer.y = (FlxG.height - 95);
showGameOver();
};
}
public function generateRandomBlock(){
}
public function onClick(_arg1){
}
protected function submitComplete(){
}
}
}//package halfbot.game.gameScreen
Section 42
//BlocksGameScreen_background_banner1 (halfbot.game.gameScreen.BlocksGameScreen_background_banner1)
package halfbot.game.gameScreen {
import mx.core.*;
public class BlocksGameScreen_background_banner1 extends BitmapAsset {
}
}//package halfbot.game.gameScreen
Section 43
//BlocksGameScreen_background_banner2 (halfbot.game.gameScreen.BlocksGameScreen_background_banner2)
package halfbot.game.gameScreen {
import mx.core.*;
public class BlocksGameScreen_background_banner2 extends BitmapAsset {
}
}//package halfbot.game.gameScreen
Section 44
//BlocksGameScreen_background_beam (halfbot.game.gameScreen.BlocksGameScreen_background_beam)
package halfbot.game.gameScreen {
import mx.core.*;
public class BlocksGameScreen_background_beam extends BitmapAsset {
}
}//package halfbot.game.gameScreen
Section 45
//BlocksGameScreen_background_city_image (halfbot.game.gameScreen.BlocksGameScreen_background_city_image)
package halfbot.game.gameScreen {
import mx.core.*;
public class BlocksGameScreen_background_city_image extends BitmapAsset {
}
}//package halfbot.game.gameScreen
Section 46
//BlocksGameScreen_background_image (halfbot.game.gameScreen.BlocksGameScreen_background_image)
package halfbot.game.gameScreen {
import mx.core.*;
public class BlocksGameScreen_background_image extends BitmapAsset {
}
}//package halfbot.game.gameScreen
Section 47
//BlocksGameScreen_background_overlay (halfbot.game.gameScreen.BlocksGameScreen_background_overlay)
package halfbot.game.gameScreen {
import mx.core.*;
public class BlocksGameScreen_background_overlay extends BitmapAsset {
}
}//package halfbot.game.gameScreen
Section 48
//BlocksGameScreen_ImgBestLine (halfbot.game.gameScreen.BlocksGameScreen_ImgBestLine)
package halfbot.game.gameScreen {
import mx.core.*;
public class BlocksGameScreen_ImgBestLine extends BitmapAsset {
}
}//package halfbot.game.gameScreen
Section 49
//BlocksGameScreen_ImgBG (halfbot.game.gameScreen.BlocksGameScreen_ImgBG)
package halfbot.game.gameScreen {
import mx.core.*;
public class BlocksGameScreen_ImgBG extends BitmapAsset {
}
}//package halfbot.game.gameScreen
Section 50
//BlocksGameScreen_ImgDebris (halfbot.game.gameScreen.BlocksGameScreen_ImgDebris)
package halfbot.game.gameScreen {
import mx.core.*;
public class BlocksGameScreen_ImgDebris extends BitmapAsset {
}
}//package halfbot.game.gameScreen
Section 51
//BlocksGameScreen_ImgGibs (halfbot.game.gameScreen.BlocksGameScreen_ImgGibs)
package halfbot.game.gameScreen {
import mx.core.*;
public class BlocksGameScreen_ImgGibs extends BitmapAsset {
}
}//package halfbot.game.gameScreen
Section 52
//BlocksGameScreen_ImgHelp (halfbot.game.gameScreen.BlocksGameScreen_ImgHelp)
package halfbot.game.gameScreen {
import mx.core.*;
public class BlocksGameScreen_ImgHelp extends BitmapAsset {
}
}//package halfbot.game.gameScreen
Section 53
//BlocksGameScreen_ImgMap (halfbot.game.gameScreen.BlocksGameScreen_ImgMap)
package halfbot.game.gameScreen {
import mx.core.*;
public class BlocksGameScreen_ImgMap extends BitmapAsset {
}
}//package halfbot.game.gameScreen
Section 54
//BlocksGameScreen_ImgSubmit (halfbot.game.gameScreen.BlocksGameScreen_ImgSubmit)
package halfbot.game.gameScreen {
import mx.core.*;
public class BlocksGameScreen_ImgSubmit extends BitmapAsset {
}
}//package halfbot.game.gameScreen
Section 55
//BlocksGameScreen_ImgTiles (halfbot.game.gameScreen.BlocksGameScreen_ImgTiles)
package halfbot.game.gameScreen {
import mx.core.*;
public class BlocksGameScreen_ImgTiles extends BitmapAsset {
}
}//package halfbot.game.gameScreen
Section 56
//BlocksGameScreen_ImgTwitter (halfbot.game.gameScreen.BlocksGameScreen_ImgTwitter)
package halfbot.game.gameScreen {
import mx.core.*;
public class BlocksGameScreen_ImgTwitter extends BitmapAsset {
}
}//package halfbot.game.gameScreen
Section 57
//BlocksGameScreen_ImgTwitterBig (halfbot.game.gameScreen.BlocksGameScreen_ImgTwitterBig)
package halfbot.game.gameScreen {
import mx.core.*;
public class BlocksGameScreen_ImgTwitterBig extends BitmapAsset {
}
}//package halfbot.game.gameScreen
Section 58
//BlocksGameScreen_SoundEffect1 (halfbot.game.gameScreen.BlocksGameScreen_SoundEffect1)
package halfbot.game.gameScreen {
import mx.core.*;
public class BlocksGameScreen_SoundEffect1 extends SoundAsset {
}
}//package halfbot.game.gameScreen
Section 59
//BlocksGameScreen_SoundEffect2 (halfbot.game.gameScreen.BlocksGameScreen_SoundEffect2)
package halfbot.game.gameScreen {
import mx.core.*;
public class BlocksGameScreen_SoundEffect2 extends SoundAsset {
}
}//package halfbot.game.gameScreen
Section 60
//BlocksGameScreen_SoundEffectQuake (halfbot.game.gameScreen.BlocksGameScreen_SoundEffectQuake)
package halfbot.game.gameScreen {
import mx.core.*;
public class BlocksGameScreen_SoundEffectQuake extends SoundAsset {
}
}//package halfbot.game.gameScreen
Section 61
//BlocksGameScreen_theMusic (halfbot.game.gameScreen.BlocksGameScreen_theMusic)
package halfbot.game.gameScreen {
import mx.core.*;
public class BlocksGameScreen_theMusic extends SoundAsset {
}
}//package halfbot.game.gameScreen
Section 62
//BlocksGameScreen_trans (halfbot.game.gameScreen.BlocksGameScreen_trans)
package halfbot.game.gameScreen {
import flash.utils.*;
import mx.core.*;
public class BlocksGameScreen_trans extends MovieClipLoaderAsset {
public var dataClass:Class;
private static var bytes:ByteArray = null;
public function BlocksGameScreen_trans(){
dataClass = BlocksGameScreen_trans_dataClass;
super();
initialWidth = (0x1900 / 20);
initialHeight = (9600 / 20);
}
override public function get movieClipData():ByteArray{
if (bytes == null){
bytes = ByteArray(new dataClass());
};
return (bytes);
}
}
}//package halfbot.game.gameScreen
Section 63
//BlocksGameScreen_trans_dataClass (halfbot.game.gameScreen.BlocksGameScreen_trans_dataClass)
package halfbot.game.gameScreen {
import mx.core.*;
public class BlocksGameScreen_trans_dataClass extends ByteArrayAsset {
}
}//package halfbot.game.gameScreen
Section 64
//creditsScreen (halfbot.game.gameScreen.creditsScreen)
package halfbot.game.gameScreen {
import flash.events.*;
import flash.net.*;
import flash.utils.*;
import org.flixel.*;
import flash.display.*;
import com.bit101.components.*;
import flash.geom.*;
import halfbot.game.system.*;
import SWFStats.*;
import halfbot.game.gameObjects.*;
public class creditsScreen extends FlxState {
var trans:Class;
public var waitTimeOut:int;// = 10
public var loader:URLLoader;
public var backtogame;// = false
public var mc:MovieClip;// = null
public var errorGame:FlxText;
public var nextGameState:FlxState;
public var controlesGame:FlxText;
public var waitingForVariable:Boolean;// = true
public var errorGameShadow:FlxText;
public var controlesGameShadow:FlxText;
public var playRequested:Boolean;// = false
private var ImgBack:Class;
public var l:Loader;
public var startGameShadow:FlxText;
public var waitforload;// = true
public var startGame:FlxText;
private var animations:MovieClip;
public var theMusic:Class;
private var ImgGB:Class;
public function creditsScreen(){
loader = new URLLoader();
theMusic = creditsScreen_theMusic;
ImgBack = creditsScreen_ImgBack;
trans = creditsScreen_trans;
ImgGB = creditsScreen_ImgGB;
super();
}
override public function update():void{
super.update();
if (((FlxG.keys.justPressed("SPACE")) && (!(playRequested)))){
playRequested = true;
mc.gotoAndPlay(0);
nextGameState = new titleScreen();
};
if (((playRequested) && ((mc.currentFrame == 12)))){
FlxG.state = nextGameState;
};
}
override public function create():void{
var _local7:FlxSprite;
var _local8:*;
var _local1:Class = creditsScreen_blockman_title;
var _local2:* = new FlxButton(0, 0, goToHBURL);
var _local3:FlxSprite = new FlxSprite(0, 0, _local1);
_local2.scrollFactor.y = 0;
_local2.loadGraphic(_local3);
add(_local2);
FlxG.play(theMusic, 0.5, true);
var _local4:Boolean;
FlxG.mouse.show();
var _local5:* = new FlxButton(5, (FlxG.height - 40), backButtonPress);
var _local6:FlxSprite = new FlxSprite(0, 0, ImgBack);
_local5.scrollFactor.y = 0;
_local6.scale.x = 1;
_local6.scale.y = 1;
_local5.loadGraphic(_local6);
add(_local5);
if (HB.IS_GAME_BUTLER){
_local7 = new FlxSprite(0, 0, this.ImgGB);
_local8 = new FlxButton((((FlxG.width / 2) - (_local7.width / 2)) + 80), ((FlxG.height - _local7.height) - 10), moreButtonPress);
_local8.scrollFactor.y = 0;
_local7.scale.x = 1;
_local7.scale.y = 1;
_local8.loadGraphic(_local7);
add(_local8);
};
animations = MovieClip(new trans());
animations.addEventListener(Event.COMPLETE, onComplete);
addChild(animations);
}
protected function backButtonPress():void{
if (!playRequested){
playRequested = true;
mc.gotoAndPlay(0);
if (backtogame){
nextGameState = new BlocksGameScreen();
} else {
nextGameState = new titleScreen();
};
};
}
protected function moreButtonPress():void{
if (HB.IS_GENERIC){
FlxU.openURL("http://www.halfbot.com");
} else {
if (HB.IS_GAME_BUTLER){
FlxU.openURL("http://www.gamesbutler.com/");
};
};
}
private function goToMyURL(_arg1:MouseEvent=null):void{
navigateToURL(new URLRequest(HB.COMPANY_URL));
}
override public function render():void{
if (waitforload){
return;
};
super.render();
}
private function goToHBURL(_arg1:MouseEvent=null):void{
if (FlxG.mouse.y < 260){
navigateToURL(new URLRequest("http://www.halfbot.com"));
};
}
private function onComplete(_arg1:Event):void{
l = (animations.getChildAt(0) as Loader);
mc = (l.content as MovieClip);
mc.gotoAndPlay(13);
waitforload = false;
}
}
}//package halfbot.game.gameScreen
Section 65
//creditsScreen_blockman_title (halfbot.game.gameScreen.creditsScreen_blockman_title)
package halfbot.game.gameScreen {
import mx.core.*;
public class creditsScreen_blockman_title extends BitmapAsset {
}
}//package halfbot.game.gameScreen
Section 66
//creditsScreen_ImgBack (halfbot.game.gameScreen.creditsScreen_ImgBack)
package halfbot.game.gameScreen {
import mx.core.*;
public class creditsScreen_ImgBack extends BitmapAsset {
}
}//package halfbot.game.gameScreen
Section 67
//creditsScreen_ImgGB (halfbot.game.gameScreen.creditsScreen_ImgGB)
package halfbot.game.gameScreen {
import mx.core.*;
public class creditsScreen_ImgGB extends BitmapAsset {
}
}//package halfbot.game.gameScreen
Section 68
//creditsScreen_theMusic (halfbot.game.gameScreen.creditsScreen_theMusic)
package halfbot.game.gameScreen {
import mx.core.*;
public class creditsScreen_theMusic extends SoundAsset {
}
}//package halfbot.game.gameScreen
Section 69
//creditsScreen_trans (halfbot.game.gameScreen.creditsScreen_trans)
package halfbot.game.gameScreen {
import flash.utils.*;
import mx.core.*;
public class creditsScreen_trans extends MovieClipLoaderAsset {
public var dataClass:Class;
private static var bytes:ByteArray = null;
public function creditsScreen_trans(){
dataClass = creditsScreen_trans_dataClass;
super();
initialWidth = (0x1900 / 20);
initialHeight = (9600 / 20);
}
override public function get movieClipData():ByteArray{
if (bytes == null){
bytes = ByteArray(new dataClass());
};
return (bytes);
}
}
}//package halfbot.game.gameScreen
Section 70
//creditsScreen_trans_dataClass (halfbot.game.gameScreen.creditsScreen_trans_dataClass)
package halfbot.game.gameScreen {
import mx.core.*;
public class creditsScreen_trans_dataClass extends ByteArrayAsset {
}
}//package halfbot.game.gameScreen
Section 71
//FlxInputText (halfbot.game.gameScreen.FlxInputText)
package halfbot.game.gameScreen {
import flash.events.*;
import org.flixel.*;
import flash.text.*;
public class FlxInputText extends FlxText {
public var forceUpperCase:Boolean;// = false
public var filterMode:uint;// = 0
private var nextFrameHide:Boolean;// = false
public var customFilterPattern:RegExp;
public static const CUSTOM_FILTER:uint = 4;
public static const ONLY_ALPHANUMERIC:uint = 3;
public static const ONLY_NUMERIC:uint = 2;
public static const ONLY_ALPHA:uint = 1;
public static const NO_FILTER:uint = 0;
public function FlxInputText(_arg1:Number, _arg2:Number, _arg3:uint, _arg4:uint, _arg5:String, _arg6:uint=0, _arg7:String=null, _arg8:uint=8, _arg9:String=null, _arg10:Number=0){
customFilterPattern = /[]*/g;
super(_arg1, _arg2, _arg3, _arg5);
var _local11:TextFormat = new TextFormat("system", _arg8, 0xFFFFFF);
_local11.align = "center";
_tf.defaultTextFormat = _local11;
_tf.selectable = true;
_tf.type = TextFieldType.INPUT;
_tf.background = true;
_tf.backgroundColor = 0x222222;
_tf.blendMode = "screen";
_tf.textColor = _arg6;
_tf.border = true;
_tf.borderColor = _arg6;
_tf.visible = false;
_tf.height = _arg4;
this.height = _arg4;
this.angle = _arg10;
_tf.addEventListener(Event.ENTER_FRAME, onEnterFrame);
_tf.addEventListener(Event.REMOVED_FROM_STAGE, onInputFieldRemoved);
_tf.addEventListener(Event.CHANGE, onTextChange);
FlxG.state.addChild(_tf);
}
private function onTextChange(_arg1:Event):void{
var _local2:RegExp;
if (forceUpperCase){
_tf.text = _tf.text.toUpperCase();
};
if (filterMode != NO_FILTER){
switch (filterMode){
case ONLY_ALPHA:
_local2 = /[^a-zA-Z]*/g;
break;
case ONLY_NUMERIC:
_local2 = /[^0-9]*/g;
break;
case ONLY_ALPHANUMERIC:
_local2 = /[^a-zA-Z0-9]*/g;
break;
case CUSTOM_FILTER:
_local2 = customFilterPattern;
break;
default:
throw (new Error((("FlxInputText: Unknown filterMode (" + filterMode) + ")")));
};
_tf.text = _tf.text.replace(_local2, "");
};
}
public function get backgroundColor():uint{
return (_tf.backgroundColor);
}
public function set borderColor(_arg1:uint):void{
_tf.borderColor = _arg1;
}
public function set backgroundVisible(_arg1:Boolean):void{
_tf.background = _arg1;
}
public function set backgroundColor(_arg1:uint):void{
_tf.backgroundColor = _arg1;
}
public function get backgroundVisible():Boolean{
return (_tf.background);
}
public function set borderVisible(_arg1:Boolean):void{
_tf.border = _arg1;
}
public function get borderVisible():Boolean{
return (_tf.border);
}
public function setMaxLength(_arg1:uint):void{
_tf.maxChars = _arg1;
}
private function onInputFieldRemoved(_arg1:Event):void{
_tf.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
_tf.removeEventListener(Event.REMOVED, onInputFieldRemoved);
_tf.removeEventListener(Event.CHANGE, onTextChange);
}
public function getText():String{
return (_tf.text);
}
private function onEnterFrame(_arg1:Event):void{
if (nextFrameHide){
_tf.visible = false;
};
nextFrameHide = true;
}
public function get borderColor():uint{
return (_tf.borderColor);
}
override public function render():void{
_tf.x = x;
_tf.y = y;
_tf.visible = true;
nextFrameHide = false;
}
}
}//package halfbot.game.gameScreen
Section 72
//gameScreen (halfbot.game.gameScreen.gameScreen)
package halfbot.game.gameScreen {
import org.flixel.*;
import flash.display.*;
import com.bit101.components.*;
import flash.geom.*;
import halfbot.game.iso_engine.*;
import halfbot.game.system.*;
import halfbot.game.gameObjects.*;
import flash.ui.*;
public class gameScreen extends FlxState {
var cannon_shadow:FlxSprite;
var scene2D:HB_Scene;
var cannon_smoke_array:Array;
var backgroundSprite:FlxSprite;
var lastPoint:Point;
var smoke_cache_amt:int;// = 5
var ball:cannon_ball;
public function gameScreen(){
lastPoint = new Point();
super();
}
override public function create():void{
var _local2:FlxSprite;
var _local1:Bitmap = new HB_GameData.GAME_RES.background_image();
backgroundSprite = new FlxSprite(((HB.SCREEN_WIDTH / 2) - (_local1.width / 2)), ((HB.SCREEN_HEIGHT / 2) - (_local1.height / 2)), HB_GameData.GAME_RES.background_image);
add(backgroundSprite);
cannon_shadow = new FlxSprite(0, 0, HB_GameData.GAME_RES.image_cannon_ball_shadow);
add(cannon_shadow);
cannon_smoke_array = new Array();
var _local3:* = 0;
while (_local3 < smoke_cache_amt) {
_local2 = new FlxSprite(0, 0, HB_GameData.GAME_RES.image_cannon_ball_smoke);
_local2.loadGraphic(HB_GameData.GAME_RES.image_cannon_ball_smoke, true, false, 32, 32, false);
_local2.visible = false;
_local2.addAnimation("explode", [0, 1, 2, 3], 10, false);
_local2.play("explode");
add(_local2);
cannon_smoke_array.push(_local2);
_local3++;
};
scene2D = new HB_Scene(0, 0, 10, 15);
add(scene2D);
ball = new cannon_ball(500, 100, cannon_shadow, cannon_smoke_array);
add(ball);
ball.fireCannon(new Point(500, 100), new Point(300, 300), 50);
ball.visible = false;
cannon_shadow.visible = false;
FlxG.mouse.show();
if (HB.EDITOR){
setupEditor();
};
}
public function onClick(_arg1){
}
public function setupEditor(){
var _local1:Window = new Window(this, (HB.SCREEN_WIDTH / 4), 0, "Tools");
_local1.width = (HB.SCREEN_WIDTH / 2);
_local1.height = (HB.SCREEN_HEIGHT / 4);
_local1.hasMinimizeButton = true;
_local1.minimized = true;
var _local2:* = new PushButton(_local1.content, 10, 10, "New Crumb", onClick);
_local2 = new PushButton(_local1.content, 10, 30, "Delete Selected", onClick);
_local2 = new PushButton(_local1.content, 10, 50, "Toggle Grid", onToggleGrid);
Mouse.show();
}
override public function update():void{
super.update();
if (FlxG.mouse.justReleased()){
ball.fireCannon(new Point((HB.SCREEN_WIDTH / 2), 5), new Point(FlxG.mouse.x, FlxG.mouse.y), 50);
ball.visible = true;
};
if (ball.visible){
scene2D.setNodeAtActive(ball.x, ball.y, true);
lastPoint.x = ball.x;
lastPoint.y = ball.y;
};
}
public function onToggleGrid(_arg1):void{
scene2D.gridActive = !(scene2D.gridActive);
}
}
}//package halfbot.game.gameScreen
Section 73
//titleScreen (halfbot.game.gameScreen.titleScreen)
package halfbot.game.gameScreen {
import flash.events.*;
import flash.net.*;
import com.gskinner.motion.*;
import flash.utils.*;
import org.flixel.*;
import flash.display.*;
import com.bit101.components.*;
import flash.geom.*;
import halfbot.game.system.*;
import SWFStats.*;
import halfbot.game.gameObjects.*;
public class titleScreen extends FlxState {
private var ImgHelp:Class;
public var waitTimeOut:int;// = 3
public var loader:URLLoader;
public var mc:MovieClip;// = null
public var errorGame:FlxText;
public var nextGameState:FlxState;
private var ImgMore:Class;
public var playRequested:Boolean;// = false
private var trans:Class;
public var waitforload;// = true
private var ImgGB:Class;
public var theMusic:Class;
public var startGameShadow:FlxText;
public var errorGameShadow:FlxText;
public var controlesGame:FlxText;
public var waitingForVariable:Boolean;// = true
public var controlesGameShadow:FlxText;
public var l:Loader;
public var creditsRequested:Boolean;// = false
private var animations:MovieClip;
public var startGame:FlxText;
public function titleScreen(){
loader = new URLLoader();
theMusic = titleScreen_theMusic;
trans = titleScreen_trans;
ImgHelp = titleScreen_ImgHelp;
ImgMore = titleScreen_ImgMore;
ImgGB = titleScreen_ImgGB;
super();
}
public function serverError(_arg1:Event):void{
trace("Server Error!");
waitingForVariable = false;
if (HB.IS_GENERIC){
errorGameShadow.visible = true;
errorGame.visible = true;
};
}
protected function moreButtonPress():void{
if (HB.IS_GENERIC){
FlxU.openURL("http://www.halfbot.com");
} else {
if (HB.IS_GAME_BUTLER){
FlxU.openURL("http://www.gamesbutler.com/");
};
};
}
override public function render():void{
if (waitforload){
return;
};
super.render();
}
function ShowScores():void{
HighScores.Scores(false, "HighScores", this.DisplayScores);
}
protected function helpButtonPress():void{
if (((((!(waitingForVariable)) && (!(creditsRequested)))) && (!(playRequested)))){
creditsRequested = true;
mc.gotoAndPlay(0);
nextGameState = new creditsScreen();
};
}
private function onComplete(_arg1:Event):void{
l = (animations.getChildAt(0) as Loader);
mc = (l.content as MovieClip);
mc.gotoAndPlay(13);
waitforload = false;
}
public function fadeStart(_arg1):void{
if (startGame.alpha == 1){
GTweener.to(startGame, 1, {alpha:0}, {onComplete:fadeStart});
GTweener.to(startGameShadow, 1.5, {alpha:0});
} else {
GTweener.to(startGame, 1, {alpha:1}, {onComplete:fadeStart});
GTweener.to(startGameShadow, 1.5, {alpha:1});
};
}
public function timeOut(_arg1):void{
if (waitingForVariable){
waitingForVariable = false;
if (HB.IS_GENERIC){
errorGameShadow.visible = true;
errorGame.visible = true;
};
};
}
override public function update():void{
super.update();
if (waitingForVariable){
startGameShadow.text = "Loading Highscores. Please Wait ...";
startGame.text = "Loading Highscores. Please Wait ...";
} else {
startGameShadow.text = "Press Space Bar To Start";
startGame.text = "Press Space Bar To Start";
};
if (((((((FlxG.keys.justPressed("SPACE")) && (!(waitingForVariable)))) && (!(playRequested)))) && (!(creditsRequested)))){
playRequested = true;
mc.gotoAndPlay(0);
nextGameState = new BlocksGameScreen();
};
if (((((((FlxG.keys.justPressed("C")) && (!(waitingForVariable)))) && (!(creditsRequested)))) && (!(playRequested)))){
creditsRequested = true;
mc.gotoAndPlay(0);
nextGameState = new creditsScreen();
};
if (((((playRequested) || (creditsRequested))) && ((mc.currentFrame == 12)))){
Log.Play();
FlxG.state = nextGameState;
};
}
public function varsLoaded(_arg1:Event):void{
var _local2:int;
while (_local2 < 10) {
if (((loader.data) && (loader.data[("name" + (_local2 + 1))]))){
HB_Data_Engine.sharedObject.data[("name" + _local2)] = loader.data[("name" + (_local2 + 1))];
HB_Data_Engine.sharedObject.data[("score" + _local2)] = loader.data[("score" + (_local2 + 1))];
} else {
HB_Data_Engine.sharedObject.data[("score" + _local2)] = 0;
HB_Data_Engine.sharedObject.data[("name" + _local2)] = "Empty";
};
_local2++;
};
HB_Data_Engine.lastScoreObtain = getTimer();
HB_Data_Engine.saveData();
waitingForVariable = false;
}
private function goToMyURL(_arg1:MouseEvent=null):void{
navigateToURL(new URLRequest(HB.COMPANY_URL));
}
function DisplayScores(_arg1:Array):void{
var _local3:Object;
var _local2:* = 0;
while (_local2 < 10) {
if (((!((_arg1 == null))) && ((_local2 < _arg1.length)))){
_local3 = _arg1[_local2];
trace(((("Got gcore with name " + _local3.Name) + " and score ") + _local3.Points));
HB_Data_Engine.sharedObject.data[("name" + _local2)] = _local3.Name;
HB_Data_Engine.sharedObject.data[("score" + _local2)] = _local3.Points;
} else {
HB_Data_Engine.sharedObject.data[("score" + _local2)] = 0;
HB_Data_Engine.sharedObject.data[("name" + _local2)] = "Empty";
};
_local2++;
};
waitingForVariable = false;
}
private function goToHBURL(_arg1:MouseEvent=null):void{
if ((((FlxG.mouse.x > 90)) && ((FlxG.mouse.x < 200)))){
if (FlxG.mouse.y > 450){
navigateToURL(new URLRequest("http://www.halfbot.com"));
};
};
}
override public function create():void{
var _local4:*;
var _local5:FlxSprite;
var _local6:FlxSprite;
var _local7:*;
var _local9:FlxSprite;
var _local10:*;
var _local1:Class = titleScreen_blockman_title;
HB_Data_Engine.initializeSoundSaveData();
var _local2:* = new FlxButton(0, 0, goToHBURL);
var _local3:FlxSprite = new FlxSprite(0, 0, _local1);
_local2.scrollFactor.y = 0;
_local2.loadGraphic(_local3);
add(_local2);
startGameShadow = new FlxText(1, ((FlxG.height - 51) + 1), FlxG.width);
startGameShadow.scrollFactor.y = 0;
startGameShadow.scrollFactor.x = 0;
startGameShadow.setFormat("system", 8, 0, "center");
add(startGameShadow);
startGameShadow.text = "SPACE BAR TO START";
startGame = new FlxText(0, (FlxG.height - 51), FlxG.width);
startGame.scrollFactor.y = 0;
startGame.scrollFactor.x = 0;
startGame.setFormat("system", 8, 268435455, "center");
add(startGame);
startGame.text = "SPACE BAR TO START";
controlesGameShadow = new FlxText(1, ((FlxG.height - 20) + 1), FlxG.width);
controlesGameShadow.scrollFactor.y = 0;
controlesGameShadow.scrollFactor.x = 0;
controlesGameShadow.setFormat("system", 8, 0, "center");
controlesGameShadow.alpha = 1;
add(controlesGameShadow);
controlesGameShadow.text = "(c) 2010 Halfbot.com";
controlesGame = new FlxText(0, (FlxG.height - 20), FlxG.width);
controlesGame.scrollFactor.y = 0;
controlesGame.scrollFactor.x = 0;
controlesGame.setFormat("system", 8, 9924659, "center");
controlesGame.alpha = 1;
add(controlesGame);
controlesGame.text = "(c) 2010 Halfbot.com";
errorGameShadow = new FlxText(1, ((FlxG.height - 65) + 1), FlxG.width);
errorGameShadow.scrollFactor.y = 0;
errorGameShadow.scrollFactor.x = 0;
errorGameShadow.setFormat("system", 8, 0, "center");
errorGameShadow.alpha = 0.9;
add(errorGameShadow);
errorGameShadow.visible = false;
errorGameShadow.text = "SERVER: GLOBAL SCORES FAILED TO LOAD!";
errorGame = new FlxText(0, (FlxG.height - 65), FlxG.width);
errorGame.scrollFactor.y = 0;
errorGame.scrollFactor.x = 0;
errorGame.setFormat("system", 8, 11145489, "center");
errorGame.alpha = 0.9;
add(errorGame);
errorGame.visible = false;
errorGame.text = "SERVER: GLOBAL SCORES FAILED TO LOAD!";
fadeStart(null);
FlxG.mouse.show();
_local4 = new FlxButton(5, (FlxG.height - 40), helpButtonPress);
_local5 = new FlxSprite(0, 0, ImgHelp);
_local4.scrollFactor.y = 0;
_local5.scale.x = 1;
_local5.scale.y = 1;
_local4.loadGraphic(_local5);
add(_local4);
_local6 = new FlxSprite(0, 0, this.ImgMore);
_local7 = new FlxButton(((FlxG.width / 2) - (_local6.width / 2)), (FlxG.height - 85), moreButtonPress);
_local7.scrollFactor.y = 0;
_local6.scale.x = 1;
_local6.scale.y = 1;
_local7.loadGraphic(_local6);
add(_local7);
if (HB.IS_GAME_BUTLER){
_local9 = new FlxSprite(0, 0, this.ImgGB);
_local10 = new FlxButton(((FlxG.width / 2) - (_local9.width / 2)), 10, moreButtonPress);
_local10.scrollFactor.y = 0;
_local9.scale.x = 1;
_local9.scale.y = 1;
_local10.loadGraphic(_local9);
add(_local10);
};
FlxG.play(theMusic, 0.5, true);
var _local8:Boolean;
if ((getTimer() - HB_Data_Engine.lastScoreObtain) <= ((60 * 1000) * 5)){
};
ShowScores();
GTweener.to(this, 10, {waitTimeOut:0}, {onComplete:timeOut});
animations = MovieClip(new trans());
animations.addEventListener(Event.COMPLETE, onComplete);
addChild(animations);
}
}
}//package halfbot.game.gameScreen
Section 74
//titleScreen_blockman_title (halfbot.game.gameScreen.titleScreen_blockman_title)
package halfbot.game.gameScreen {
import mx.core.*;
public class titleScreen_blockman_title extends BitmapAsset {
}
}//package halfbot.game.gameScreen
Section 75
//titleScreen_ImgGB (halfbot.game.gameScreen.titleScreen_ImgGB)
package halfbot.game.gameScreen {
import mx.core.*;
public class titleScreen_ImgGB extends BitmapAsset {
}
}//package halfbot.game.gameScreen
Section 76
//titleScreen_ImgHelp (halfbot.game.gameScreen.titleScreen_ImgHelp)
package halfbot.game.gameScreen {
import mx.core.*;
public class titleScreen_ImgHelp extends BitmapAsset {
}
}//package halfbot.game.gameScreen
Section 77
//titleScreen_ImgMore (halfbot.game.gameScreen.titleScreen_ImgMore)
package halfbot.game.gameScreen {
import mx.core.*;
public class titleScreen_ImgMore extends BitmapAsset {
}
}//package halfbot.game.gameScreen
Section 78
//titleScreen_theMusic (halfbot.game.gameScreen.titleScreen_theMusic)
package halfbot.game.gameScreen {
import mx.core.*;
public class titleScreen_theMusic extends SoundAsset {
}
}//package halfbot.game.gameScreen
Section 79
//titleScreen_trans (halfbot.game.gameScreen.titleScreen_trans)
package halfbot.game.gameScreen {
import flash.utils.*;
import mx.core.*;
public class titleScreen_trans extends MovieClipLoaderAsset {
public var dataClass:Class;
private static var bytes:ByteArray = null;
public function titleScreen_trans(){
dataClass = titleScreen_trans_dataClass;
super();
initialWidth = (0x1900 / 20);
initialHeight = (9600 / 20);
}
override public function get movieClipData():ByteArray{
if (bytes == null){
bytes = ByteArray(new dataClass());
};
return (bytes);
}
}
}//package halfbot.game.gameScreen
Section 80
//titleScreen_trans_dataClass (halfbot.game.gameScreen.titleScreen_trans_dataClass)
package halfbot.game.gameScreen {
import mx.core.*;
public class titleScreen_trans_dataClass extends ByteArrayAsset {
}
}//package halfbot.game.gameScreen
Section 81
//HB_Node (halfbot.game.iso_engine.HB_Node)
package halfbot.game.iso_engine {
import flash.display.*;
import flash.geom.*;
public class HB_Node {
private var east_Node:HB_Node;// = null
public var size:int;// = 0
private var west_Node:HB_Node;// = null
private var south_Node:HB_Node;// = null
public var location:Point;
private var north_Node:HB_Node;// = null
public var active:Boolean;// = false
public function HB_Node(){
location = new Point();
super();
}
public function set south(_arg1:HB_Node):void{
south_Node = _arg1;
}
public function draw(_arg1:BitmapData):void{
var _local2:Shape;
if (active){
_local2 = new Shape();
_local2.graphics.lineStyle(1, 0xFF00FF);
_local2.graphics.drawRect(location.x, location.y, size, size);
_arg1.draw(_local2);
};
}
public function get north():HB_Node{
return (north_Node);
}
public function set north(_arg1:HB_Node):void{
north_Node = _arg1;
}
public function get south():HB_Node{
return (south_Node);
}
public function get west():HB_Node{
return (west_Node);
}
public function set east(_arg1:HB_Node):void{
east_Node = _arg1;
}
public function get east():HB_Node{
return (east_Node);
}
public function set west(_arg1:HB_Node):void{
west_Node = _arg1;
}
}
}//package halfbot.game.iso_engine
Section 82
//HB_Scene (halfbot.game.iso_engine.HB_Scene)
package halfbot.game.iso_engine {
import org.flixel.*;
import flash.display.*;
import halfbot.game.system.*;
public class HB_Scene extends FlxObject {
public var grid:Array;
public var initialized:Boolean;// = false
public var gridActive:Boolean;// = true
public var gridSize:int;// = 32
public function HB_Scene(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0){
var _local7:Array;
grid = new Array();
super(_arg1, _arg2, _arg3, _arg4);
var _local5:int;
var _local6:int;
_local5 = 0;
while (_local5 < _arg4) {
_local7 = new Array();
_local6 = 0;
while (_local6 < _arg3) {
_local7.push(new HB_Node());
_local6++;
};
grid.push(_local7);
_local5++;
};
connectNodes(_arg3, _arg4);
setNodesLocation(_arg3, _arg4);
initialized = true;
}
public function setNodesLocation(_arg1:Number, _arg2:Number):void{
var _local5:HB_Node;
var _local3:int;
var _local4:int;
_local3 = 0;
while (_local3 < _arg2) {
_local4 = 0;
while (_local4 < _arg1) {
_local5 = grid[_local3][_local4];
_local5.location.x = (x + (_local4 * gridSize));
_local5.location.y = (y + (_local3 * gridSize));
_local5.size = gridSize;
_local4++;
};
_local3++;
};
}
public function connectNodes(_arg1:Number, _arg2:Number):void{
var _local5:HB_Node;
var _local6:HB_Node;
var _local7:HB_Node;
var _local8:HB_Node;
var _local9:HB_Node;
var _local3:int;
var _local4:int;
_local3 = 0;
while (_local3 < _arg2) {
_local4 = 0;
while (_local4 < _arg1) {
_local5 = grid[_local3][_local4];
_local8 = ((_local3)>0) ? grid[(_local3 - 1)][_local4] : null;
_local9 = ((_local3)<(_arg2 - 1)) ? grid[(_local3 + 1)][_local4] : null;
_local6 = ((_local4)>0) ? grid[_local3][(_local4 - 1)] : null;
_local7 = ((_local4)<(_arg1 - 1)) ? grid[_local3][(_local4 + 1)] : null;
_local5.north = _local8;
_local5.south = _local9;
_local5.west = _local6;
_local5.east = _local7;
_local4++;
};
_local3++;
};
}
override public function update():void{
super.update();
}
override public function render():void{
var _local1:HB_Node;
var _local3:Shape;
var _local4:uint;
var _local5:uint;
var _local6:int;
if (!initialized){
return;
};
if (gridActive){
_local3 = new Shape();
_local3.graphics.lineStyle(1, 1118719);
_local4 = 0;
while (_local4 < HB.SCREEN_HEIGHT) {
_local3.graphics.moveTo(0, _local4);
_local3.graphics.lineTo(HB.SCREEN_WIDTH, _local4);
FlxG.buffer.draw(_local3);
_local4 = (_local4 + gridSize);
};
_local5 = 0;
while (_local5 < HB.SCREEN_WIDTH) {
_local3.graphics.moveTo(_local5, 0);
_local3.graphics.lineTo(_local5, HB.SCREEN_HEIGHT);
FlxG.buffer.draw(_local3);
_local5 = (_local5 + gridSize);
};
};
var _local2:int;
while (_local2 < height) {
_local6 = 0;
while (_local6 < width) {
_local1 = grid[_local2][_local6];
if (_local1){
_local1.draw(FlxG.buffer);
};
_local6++;
};
_local2++;
};
}
public function setNodeAtActive(_arg1:int, _arg2:int, _arg3:Boolean){
var _local4:int = (_arg2 % gridSize);
var _local5:int = (_arg1 % gridSize);
if ((((((_local4 >= 0)) && ((_local4 < grid.length)))) && ((((_local5 >= 0)) && ((_local5 < grid[0].length)))))){
(grid[_local4][_local5] as HB_Node).active = _arg3;
};
}
}
}//package halfbot.game.iso_engine
Section 83
//HB (halfbot.game.system.HB)
package halfbot.game.system {
public class HB {
public static var EDITOR:Boolean = false;
public static var CPM_ENABLED:Boolean = false;
public static var LIBRARY_MINOR_VERSION:Number = 0.9;
public static var COMPANY_URL:String = "http://www.halfbot.com";
public static var LIBRARY_MAJOR_VERSION:Number = 1;
public static var IS_GENERIC:Boolean = false;
public static var SCREEN_WIDTH:Number = 320;
public static var DEBUG:Boolean = false;
public static var IS_GAME_BUTLER:Boolean = true;
public static var GAME_NAME:String = "Blocks Cometh";
public static var SCREEN_HEIGHT:Number = 480;
public static var KONG:Boolean = true;
}
}//package halfbot.game.system
Section 84
//HB_Data_Engine (halfbot.game.system.HB_Data_Engine)
package halfbot.game.system {
import flash.net.*;
import flash.media.*;
public class HB_Data_Engine {
public static var dataFirstSave:Boolean = false;
public static var sharedObject:SharedObject;
public static var story_viewed:Boolean = false;
public static var sfx_on:Boolean = true;
public static var credits:int = 0;
public static var lastScore:int = 0;
public static var musicController:SoundChannel;
public static var lastScoreObtain:int = 0;
public static var bestHeight:int = 0;
public static var lastNameEntered:String = "";
public static var music_on:Boolean = true;
public static function saveData():void{
try {
sharedObject.data.music_on = music_on;
sharedObject.data.sfx_on = sfx_on;
sharedObject.data.soundFirstSave = dataFirstSave;
sharedObject.data.credits = credits;
sharedObject.data.lastScore = lastScore;
sharedObject.data.bestHeight = bestHeight;
sharedObject.data.lastNameEntered = lastNameEntered;
sharedObject.data.lastScoreObtain = lastScoreObtain;
sharedObject.flush();
} catch(shardObjectError:Error) {
trace("Failed to save data");
};
}
public static function toggle_music_on():void{
music_on = !(music_on);
if (music_on){
play();
} else {
stop();
};
saveData();
}
public static function initializeSoundSaveData():void{
var _local1:int;
sharedObject = SharedObject.getLocal(((("halfbot_data_saves_blocks_" + HB.LIBRARY_MAJOR_VERSION) + ".") + HB.LIBRARY_MINOR_VERSION));
dataFirstSave = ((sharedObject.data.soundFirstSave)==null) ? true : false;
if (dataFirstSave){
sharedObject.data.sfx_on = true;
sharedObject.data.story_viewed = true;
sharedObject.data.soundFirstSave = false;
sharedObject.data.credits = 0;
sharedObject.data.lastScore = 0;
sharedObject.data.bestHeight = 0;
sharedObject.data.lastNameEntered = "";
sharedObject.data.lastScoreObtain = 0;
_local1 = 0;
while (_local1 < 10) {
sharedObject.data[("score" + _local1)] = 0;
sharedObject.data[("name" + _local1)] = "Empty";
_local1++;
};
sharedObject.flush();
trace("No Sound Save Settings Exists");
} else {
loadData();
trace("Sound Save Exists and loaded");
};
}
public static function stop():void{
if (musicController){
musicController.stop();
};
}
public static function toggle_sfx_on():void{
sfx_on = !(sfx_on);
saveData();
}
public static function loadData():void{
var i:int;
try {
music_on = sharedObject.data.music_on;
sfx_on = sharedObject.data.sfx_on;
credits = sharedObject.data.credits;
lastScore = sharedObject.data.lastScore;
bestHeight = sharedObject.data.bestHeight;
lastNameEntered = sharedObject.data.lastNameEntered;
lastScoreObtain = 0;
i = 0;
while (i < 10) {
sharedObject.data[("score" + i)] = 0;
sharedObject.data[("name" + i)] = "Empty";
i = (i + 1);
};
story_viewed = true;
dataFirstSave = false;
} catch(shardObjectError:Error) {
trace("Failed to load save data");
};
}
public static function play():void{
}
}
}//package halfbot.game.system
Section 85
//HB_GameData (halfbot.game.system.HB_GameData)
package halfbot.game.system {
import halfbot.game.gameScreen.*;
public class HB_GameData {
public static var STATE_IDLE = 0;
public static var GAME_INSTANCE:gameScreen = null;
public static var GAME_RES:HB_GameResources = null;
public static var PAUSED:Boolean = false;
}
}//package halfbot.game.system
Section 86
//HB_GameResources (halfbot.game.system.HB_GameResources)
package halfbot.game.system {
public class HB_GameResources {
public var background_image:Class;
public var image_cannon_ball_shadow:Class;
public var image_enemy_test:Class;
public var image_cannon_ball_smoke:Class;
public var image_cannon_ball:Class;
public function HB_GameResources(){
background_image = HB_GameResources_background_image;
image_cannon_ball = HB_GameResources_image_cannon_ball;
image_cannon_ball_shadow = HB_GameResources_image_cannon_ball_shadow;
image_cannon_ball_smoke = HB_GameResources_image_cannon_ball_smoke;
image_enemy_test = HB_GameResources_image_enemy_test;
super();
}
}
}//package halfbot.game.system
Section 87
//HB_GameResources_background_image (halfbot.game.system.HB_GameResources_background_image)
package halfbot.game.system {
import mx.core.*;
public class HB_GameResources_background_image extends BitmapAsset {
}
}//package halfbot.game.system
Section 88
//HB_GameResources_image_cannon_ball (halfbot.game.system.HB_GameResources_image_cannon_ball)
package halfbot.game.system {
import mx.core.*;
public class HB_GameResources_image_cannon_ball extends BitmapAsset {
}
}//package halfbot.game.system
Section 89
//HB_GameResources_image_cannon_ball_shadow (halfbot.game.system.HB_GameResources_image_cannon_ball_shadow)
package halfbot.game.system {
import mx.core.*;
public class HB_GameResources_image_cannon_ball_shadow extends BitmapAsset {
}
}//package halfbot.game.system
Section 90
//HB_GameResources_image_cannon_ball_smoke (halfbot.game.system.HB_GameResources_image_cannon_ball_smoke)
package halfbot.game.system {
import mx.core.*;
public class HB_GameResources_image_cannon_ball_smoke extends BitmapAsset {
}
}//package halfbot.game.system
Section 91
//HB_GameResources_image_enemy_test (halfbot.game.system.HB_GameResources_image_enemy_test)
package halfbot.game.system {
import mx.core.*;
public class HB_GameResources_image_enemy_test extends BitmapAsset {
}
}//package halfbot.game.system
Section 92
//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.2.0.3958";
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 93
//ByteArrayAsset (mx.core.ByteArrayAsset)
package mx.core {
import flash.utils.*;
public class ByteArrayAsset extends ByteArray implements IFlexAsset {
mx_internal static const VERSION:String = "3.2.0.3958";
}
}//package mx.core
Section 94
//EdgeMetrics (mx.core.EdgeMetrics)
package mx.core {
public class EdgeMetrics {
public var top:Number;
public var left:Number;
public var bottom:Number;
public var right:Number;
mx_internal static const VERSION:String = "3.2.0.3958";
public static const EMPTY:EdgeMetrics = new EdgeMetrics(0, 0, 0, 0);
;
public function EdgeMetrics(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0){
this.left = _arg1;
this.top = _arg2;
this.right = _arg3;
this.bottom = _arg4;
}
public function clone():EdgeMetrics{
return (new EdgeMetrics(left, top, right, bottom));
}
}
}//package mx.core
Section 95
//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.2.0.3958";
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 96
//FlexMovieClip (mx.core.FlexMovieClip)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexMovieClip extends MovieClip {
mx_internal static const VERSION:String = "3.2.0.3958";
public function FlexMovieClip(){
super();
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 97
//FontAsset (mx.core.FontAsset)
package mx.core {
import flash.text.*;
public class FontAsset extends Font implements IFlexAsset {
mx_internal static const VERSION:String = "3.2.0.3958";
}
}//package mx.core
Section 98
//IBorder (mx.core.IBorder)
package mx.core {
public interface IBorder {
function get borderMetrics():EdgeMetrics;
}
}//package mx.core
Section 99
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 100
//IFlexDisplayObject (mx.core.IFlexDisplayObject)
package mx.core {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
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 101
//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 102
//MovieClipAsset (mx.core.MovieClipAsset)
package mx.core {
public class MovieClipAsset extends FlexMovieClip implements IFlexAsset, IFlexDisplayObject, IBorder {
private var _measuredHeight:Number;
private var _measuredWidth:Number;
mx_internal static const VERSION:String = "3.2.0.3958";
public function MovieClipAsset(){
_measuredWidth = width;
_measuredHeight = height;
}
public function get measuredWidth():Number{
return (_measuredWidth);
}
public function get measuredHeight():Number{
return (_measuredHeight);
}
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;
}
public function get borderMetrics():EdgeMetrics{
if (scale9Grid == null){
return (EdgeMetrics.EMPTY);
};
return (new EdgeMetrics(scale9Grid.left, scale9Grid.top, Math.ceil((measuredWidth - scale9Grid.right)), Math.ceil((measuredHeight - scale9Grid.bottom))));
}
}
}//package mx.core
Section 103
//MovieClipLoaderAsset (mx.core.MovieClipLoaderAsset)
package mx.core {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.system.*;
public class MovieClipLoaderAsset extends MovieClipAsset implements IFlexAsset, IFlexDisplayObject {
protected var initialHeight:Number;// = 0
private var loader:Loader;// = null
private var initialized:Boolean;// = false
protected var initialWidth:Number;// = 0
private var requestedHeight:Number;
private var requestedWidth:Number;
mx_internal static const VERSION:String = "3.2.0.3958";
public function MovieClipLoaderAsset(){
var _local1:LoaderContext = new LoaderContext();
_local1.applicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);
if (("allowLoadBytesCodeExecution" in _local1)){
_local1["allowLoadBytesCodeExecution"] = true;
};
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
loader.loadBytes(movieClipData, _local1);
addChild(loader);
}
override public function get width():Number{
if (!initialized){
return (initialWidth);
};
return (super.width);
}
override public function set width(_arg1:Number):void{
if (!initialized){
requestedWidth = _arg1;
} else {
loader.width = _arg1;
};
}
override public function get measuredHeight():Number{
return (initialHeight);
}
private function completeHandler(_arg1:Event):void{
initialized = true;
initialWidth = loader.width;
initialHeight = loader.height;
if (!isNaN(requestedWidth)){
loader.width = requestedWidth;
};
if (!isNaN(requestedHeight)){
loader.height = requestedHeight;
};
dispatchEvent(_arg1);
}
override public function set height(_arg1:Number):void{
if (!initialized){
requestedHeight = _arg1;
} else {
loader.height = _arg1;
};
}
override public function get measuredWidth():Number{
return (initialWidth);
}
override public function get height():Number{
if (!initialized){
return (initialHeight);
};
return (super.height);
}
public function get movieClipData():ByteArray{
return (null);
}
}
}//package mx.core
Section 104
//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 105
//SoundAsset (mx.core.SoundAsset)
package mx.core {
import flash.media.*;
public class SoundAsset extends Sound implements IFlexAsset {
mx_internal static const VERSION:String = "3.2.0.3958";
}
}//package mx.core
Section 106
//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.2.0.3958";
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 107
//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 = 0;
if (_arg3 > 0){
delay = (1 / _arg3);
};
frames = _arg2;
looped = _arg4;
}
}
}//package org.flixel.data
Section 108
//FlxConsole (org.flixel.data.FlxConsole)
package org.flixel.data {
import flash.display.*;
import org.flixel.*;
import flash.text.*;
public class FlxConsole extends Sprite {
protected const MAX_CONSOLE_LINES:uint = 0x0100;
protected var _lines:Array;
protected var _text:TextField;
public var mtrUpdate:FlxMonitor;
public var mtrTotal:FlxMonitor;
protected var _Y:Number;
protected var _console:Sprite;
public var mtrRender:FlxMonitor;
protected var _curFPS:uint;
protected var _extraDisplay:TextField;
protected var _bx:int;
protected var _by:int;
protected var _YT:Number;
protected var _byt:int;
protected var _fpsDisplay:TextField;
public function FlxConsole(_arg1:uint, _arg2:uint, _arg3:uint){
var _local4:Bitmap;
super();
visible = false;
x = (_arg1 * _arg3);
_by = (_arg2 * _arg3);
_byt = (_by - (FlxG.height * _arg3));
_YT = (_Y = (y = _byt));
_local4 = new Bitmap(new BitmapData((FlxG.width * _arg3), (FlxG.height * _arg3), true, 2130706432));
addChild(_local4);
mtrUpdate = new FlxMonitor(8);
mtrRender = new FlxMonitor(8);
mtrTotal = new FlxMonitor(8);
_text = new TextField();
_text.width = _local4.width;
_text.height = _local4.height;
_text.multiline = true;
_text.wordWrap = true;
_text.embedFonts = true;
_text.selectable = false;
_text.antiAliasType = AntiAliasType.NORMAL;
_text.gridFitType = GridFitType.PIXEL;
_text.defaultTextFormat = new TextFormat("system", 8, 0xFFFFFF);
addChild(_text);
_fpsDisplay = new TextField();
_fpsDisplay.width = 100;
_fpsDisplay.x = (_local4.width - 100);
_fpsDisplay.height = 20;
_fpsDisplay.multiline = true;
_fpsDisplay.wordWrap = true;
_fpsDisplay.embedFonts = true;
_fpsDisplay.selectable = false;
_fpsDisplay.antiAliasType = AntiAliasType.NORMAL;
_fpsDisplay.gridFitType = GridFitType.PIXEL;
_fpsDisplay.defaultTextFormat = new TextFormat("system", 16, 0xFFFFFF, true, null, null, null, null, "right");
addChild(_fpsDisplay);
_extraDisplay = new TextField();
_extraDisplay.width = 100;
_extraDisplay.x = (_local4.width - 100);
_extraDisplay.height = 64;
_extraDisplay.y = 20;
_extraDisplay.alpha = 0.5;
_extraDisplay.multiline = true;
_extraDisplay.wordWrap = true;
_extraDisplay.embedFonts = true;
_extraDisplay.selectable = false;
_extraDisplay.antiAliasType = AntiAliasType.NORMAL;
_extraDisplay.gridFitType = GridFitType.PIXEL;
_extraDisplay.defaultTextFormat = new TextFormat("system", 8, 0xFFFFFF, true, null, null, null, null, "right");
addChild(_extraDisplay);
_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:Number = mtrTotal.average();
_fpsDisplay.text = (uint((1000 / _local1)) + " fps");
var _local2:uint = mtrUpdate.average();
var _local3:uint = mtrRender.average();
var _local4:uint = (_local2 + _local3);
var _local5:uint = uint(_local1);
_extraDisplay.text = (((((((((_local2 + "ms update\n") + _local3) + "ms render\n") + _local4) + "ms flixel\n") + (_local5 - _local4)) + "ms flash\n") + _local5) + "ms total");
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 109
//FlxFade (org.flixel.data.FlxFade)
package org.flixel.data {
import org.flixel.*;
public class FlxFade extends FlxSprite {
protected var _delay:Number;
protected var _complete:Function;
public function FlxFade(){
createGraphic(FlxG.width, FlxG.height, 0, true);
scrollFactor.x = 0;
scrollFactor.y = 0;
exists = false;
solid = false;
fixed = true;
}
override public function update():void{
alpha = (alpha + (FlxG.elapsed / _delay));
if (alpha >= 1){
alpha = 1;
if (_complete != null){
_complete();
};
};
}
public function start(_arg1:uint=4278190080, _arg2:Number=1, _arg3:Function=null, _arg4:Boolean=false):void{
if (((!(_arg4)) && (exists))){
return;
};
fill(_arg1);
_delay = _arg2;
_complete = _arg3;
alpha = 0;
exists = true;
}
public function stop():void{
exists = false;
}
}
}//package org.flixel.data
Section 110
//FlxFlash (org.flixel.data.FlxFlash)
package org.flixel.data {
import org.flixel.*;
public class FlxFlash extends FlxSprite {
protected var _delay:Number;
protected var _complete:Function;
public function FlxFlash(){
createGraphic(FlxG.width, FlxG.height, 0, true);
scrollFactor.x = 0;
scrollFactor.y = 0;
exists = false;
solid = false;
fixed = true;
}
override public function update():void{
alpha = (alpha - (FlxG.elapsed / _delay));
if (alpha <= 0){
exists = false;
if (_complete != null){
_complete();
};
};
}
public function start(_arg1:uint=4294967295, _arg2:Number=1, _arg3:Function=null, _arg4:Boolean=false):void{
if (((!(_arg4)) && (exists))){
return;
};
fill(_arg1);
_delay = _arg2;
_complete = _arg3;
alpha = 1;
exists = true;
}
public function stop():void{
exists = false;
}
}
}//package org.flixel.data
Section 111
//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 U: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 BACKSPACE:Boolean;
public var EIGHT:Boolean;
public var W:Boolean;
public var M:Boolean;
public var THREE:Boolean;
public var ESCAPE: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("ESCAPE", 27);
addKey("MINUS", 189);
addKey("PLUS", 187);
addKey("DELETE", 46);
addKey("BACKSPACE", 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 112
//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 FlxKong(){
API = null;
}
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);
}
protected function APILoaded(_arg1:Event):void{
API = _arg1.target.content;
API.services.connect();
}
}
}//package org.flixel.data
Section 113
//FlxList (org.flixel.data.FlxList)
package org.flixel.data {
import org.flixel.*;
public class FlxList {
public var next:FlxList;
public var object:FlxObject;
public function FlxList(){
object = null;
next = null;
}
}
}//package org.flixel.data
Section 114
//FlxMouse (org.flixel.data.FlxMouse)
package org.flixel.data {
import flash.events.*;
import org.flixel.*;
public class FlxMouse {
protected var ImgDefaultCursor:Class;
protected var _out:Boolean;
public var cursor:FlxSprite;
public var screenY:int;
protected var _last:int;
public var x:int;
public var y:int;
protected var _current:int;
public var screenX:int;
public function FlxMouse(){
ImgDefaultCursor = FlxMouse_ImgDefaultCursor;
super();
x = 0;
y = 0;
screenX = 0;
screenY = 0;
_current = 0;
_last = 0;
cursor = null;
_out = false;
}
public function hide():void{
if (cursor != null){
cursor.visible = false;
_out = false;
};
}
public function update(_arg1:int, _arg2:int, _arg3:Number, _arg4:Number):void{
screenX = _arg1;
screenY = _arg2;
x = (screenX - FlxU.floor(_arg3));
y = (screenY - FlxU.floor(_arg4));
if (cursor != null){
cursor.x = x;
cursor.y = y;
};
if ((((_last == -1)) && ((_current == -1)))){
_current = 0;
} else {
if ((((_last == 2)) && ((_current == 2)))){
_current = 1;
};
};
_last = _current;
}
public function reset():void{
_current = 0;
_last = 0;
}
public function justReleased():Boolean{
return ((_current == -1));
}
public function handleMouseOver(_arg1:MouseEvent):void{
if (cursor != null){
cursor.visible = _out;
};
}
public function handleMouseDown(_arg1:MouseEvent):void{
if (_current > 0){
_current = 1;
} else {
_current = 2;
};
}
public function pressed():Boolean{
return ((_current > 0));
}
public function justPressed():Boolean{
return ((_current == 2));
}
public function load(_arg1:Class, _arg2:int=0, _arg3:int=0):void{
if (_arg1 == null){
_arg1 = ImgDefaultCursor;
};
cursor = new FlxSprite(screenX, screenY, _arg1);
cursor.offset.x = _arg2;
cursor.offset.y = _arg3;
}
public function handleMouseUp(_arg1:MouseEvent):void{
if (_current > 0){
_current = -1;
} else {
_current = 0;
};
}
public function handleMouseOut(_arg1:MouseEvent):void{
if (cursor != null){
_out = cursor.visible;
cursor.visible = false;
};
}
public function show(_arg1:Class=null, _arg2:int=0, _arg3:int=0):void{
_out = true;
if (_arg1 != null){
load(_arg1, _arg2, _arg3);
} else {
if (cursor != null){
cursor.visible = true;
} else {
load(null);
};
};
}
public function unload():void{
if (cursor != null){
if (cursor.visible){
load(null);
} else {
cursor = null;
};
};
}
}
}//package org.flixel.data
Section 115
//FlxMouse_ImgDefaultCursor (org.flixel.data.FlxMouse_ImgDefaultCursor)
package org.flixel.data {
import mx.core.*;
public class FlxMouse_ImgDefaultCursor extends BitmapAsset {
}
}//package org.flixel.data
Section 116
//FlxPanel (org.flixel.data.FlxPanel)
package org.flixel.data {
import org.flixel.*;
import flash.ui.*;
public class FlxPanel extends FlxObject {
protected var _close:FlxButton;
protected var _digg:FlxButton;
protected var _gameTitle:String;
protected var _closed:Boolean;
protected var _payPalID:String;
protected var _donate:FlxButton;
private var ImgClose:Class;
protected var _topBar:FlxSprite;
protected var _ty:Number;
protected var _caption:FlxText;
protected var _initialized:Boolean;
protected var _twitter:FlxButton;
protected var _delicious:FlxButton;
protected var _stumble:FlxButton;
private var ImgDelicious:Class;
private var ImgTwitter:Class;
protected var _mainBar:FlxSprite;
protected var _gameURL:String;
private var ImgStumble:Class;
private var ImgReddit:Class;
private var ImgDigg:Class;
protected var _bottomBar:FlxSprite;
protected var _payPalAmount:Number;
protected var _s:Number;
private var ImgDonate:Class;
protected 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();
_topBar.createGraphic(FlxG.width, 1, 2147483647);
_topBar.scrollFactor.x = 0;
_topBar.scrollFactor.y = 0;
_mainBar = new FlxSprite();
_mainBar.createGraphic(FlxG.width, 19, 2130706432);
_mainBar.scrollFactor.x = 0;
_mainBar.scrollFactor.y = 0;
_bottomBar = new FlxSprite();
_bottomBar.createGraphic(FlxG.width, 1, 2147483647);
_bottomBar.scrollFactor.x = 0;
_bottomBar.scrollFactor.y = 0;
_donate = new FlxButton(3, 0, onDonate);
_donate.loadGraphic(new FlxSprite(0, 0, ImgDonate));
_donate.scrollFactor.x = 0;
_donate.scrollFactor.y = 0;
_stumble = new FlxButton(((((((FlxG.width / 2) - 6) - 13) - 6) - 13) - 6), 0, onStumble);
_stumble.loadGraphic(new FlxSprite(0, 0, ImgStumble));
_stumble.scrollFactor.x = 0;
_stumble.scrollFactor.y = 0;
_digg = new FlxButton(((((FlxG.width / 2) - 6) - 13) - 6), 0, onDigg);
_digg.loadGraphic(new FlxSprite(0, 0, ImgDigg));
_digg.scrollFactor.x = 0;
_digg.scrollFactor.y = 0;
_reddit = new FlxButton(((FlxG.width / 2) - 6), 0, onReddit);
_reddit.loadGraphic(new FlxSprite(0, 0, ImgReddit));
_reddit.scrollFactor.x = 0;
_reddit.scrollFactor.y = 0;
_delicious = new FlxButton((((FlxG.width / 2) + 7) + 6), 0, onDelicious);
_delicious.loadGraphic(new FlxSprite(0, 0, ImgDelicious));
_delicious.scrollFactor.x = 0;
_delicious.scrollFactor.y = 0;
_twitter = new FlxButton((((((FlxG.width / 2) + 7) + 6) + 12) + 6), 0, onTwitter);
_twitter.loadGraphic(new FlxSprite(0, 0, ImgTwitter));
_twitter.scrollFactor.x = 0;
_twitter.scrollFactor.y = 0;
_caption = new FlxText((FlxG.width / 2), 0, ((FlxG.width / 2) - 19), "");
_caption.alignment = "right";
_caption.scrollFactor.x = 0;
_caption.scrollFactor.y = 0;
_close = new FlxButton((FlxG.width - 16), 0, onClose);
_close.loadGraphic(new FlxSprite(0, 0, ImgClose));
_close.scrollFactor.x = 0;
_close.scrollFactor.y = 0;
hide();
visible = false;
_s = 50;
}
public function onDelicious():void{
FlxU.openURL(((("http://delicious.com/save?v=5&noui&jump=close&url=" + encodeURIComponent(_gameURL)) + "&title=") + encodeURIComponent(_gameTitle)));
}
public function onTwitter():void{
FlxU.openURL(("http://twitter.com/home?status=Playing" + encodeURIComponent((((" " + _gameTitle) + " - ") + _gameURL))));
}
public function setup(_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 onStumble():void{
FlxU.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{
FlxU.openURL(((("http://digg.com/submit?url=" + encodeURIComponent(_gameURL)) + "&title=") + encodeURIComponent(_gameTitle)));
}
public function onReddit():void{
FlxU.openURL(("http://www.reddit.com/submit?url=" + encodeURIComponent(_gameURL)));
}
public function onDonate():void{
FlxU.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;
};
};
_topBar.y = y;
_mainBar.y = (y + 1);
_bottomBar.y = (y + 20);
_donate.reset(_donate.x, (y + 4));
_stumble.reset(_stumble.x, (y + 4));
_digg.reset(_digg.x, (y + 4));
_reddit.reset(_reddit.x, (y + 4));
_delicious.reset(_delicious.x, (y + 5));
_twitter.reset(_twitter.x, (y + 4));
_caption.reset(_caption.x, (y + 4));
_close.reset(_close.x, (y + 4));
};
if ((((y <= -21)) || ((y >= FlxG.height)))){
visible = false;
} else {
visible = true;
};
if (visible){
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 show(_arg1:Boolean=true):void{
if (_closed){
return;
};
if (!_initialized){
FlxG.log("SUPPORT PANEL ERROR: Uninitialized.\nYou forgot to call FlxGame.setupSupportPanel()\nfrom your game constructor.");
return;
};
if (_arg1){
y = -21;
_ty = -1;
} else {
y = FlxG.height;
_ty = (FlxG.height - 20);
};
_donate.reset(_donate.x, (y + 4));
_stumble.reset(_stumble.x, (y + 4));
_digg.reset(_digg.x, (y + 4));
_reddit.reset(_reddit.x, (y + 4));
_delicious.reset(_delicious.x, (y + 5));
_twitter.reset(_twitter.x, (y + 4));
_caption.reset(_caption.x, (y + 4));
_close.reset(_close.x, (y + 4));
if (!FlxG.mouse.cursor.visible){
Mouse.show();
};
visible = true;
}
public function onClose():void{
_closed = true;
hide();
}
public function hide():void{
if (y < 0){
_ty = -21;
} else {
_ty = FlxG.height;
};
Mouse.hide();
}
}
}//package org.flixel.data
Section 117
//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 118
//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 119
//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 120
//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 121
//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 122
//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 123
//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 124
//FlxPause (org.flixel.data.FlxPause)
package org.flixel.data {
import org.flixel.*;
public class FlxPause extends FlxGroup {
private var ImgKeyP:Class;
private var ImgKey0:Class;
private var ImgKeyPlus:Class;
private var ImgKeyMinus:Class;
public function FlxPause(){
var _local2:uint;
ImgKeyMinus = FlxPause_ImgKeyMinus;
ImgKeyPlus = FlxPause_ImgKeyPlus;
ImgKey0 = FlxPause_ImgKey0;
ImgKeyP = FlxPause_ImgKeyP;
super();
scrollFactor.x = 0;
scrollFactor.y = 0;
var _local1:uint = 80;
_local2 = 92;
x = ((FlxG.width - _local1) / 2);
y = ((FlxG.height - _local2) / 2);
add(new FlxSprite().createGraphic(_local1, _local2, 2852126720, true), true);
(add(new FlxText(0, 0, _local1, "this game is"), true) as FlxText).alignment = "center";
add(new FlxText(0, 10, _local1, "PAUSED").setFormat(null, 16, 0xFFFFFF, "center"), true);
add(new FlxSprite(4, 36, ImgKeyP), true);
add(new FlxText(16, 36, (_local1 - 16), "Pause Game"), true);
add(new FlxSprite(4, 50, ImgKey0), true);
add(new FlxText(16, 50, (_local1 - 16), "Mute Sound"), true);
add(new FlxSprite(4, 64, ImgKeyMinus), true);
add(new FlxText(16, 64, (_local1 - 16), "Sound Down"), true);
add(new FlxSprite(4, 78, ImgKeyPlus), true);
add(new FlxText(16, 78, (_local1 - 16), "Sound Up"), true);
}
}
}//package org.flixel.data
Section 125
//FlxPause_ImgKey0 (org.flixel.data.FlxPause_ImgKey0)
package org.flixel.data {
import mx.core.*;
public class FlxPause_ImgKey0 extends BitmapAsset {
}
}//package org.flixel.data
Section 126
//FlxPause_ImgKeyMinus (org.flixel.data.FlxPause_ImgKeyMinus)
package org.flixel.data {
import mx.core.*;
public class FlxPause_ImgKeyMinus extends BitmapAsset {
}
}//package org.flixel.data
Section 127
//FlxPause_ImgKeyP (org.flixel.data.FlxPause_ImgKeyP)
package org.flixel.data {
import mx.core.*;
public class FlxPause_ImgKeyP extends BitmapAsset {
}
}//package org.flixel.data
Section 128
//FlxPause_ImgKeyPlus (org.flixel.data.FlxPause_ImgKeyPlus)
package org.flixel.data {
import mx.core.*;
public class FlxPause_ImgKeyPlus extends BitmapAsset {
}
}//package org.flixel.data
Section 129
//FlxQuake (org.flixel.data.FlxQuake)
package org.flixel.data {
import org.flixel.*;
public class FlxQuake {
public var y:int;
protected var _timer:Number;
protected var _intensity:Number;
public var x:int;
protected var _zoom:uint;
public function FlxQuake(_arg1:uint){
_zoom = _arg1;
start(0);
}
public function update():void{
if (_timer > 0){
_timer = (_timer - FlxG.elapsed);
if (_timer <= 0){
_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 start(_arg1:Number=0.05, _arg2:Number=0.5):void{
stop();
_intensity = _arg1;
_timer = _arg2;
}
public function stop():void{
x = 0;
y = 0;
_intensity = 0;
_timer = 0;
}
}
}//package org.flixel.data
Section 130
//FlxButton (org.flixel.FlxButton)
package org.flixel {
import flash.events.*;
public class FlxButton extends FlxGroup {
protected var _on:FlxSprite;
protected var _offT:FlxText;
protected var _initialized:Boolean;
protected var _onT:FlxText;
protected var _pressed:Boolean;
protected var _callback:Function;
protected var _off:FlxSprite;
protected var _onToggle:Boolean;
protected var _sf:FlxPoint;
public function FlxButton(_arg1:int, _arg2:int, _arg3:Function){
x = _arg1;
y = _arg2;
width = 100;
height = 20;
_off = new FlxSprite().createGraphic(width, height, 4286545791);
_off.solid = false;
add(_off, true);
_on = new FlxSprite().createGraphic(width, height, 4294967295);
_on.solid = false;
add(_on, true);
_offT = null;
_onT = null;
_callback = _arg3;
_onToggle = false;
_pressed = false;
_initialized = false;
_sf = null;
}
protected function onMouseUp(_arg1:MouseEvent):void{
if (((((((((!(exists)) || (!(visible)))) || (!(active)))) || (!(FlxG.mouse.justReleased())))) || ((_callback == null)))){
return;
};
if (overlapsPoint(FlxG.mouse.x, FlxG.mouse.y)){
_callback();
};
}
override public function update():void{
if (!_initialized){
if (FlxG.stage != null){
FlxG.stage.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
_initialized = true;
};
};
super.update();
visibility(false);
if (overlapsPoint(FlxG.mouse.x, FlxG.mouse.y)){
if (!FlxG.mouse.pressed()){
_pressed = false;
} else {
if (!_pressed){
_pressed = true;
};
};
visibility(!(_pressed));
};
if (_onToggle){
visibility(_off.visible);
};
}
protected 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;
};
};
}
public function get on():Boolean{
return (_onToggle);
}
public function loadGraphic(_arg1:FlxSprite, _arg2:FlxSprite=null):FlxButton{
_off = (replace(_off, _arg1) as FlxSprite);
if (_arg2 == null){
if (_on != _off){
remove(_on);
};
_on = _off;
} else {
_on = (replace(_on, _arg2) as FlxSprite);
};
_on.solid = (_off.solid = false);
_off.scrollFactor = scrollFactor;
_on.scrollFactor = scrollFactor;
width = _off.width;
height = _off.height;
refreshHulls();
return (this);
}
public function loadText(_arg1:FlxText, _arg2:FlxText=null):FlxButton{
if (_arg1 != null){
if (_offT == null){
_offT = _arg1;
add(_offT);
} else {
_offT = (replace(_offT, _arg1) as FlxText);
};
};
if (_arg2 == null){
_onT = _offT;
} else {
if (_onT == null){
_onT = _arg2;
add(_onT);
} else {
_onT = (replace(_onT, _arg2) as FlxText);
};
};
_offT.scrollFactor = scrollFactor;
_onT.scrollFactor = scrollFactor;
return (this);
}
override public function destroy():void{
if (FlxG.stage != null){
FlxG.stage.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
};
}
public function set on(_arg1:Boolean):void{
_onToggle = _arg1;
}
}
}//package org.flixel
Section 131
//FlxEmitter (org.flixel.FlxEmitter)
package org.flixel {
public class FlxEmitter extends FlxGroup {
public var maxRotation:Number;
public var delay:Number;
public var quantity:uint;
protected var _timer:Number;
public var gravity:Number;
public var particleDrag:FlxPoint;
public var maxParticleSpeed:FlxPoint;
public var on:Boolean;
protected var _explode:Boolean;
protected var _particle:uint;
public var minParticleSpeed:FlxPoint;
public var minRotation:Number;
protected var _counter:uint;
public function FlxEmitter(_arg1:Number=0, _arg2:Number=0){
x = _arg1;
y = _arg2;
width = 0;
height = 0;
minParticleSpeed = new FlxPoint(-100, -100);
maxParticleSpeed = new FlxPoint(100, 100);
minRotation = -360;
maxRotation = 360;
gravity = 400;
particleDrag = new FlxPoint();
delay = 0;
quantity = 0;
_counter = 0;
_explode = true;
exists = false;
on = false;
}
public function setRotation(_arg1:Number=0, _arg2:Number=0):void{
minRotation = _arg1;
maxRotation = _arg2;
}
override public function update():void{
super.update();
updateEmitter();
}
public function setYSpeed(_arg1:Number=0, _arg2:Number=0):void{
minParticleSpeed.y = _arg1;
maxParticleSpeed.y = _arg2;
}
public function stop(_arg1:Number=3):void{
_explode = true;
delay = _arg1;
if (delay < 0){
delay = -(_arg1);
};
on = false;
}
public function setSize(_arg1:uint, _arg2:uint):void{
width = _arg1;
height = _arg2;
}
public function at(_arg1:FlxObject):void{
x = (_arg1.x + _arg1.origin.x);
y = (_arg1.y + _arg1.origin.y);
}
override protected function updateMembers():void{
var _local1:FlxObject;
var _local2:uint = members.length;
var _local3:uint;
while (_local3 < _local2) {
_local1 = (members[_local3] as FlxObject);
if (((((!((_local1 == null))) && (_local1.exists))) && (_local1.active))){
_local1.update();
};
_local3++;
};
}
public function start(_arg1:Boolean=true, _arg2:Number=0, _arg3:uint=0):void{
if (members.length <= 0){
FlxG.log("WARNING: there are no sprites loaded in your emitter.\nAdd some to FlxEmitter.members or use FlxEmitter.createSprites().");
return;
};
_explode = _arg1;
if (!_explode){
_counter = 0;
};
if (!exists){
_particle = 0;
};
exists = true;
visible = true;
active = true;
dead = false;
on = true;
_timer = 0;
if (quantity == 0){
quantity = _arg3;
};
if (_arg2 != 0){
delay = _arg2;
};
if (delay < 0){
delay = -(delay);
};
if (delay == 0){
if (_arg1){
delay = 3;
} else {
delay = 0.1;
};
};
}
protected function updateEmitter():void{
var _local1:uint;
var _local2:uint;
if (_explode){
_timer = (_timer + FlxG.elapsed);
if ((((delay > 0)) && ((_timer > delay)))){
kill();
return;
};
if (on){
on = false;
_local2 = members.length;
if (quantity > 0){
_local2 = quantity;
};
_local2 = (_local2 + _particle);
_local1 = _particle;
while (_local1 < _local2) {
emitParticle();
_local1++;
};
};
return;
};
if (!on){
return;
};
_timer = (_timer + FlxG.elapsed);
while ((((_timer > delay)) && ((((quantity <= 0)) || ((_counter < quantity)))))) {
_timer = (_timer - delay);
emitParticle();
};
}
override public function kill():void{
super.kill();
on = false;
}
public function setXSpeed(_arg1:Number=0, _arg2:Number=0):void{
minParticleSpeed.x = _arg1;
maxParticleSpeed.x = _arg2;
}
public function createSprites(_arg1:Class, _arg2:uint=50, _arg3:uint=16, _arg4:Boolean=true, _arg5:Number=0):FlxEmitter{
var _local6:uint;
var _local7:FlxSprite;
var _local9:Number;
var _local10:Number;
members = new Array();
var _local8:uint = 1;
if (_arg4){
_local7 = new FlxSprite(0, 0, _arg1);
_local8 = (_local7.width / _local7.height);
};
var _local11:uint;
while (_local11 < _arg2) {
_local7 = new FlxSprite();
if (_arg4){
_local6 = (FlxU.random() * _local8);
if (_arg3 > 0){
_local7.loadRotatedGraphic(_arg1, _arg3, _local6);
} else {
_local7.loadGraphic(_arg1, true);
_local7.frame = _local6;
};
} else {
if (_arg3 > 0){
_local7.loadRotatedGraphic(_arg1, _arg3);
} else {
_local7.loadGraphic(_arg1);
};
};
if (_arg5 > 0){
_local9 = _local7.width;
_local10 = _local7.height;
_local7.width = (_local7.width * _arg5);
_local7.height = (_local7.height * _arg5);
_local7.offset.x = ((_local9 - _local7.width) / 2);
_local7.offset.y = ((_local10 - _local7.height) / 2);
_local7.solid = true;
} else {
_local7.solid = false;
};
_local7.exists = false;
_local7.scrollFactor = scrollFactor;
add(_local7);
_local11++;
};
return (this);
}
public function emitParticle():void{
var _local1:FlxSprite;
_counter++;
_local1 = (members[_particle] as FlxSprite);
_local1.visible = true;
_local1.exists = true;
_local1.active = true;
_local1.x = ((x - (_local1.width >> 1)) + (FlxU.random() * width));
_local1.y = ((y - (_local1.height >> 1)) + (FlxU.random() * height));
_local1.velocity.x = minParticleSpeed.x;
if (minParticleSpeed.x != maxParticleSpeed.x){
_local1.velocity.x = (_local1.velocity.x + (FlxU.random() * (maxParticleSpeed.x - minParticleSpeed.x)));
};
_local1.velocity.y = minParticleSpeed.y;
if (minParticleSpeed.y != maxParticleSpeed.y){
_local1.velocity.y = (_local1.velocity.y + (FlxU.random() * (maxParticleSpeed.y - minParticleSpeed.y)));
};
_local1.acceleration.y = gravity;
_local1.angularVelocity = minRotation;
if (minRotation != maxRotation){
_local1.angularVelocity = (_local1.angularVelocity + (FlxU.random() * (maxRotation - minRotation)));
};
if (_local1.angularVelocity != 0){
_local1.angle = ((FlxU.random() * 360) - 180);
};
_local1.drag.x = particleDrag.x;
_local1.drag.y = particleDrag.y;
_local1.visible = true;
_particle++;
if (_particle >= members.length){
_particle = 0;
};
_local1.onEmit();
}
}
}//package org.flixel
Section 132
//FlxG (org.flixel.FlxG)
package org.flixel {
import flash.display.*;
import flash.geom.*;
import org.flixel.data.*;
public class FlxG {
public static var panel:FlxPanel;
protected static var _mute:Boolean;
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 debug:Boolean;
public static var LIBRARY_MINOR_VERSION:uint = 35;
public static var LIBRARY_MAJOR_VERSION:uint = 2;
public static var levels:Array;
public static var maxElapsed:Number;
public static var fade:FlxFade;
public static var timeScale:Number;
protected static var _cache:Object;
public static var level:int;
public static var elapsed:Number;
public static var score:int;
public static var save:int;
public static var saves:Array;
protected static var _scrollTarget:Point;
public static var followTarget:FlxObject;
public static var mouse:FlxMouse;
public static var followLead:Point;
public static var LIBRARY_NAME:String = "flixel";
protected static var _showBounds:Boolean;
public static var width:uint;
public static var followLerp:Number;
protected static var _game:FlxGame;
public static var scroll:Point;
public static var quake:FlxQuake;
public static var followMin:Point;
public static var flash:FlxFlash;
public static var followMax:Point;
public static var keys:FlxKeyboard;
protected static var _pause:Boolean;
public static function get stage():Stage{
if (((!((_game._state == null))) && (!((_game._state.parent == null))))){
return (_game._state.parent.stage);
};
return (null);
}
public static function get showBounds():Boolean{
return (_showBounds);
}
protected static function changeSounds():void{
var _local1:FlxSound;
if (((!((music == null))) && (music.active))){
music.updateTransform();
};
var _local2:uint = sounds.length;
var _local3:uint;
while (_local3 < _local2) {
_local1 = (sounds[_local3] as FlxSound);
if (((!((_local1 == null))) && (_local1.active))){
_local1.updateTransform();
};
_local3++;
};
}
public static function get mute():Boolean{
return (_mute);
}
public static function get volume():Number{
return (_volume);
}
static function doFollow():void{
if (followTarget != null){
_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 getMuteValue():uint{
if (_mute){
return (0);
};
return (1);
}
public static function set showBounds(_arg1:Boolean):void{
var _local2:Boolean = _showBounds;
_showBounds = _arg1;
if (_showBounds != _local2){
FlxObject._refreshBounds = true;
};
}
public static function addBitmap(_arg1:Class, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:String=null):BitmapData{
var _local8:uint;
var _local9:String;
var _local10:BitmapData;
var _local11:Matrix;
var _local5:Boolean;
var _local6:String = _arg4;
if (_local6 == null){
_local6 = String(_arg1);
if (((((_arg3) && (!((_cache[_local6] == undefined))))) && (!((_cache[_local6] == null))))){
_local8 = 0;
do {
var _temp1 = _local8;
_local8 = (_local8 + 1);
_local9 = (_local6 + _temp1);
} while (((!((_cache[_local9] == undefined))) && (!((_cache[_local9] == null)))));
_local6 = _local9;
};
};
if (!checkBitmapCache(_local6)){
_cache[_local6] = new (_arg1).bitmapData;
if (_arg2){
_local5 = true;
};
};
var _local7:BitmapData = _cache[_local6];
if (((((!(_local5)) && (_arg2))) && ((_local7.width == new (_arg1).bitmapData.width)))){
_local5 = true;
};
if (_local5){
_local10 = new BitmapData((_local7.width << 1), _local7.height, true, 0);
_local10.draw(_local7);
_local11 = new Matrix();
_local11.scale(-1, 1);
_local11.translate(_local10.width, 0);
_local10.draw(_local7, _local11);
_local7 = _local10;
};
return (_local7);
}
public static function set state(_arg1:FlxState):void{
_game.switchState(_arg1);
}
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 = sounds.length;
var _local5:uint;
while (_local5 < _local4) {
if (!(sounds[_local5] as FlxSound).active){
break;
};
_local5++;
};
if (sounds[_local5] == null){
sounds[_local5] = new FlxSound();
};
var _local6:FlxSound = sounds[_local5];
_local6.loadEmbedded(_arg1, _arg3);
_local6.volume = _arg2;
_local6.play();
return (_local6);
}
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, _arg4: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();
scroll = null;
_scrollTarget = null;
unfollow();
FlxG.levels = new Array();
FlxG.scores = new Array();
level = 0;
score = 0;
FlxU.seed = NaN;
kong = null;
pause = false;
timeScale = 1;
framerate = 60;
frameratePaused = 10;
maxElapsed = 0.0333333;
FlxG.elapsed = 0;
_showBounds = false;
FlxObject._refreshBounds = false;
panel = new FlxPanel();
quake = new FlxQuake(_arg4);
flash = new FlxFlash();
fade = new FlxFade();
FlxU.setWorldBounds(0, 0, FlxG.width, FlxG.height);
}
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 createBitmap(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:Boolean=false, _arg5:String=null):BitmapData{
var _local7:uint;
var _local8:String;
var _local6:String = _arg5;
if (_local6 == null){
_local6 = ((((_arg1 + "x") + _arg2) + ":") + _arg3);
if (((((_arg4) && (!((_cache[_local6] == undefined))))) && (!((_cache[_local6] == null))))){
_local7 = 0;
do {
var _temp1 = _local7;
_local7 = (_local7 + 1);
_local8 = (_local6 + _temp1);
} while (((!((_cache[_local8] == undefined))) && (!((_cache[_local8] == null)))));
_local6 = _local8;
};
};
if (!checkBitmapCache(_local6)){
_cache[_local6] = new BitmapData(_arg1, _arg2, true, _arg3);
};
return (_cache[_local6]);
}
public static function get frameratePaused():uint{
return (_game._frameratePaused);
}
public static function log(_arg1:Object):void{
if (((!((_game == null))) && (!((_game._console == null))))){
_game._console.log(((_arg1)==null) ? "ERROR: null object" : _arg1.toString());
};
}
public static function checkBitmapCache(_arg1:String):Boolean{
return (((!((_cache[_arg1] == undefined))) && (!((_cache[_arg1] == null)))));
}
static function updateSounds():void{
var _local1:FlxSound;
if (((!((music == null))) && (music.active))){
music.update();
};
var _local2:uint = sounds.length;
var _local3:uint;
while (_local3 < _local2) {
_local1 = (sounds[_local3] as FlxSound);
if (((!((_local1 == null))) && (_local1.active))){
_local1.update();
};
_local3++;
};
}
static function updateInput():void{
keys.update();
mouse.update(state.mouseX, state.mouseY, scroll.x, scroll.y);
}
public static function stream(_arg1:String, _arg2:Number=1, _arg3:Boolean=false):FlxSound{
var _local4:uint = sounds.length;
var _local5:uint;
while (_local5 < _local4) {
if (!(sounds[_local5] as FlxSound).active){
break;
};
_local5++;
};
if (sounds[_local5] == null){
sounds[_local5] = new FlxSound();
};
var _local6:FlxSound = sounds[_local5];
_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;
if (scroll == null){
scroll = new Point();
} else {
scroll.x = (scroll.y = 0);
};
if (_scrollTarget == null){
_scrollTarget = new Point();
} else {
_scrollTarget.x = (_scrollTarget.y = 0);
};
}
public static function get state():FlxState{
return (_game._state);
}
protected static function playSounds():void{
var _local1:FlxSound;
if (((!((music == null))) && (music.active))){
music.play();
};
var _local2:uint = sounds.length;
var _local3:uint;
while (_local3 < _local2) {
_local1 = (sounds[_local3] as FlxSound);
if (((!((_local1 == null))) && (_local1.active))){
_local1.play();
};
_local3++;
};
}
public static function followAdjust(_arg1:Number=0, _arg2:Number=0):void{
followLead = new Point(_arg1, _arg2);
}
public static function set framerate(_arg1:uint):void{
_game._framerate = _arg1;
if (((!(_game._paused)) && (!((_game.stage == null))))){
_game.stage.frameRate = _arg1;
};
}
public static function set frameratePaused(_arg1:uint):void{
_game._frameratePaused = _arg1;
if (((_game._paused) && (!((_game.stage == null))))){
_game.stage.frameRate = _arg1;
};
}
public static function follow(_arg1:FlxObject, _arg2:Number=1):void{
followTarget = _arg1;
followLerp = _arg2;
_scrollTarget.x = (((width >> 1) - followTarget.x) - (followTarget.width >> 1));
_scrollTarget.y = (((height >> 1) - followTarget.y) - (followTarget.height >> 1));
scroll.x = _scrollTarget.x;
scroll.y = _scrollTarget.y;
doFollow();
}
public static function resetInput():void{
keys.reset();
mouse.reset();
}
public static function get framerate():uint{
return (_game._framerate);
}
public static function followBounds(_arg1:int=0, _arg2:int=0, _arg3:int=0, _arg4:int=0, _arg5:Boolean=true):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;
};
if (_arg5){
FlxU.setWorldBounds(_arg1, _arg2, (_arg3 - _arg1), (_arg4 - _arg2));
};
doFollow();
}
protected static function pauseSounds():void{
var _local1:FlxSound;
if (((!((music == null))) && (music.active))){
music.pause();
};
var _local2:uint = sounds.length;
var _local3:uint;
while (_local3 < _local2) {
_local1 = (sounds[_local3] as FlxSound);
if (((!((_local1 == null))) && (_local1.active))){
_local1.pause();
};
_local3++;
};
}
static function destroySounds(_arg1:Boolean=false):void{
var _local2:FlxSound;
if (sounds == null){
return;
};
if (((!((music == null))) && (((_arg1) || (!(music.survive)))))){
music.destroy();
};
var _local3:uint = sounds.length;
var _local4:uint;
while (_local4 < _local3) {
_local2 = (sounds[_local4] as FlxSound);
if (((!((_local2 == null))) && (((_arg1) || (!(_local2.survive)))))){
_local2.destroy();
};
_local4++;
};
}
public static function set pause(_arg1:Boolean):void{
var _local2:Boolean = _pause;
_pause = _arg1;
if (_pause != _local2){
if (_pause){
_game.pauseGame();
pauseSounds();
} else {
_game.unpauseGame();
playSounds();
};
};
}
public static function get pause():Boolean{
return (_pause);
}
}
}//package org.flixel
Section 133
//FlxGame (org.flixel.FlxGame)
package org.flixel {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import org.flixel.data.*;
import flash.text.*;
import flash.ui.*;
public class FlxGame extends Sprite {
protected var SndFlixel:Class;
var _screen:Sprite;
var _state:FlxState;
protected var SndBeep:Class;
var _console:FlxConsole;
var _gameXOffset:int;
var _frameratePaused:uint;
var _created:Boolean;
var _zoom:uint;
var _elapsed:Number;
var _total:uint;
var _soundTrayBars:Array;
var _iState:Class;
protected var junk:String;// = "FlxGame_junk"
var _zeroPoint:Point;
var _paused:Boolean;
public var useDefaultHotKeys:Boolean;
var _framerate:uint;
var _gameYOffset:int;
var _buffer:Bitmap;
var _soundTray:Sprite;
var _frame:Class;
public var pause:FlxGroup;
var _soundTrayTimer:Number;
public function FlxGame(_arg1:uint, _arg2:uint, _arg3:Class, _arg4:uint=2){
SndBeep = FlxGame_SndBeep;
SndFlixel = FlxGame_SndFlixel;
super();
Mouse.hide();
_zoom = _arg4;
FlxState.bgColor = 4278190080;
FlxG.setGameData(this, _arg1, _arg2, _arg4);
_elapsed = 0;
_total = 0;
pause = new FlxPause();
_state = null;
_iState = _arg3;
_zeroPoint = new Point();
useDefaultHotKeys = true;
_frame = null;
_gameXOffset = 0;
_gameYOffset = 0;
_paused = false;
_created = false;
addEventListener(Event.ENTER_FRAME, create);
}
function pauseGame():void{
if (((!((x == 0))) || (!((y == 0))))){
x = 0;
y = 0;
};
Mouse.show();
_paused = true;
stage.frameRate = _frameratePaused;
}
function unpauseGame():void{
if (!FlxG.panel.visible){
Mouse.hide();
};
FlxG.resetInput();
_paused = false;
stage.frameRate = _framerate;
}
protected function onFocus(_arg1:Event=null):void{
if (FlxG.pause){
FlxG.pause = false;
};
}
protected function onKeyUp(_arg1:KeyboardEvent):void{
var _local2:int;
var _local3:String;
if ((((_arg1.keyCode == 192)) || ((_arg1.keyCode == 220)))){
_console.toggle();
return;
};
if (useDefaultHotKeys){
_local2 = _arg1.keyCode;
_local3 = String.fromCharCode(_arg1.charCode);
switch (_local2){
case 48:
case 96:
FlxG.mute = !(FlxG.mute);
showSoundTray();
return;
case 109:
case 189:
FlxG.mute = false;
FlxG.volume = (FlxG.volume - 0.1);
showSoundTray();
return;
case 107:
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);
}
public function switchState(_arg1:FlxState):void{
FlxG.panel.hide();
FlxG.unfollow();
FlxG.resetInput();
FlxG.destroySounds();
FlxG.flash.stop();
FlxG.fade.stop();
FlxG.quake.stop();
_screen.x = 0;
_screen.y = 0;
_screen.addChild(_arg1);
if (_state != null){
_state.destroy();
_screen.swapChildren(_arg1, _state);
_screen.removeChild(_state);
};
_state = _arg1;
_state.scaleX = (_state.scaleY = _zoom);
_state.create();
}
protected function update(_arg1:Event):void{
var _local3:uint;
var _local4:FlxSave;
var _local2:uint = getTimer();
var _local5:uint = (_local2 - _total);
_elapsed = (_local5 / 1000);
_console.mtrTotal.add(_local5);
_total = _local2;
FlxG.elapsed = _elapsed;
if (FlxG.elapsed > FlxG.maxElapsed){
FlxG.elapsed = FlxG.maxElapsed;
};
FlxG.elapsed = (FlxG.elapsed * FlxG.timeScale);
if (_soundTray != null){
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;
_local4 = new FlxSave();
if (_local4.bind("flixel")){
if (_local4.data.sound == null){
_local4.data.sound = new Object();
};
_local4.data.mute = FlxG.mute;
_local4.data.volume = FlxG.volume;
_local4.forceSave();
};
};
};
};
};
FlxG.panel.update();
if (_console.visible){
_console.update();
};
FlxObject._refreshBounds = false;
FlxG.updateInput();
FlxG.updateSounds();
if (_paused){
pause.update();
} else {
FlxG.doFollow();
_state.update();
if (FlxG.flash.exists){
FlxG.flash.update();
};
if (FlxG.fade.exists){
FlxG.fade.update();
};
FlxG.quake.update();
_screen.x = FlxG.quake.x;
_screen.y = FlxG.quake.y;
};
var _local6:uint = getTimer();
_console.mtrUpdate.add((_local6 - _local2));
FlxG.buffer.lock();
_state.preProcess();
_state.render();
if (FlxG.flash.exists){
FlxG.flash.render();
};
if (FlxG.fade.exists){
FlxG.fade.render();
};
if (FlxG.panel.visible){
FlxG.panel.render();
};
if (FlxG.mouse.cursor != null){
if (FlxG.mouse.cursor.active){
FlxG.mouse.cursor.update();
};
if (FlxG.mouse.cursor.visible){
FlxG.mouse.cursor.render();
};
};
_state.postProcess();
if (_paused){
pause.render();
};
FlxG.buffer.unlock();
_console.mtrRender.add((getTimer() - _local6));
}
protected function addFrame(_arg1:Class, _arg2:uint, _arg3:uint):FlxGame{
_frame = _arg1;
_gameXOffset = _arg2;
_gameYOffset = _arg3;
return (this);
}
public function showSoundTray(_arg1:Boolean=false):void{
if (!_arg1){
FlxG.play(SndBeep);
};
_soundTrayTimer = 1;
_soundTray.y = (_gameYOffset * _zoom);
_soundTray.visible = true;
var _local2:uint = Math.round((FlxG.volume * 10));
if (FlxG.mute){
_local2 = 0;
};
var _local3:uint;
while (_local3 < _soundTrayBars.length) {
if (_local3 < _local2){
_soundTrayBars[_local3].alpha = 1;
} else {
_soundTrayBars[_local3].alpha = 0.5;
};
_local3++;
};
}
function create(_arg1:Event):void{
var _local2:uint;
var _local3:FlxSave;
var _local10:Bitmap;
if (root == null){
return;
};
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.frameRate = _framerate;
_screen = new Sprite();
addChild(_screen);
var _local4:Bitmap = new Bitmap(new BitmapData(FlxG.width, FlxG.height, true, FlxState.bgColor));
_local4.x = _gameXOffset;
_local4.y = _gameYOffset;
_local4.scaleX = (_local4.scaleY = _zoom);
_screen.addChild(_local4);
FlxG.buffer = _local4.bitmapData;
_console = new FlxConsole(_gameXOffset, _gameYOffset, _zoom);
addChild(_console);
var _local5:String = ((((FlxG.LIBRARY_NAME + " v") + FlxG.LIBRARY_MAJOR_VERSION) + ".") + FlxG.LIBRARY_MINOR_VERSION);
if (FlxG.debug){
_local5 = (_local5 + " [debug]");
} else {
_local5 = (_local5 + " [release]");
};
var _local6 = "";
_local2 = 0;
while (_local2 < (_local5.length + 32)) {
_local6 = (_local6 + "-");
_local2++;
};
FlxG.log(_local5);
FlxG.log(_local6);
stage.addEventListener(KeyboardEvent.KEY_DOWN, FlxG.keys.handleKeyDown);
stage.addEventListener(KeyboardEvent.KEY_UP, onKeyUp);
stage.addEventListener(MouseEvent.MOUSE_DOWN, FlxG.mouse.handleMouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP, FlxG.mouse.handleMouseUp);
stage.addEventListener(MouseEvent.MOUSE_OUT, FlxG.mouse.handleMouseOut);
stage.addEventListener(MouseEvent.MOUSE_OVER, FlxG.mouse.handleMouseOver);
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);
var _local7:TextField = new TextField();
_local7.width = _local4.width;
_local7.height = _local4.height;
_local7.multiline = true;
_local7.wordWrap = true;
_local7.selectable = false;
_local7.embedFonts = true;
_local7.antiAliasType = AntiAliasType.NORMAL;
_local7.gridFitType = GridFitType.PIXEL;
_local7.defaultTextFormat = new TextFormat("system", 8, 0xFFFFFF, null, null, null, null, null, "center");
_soundTray.addChild(_local7);
_local7.text = "VOLUME";
_local7.y = 16;
var _local8:uint = 10;
var _local9:uint = 14;
_soundTrayBars = new Array();
_local2 = 0;
while (_local2 < 10) {
_local4 = new Bitmap(new BitmapData(4, (_local2 + 1), false, 0xFFFFFF));
_local4.x = _local8;
_local4.y = _local9;
_soundTrayBars.push(_soundTray.addChild(_local4));
_local8 = (_local8 + 6);
_local9--;
_local2++;
};
addChild(_soundTray);
if (_frame != null){
_local10 = new _frame();
_local10.scaleX = _zoom;
_local10.scaleY = _zoom;
addChild(_local10);
};
_local3 = new FlxSave();
if (((_local3.bind("flixel")) && (!((_local3.data.sound == null))))){
if (_local3.data.volume != null){
FlxG.volume = _local3.data.volume;
};
if (_local3.data.mute != null){
FlxG.mute = _local3.data.mute;
};
showSoundTray(true);
};
switchState(new _iState());
FlxState.screen.unsafeBind(FlxG.buffer);
removeEventListener(Event.ENTER_FRAME, create);
addEventListener(Event.ENTER_FRAME, update);
}
protected function onFocusLost(_arg1:Event=null):void{
FlxG.pause = true;
}
}
}//package org.flixel
Section 134
//FlxGame_junk (org.flixel.FlxGame_junk)
package org.flixel {
import mx.core.*;
public class FlxGame_junk extends FontAsset {
}
}//package org.flixel
Section 135
//FlxGame_SndBeep (org.flixel.FlxGame_SndBeep)
package org.flixel {
import mx.core.*;
public class FlxGame_SndBeep extends SoundAsset {
}
}//package org.flixel
Section 136
//FlxGame_SndFlixel (org.flixel.FlxGame_SndFlixel)
package org.flixel {
import mx.core.*;
public class FlxGame_SndFlixel extends SoundAsset {
}
}//package org.flixel
Section 137
//FlxGroup (org.flixel.FlxGroup)
package org.flixel {
public class FlxGroup extends FlxObject {
public var members:Array;
protected var _first:Boolean;
protected var _last:FlxPoint;
public function FlxGroup(){
_group = true;
solid = false;
members = new Array();
_last = new FlxPoint();
_first = true;
}
public function getFirstExtant():FlxObject{
var _local1:FlxObject;
var _local2:uint = members.length;
var _local3:uint;
while (_local3 < _local2) {
_local1 = (members[_local3] as FlxObject);
if (((!((_local1 == null))) && (_local1.exists))){
return (_local1);
};
_local3++;
};
return (null);
}
override public function destroy():void{
destroyMembers();
super.destroy();
}
public function getFirstAlive():FlxObject{
var _local1:FlxObject;
var _local2:uint = members.length;
var _local3:uint;
while (_local3 < _local2) {
_local1 = (members[_local3] as FlxObject);
if (((((!((_local1 == null))) && (_local1.exists))) && (!(_local1.dead)))){
return (_local1);
};
_local3++;
};
return (null);
}
public function remove(_arg1:FlxObject, _arg2:Boolean=false):FlxObject{
var _local3:int = members.indexOf(_arg1);
if ((((_local3 < 0)) || ((_local3 >= members.length)))){
return (null);
};
if (_arg2){
members.splice(_local3, 1);
} else {
members[_local3] = null;
};
return (_arg1);
}
override public function update():void{
saveOldPosition();
updateMotion();
updateMembers();
updateFlickering();
}
public function resetFirstAvail(_arg1:Number=0, _arg2:Number=0):Boolean{
var _local3:FlxObject = getFirstAvail();
if (_local3 == null){
return (false);
};
_local3.reset(_arg1, _arg2);
return (true);
}
override public function reset(_arg1:Number, _arg2:Number):void{
var _local3:Number;
var _local4:Number;
var _local6:FlxObject;
saveOldPosition();
super.reset(_arg1, _arg2);
var _local5:Boolean;
if (((!((x == _last.x))) || (!((y == _last.y))))){
_local5 = true;
_local3 = (x - _last.x);
_local4 = (y - _last.y);
};
var _local7:uint = members.length;
var _local8:uint;
while (_local8 < _local7) {
_local6 = (members[_local8] as FlxObject);
if (((!((_local6 == null))) && (_local6.exists))){
if (_local5){
if (_local6._group){
_local6.reset((_local6.x + _local3), (_local6.y + _local4));
} else {
_local6.x = (_local6.x + _local3);
_local6.y = (_local6.y + _local4);
if (solid){
_local6.colHullX.width = (_local6.colHullX.width + ((_local3)>0) ? _local3 : -(_local3));
if (_local3 < 0){
_local6.colHullX.x = (_local6.colHullX.x + _local3);
};
_local6.colHullY.x = x;
_local6.colHullY.height = (_local6.colHullY.height + ((_local4)>0) ? _local4 : -(_local4));
if (_local4 < 0){
_local6.colHullY.y = (_local6.colHullY.y + _local4);
};
_local6.colVector.x = (_local6.colVector.x + _local3);
_local6.colVector.y = (_local6.colVector.y + _local4);
};
};
};
};
_local8++;
};
}
protected function updateMembers():void{
var _local1:Number;
var _local2:Number;
var _local4:FlxObject;
var _local3:Boolean;
if (((!((x == _last.x))) || (!((y == _last.y))))){
_local3 = true;
_local1 = (x - _last.x);
_local2 = (y - _last.y);
};
var _local5:uint = members.length;
var _local6:uint;
while (_local6 < _local5) {
_local4 = (members[_local6] as FlxObject);
if (((!((_local4 == null))) && (_local4.exists))){
if (_local3){
if (_local4._group){
_local4.reset((_local4.x + _local1), (_local4.y + _local2));
} else {
_local4.x = (_local4.x + _local1);
_local4.y = (_local4.y + _local2);
};
};
if (_local4.active){
_local4.update();
};
if (((_local3) && (_local4.solid))){
_local4.colHullX.width = (_local4.colHullX.width + ((_local1)>0) ? _local1 : -(_local1));
if (_local1 < 0){
_local4.colHullX.x = (_local4.colHullX.x + _local1);
};
_local4.colHullY.x = x;
_local4.colHullY.height = (_local4.colHullY.height + ((_local2)>0) ? _local2 : -(_local2));
if (_local2 < 0){
_local4.colHullY.y = (_local4.colHullY.y + _local2);
};
_local4.colVector.x = (_local4.colVector.x + _local1);
_local4.colVector.y = (_local4.colVector.y + _local2);
};
};
_local6++;
};
}
public function countDead():int{
var _local1:FlxObject;
var _local2 = -1;
var _local3:uint = members.length;
var _local4:uint;
while (_local4 < _local3) {
_local1 = (members[_local4] as FlxObject);
if (_local1 != null){
if (_local2 < 0){
_local2 = 0;
};
if (_local1.dead){
_local2++;
};
};
_local4++;
};
return (_local2);
}
public function getFirstAvail():FlxObject{
var _local1:FlxObject;
var _local2:uint = members.length;
var _local3:uint;
while (_local3 < _local2) {
_local1 = (members[_local3] as FlxObject);
if (((!((_local1 == null))) && (!(_local1.exists)))){
return (_local1);
};
_local3++;
};
return (null);
}
override public function render():void{
renderMembers();
}
public function countLiving():int{
var _local1:FlxObject;
var _local2 = -1;
var _local3:uint = members.length;
var _local4:uint;
while (_local4 < _local3) {
_local1 = (members[_local4] as FlxObject);
if (_local1 != null){
if (_local2 < 0){
_local2 = 0;
};
if (((_local1.exists) && (!(_local1.dead)))){
_local2++;
};
};
_local4++;
};
return (_local2);
}
public function countOnScreen():int{
var _local1:FlxObject;
var _local2 = -1;
var _local3:uint = members.length;
var _local4:uint;
while (_local4 < _local3) {
_local1 = (members[_local4] as FlxObject);
if (_local1 != null){
if (_local2 < 0){
_local2 = 0;
};
if (_local1.onScreen()){
_local2++;
};
};
_local4++;
};
return (_local2);
}
protected function killMembers():void{
var _local1:FlxObject;
var _local2:uint = members.length;
var _local3:uint;
while (_local3 < _local2) {
_local1 = (members[_local3] as FlxObject);
if (_local1 != null){
_local1.kill();
};
_local3++;
};
}
override public function kill():void{
killMembers();
super.kill();
}
public function getFirstNull():int{
var _local1:uint = members.length;
var _local2:uint;
while (_local2 < _local1) {
if (members[_local2] == null){
return (_local2);
};
_local2++;
};
return (-1);
}
protected function renderMembers():void{
var _local1:FlxObject;
var _local2:uint = members.length;
var _local3:uint;
while (_local3 < _local2) {
_local1 = (members[_local3] as FlxObject);
if (((((!((_local1 == null))) && (_local1.exists))) && (_local1.visible))){
_local1.render();
};
_local3++;
};
}
public function add(_arg1:FlxObject, _arg2:Boolean=false):FlxObject{
members.push(_arg1);
if (_arg2){
_arg1.scrollFactor = scrollFactor;
};
return (_arg1);
}
protected function saveOldPosition():void{
if (_first){
_first = false;
_last.x = 0;
_last.y = 0;
return;
};
_last.x = x;
_last.y = y;
}
public function replace(_arg1:FlxObject, _arg2:FlxObject):FlxObject{
var _local3:int = members.indexOf(_arg1);
if ((((_local3 < 0)) || ((_local3 >= members.length)))){
return (null);
};
members[_local3] = _arg2;
return (_arg2);
}
public function getRandom():FlxObject{
var _local1:uint;
var _local2:FlxObject;
var _local3:uint = members.length;
var _local4:uint = uint((FlxU.random() * _local3));
while ((((_local2 == null)) && ((_local1 < members.length)))) {
++_local4;
_local2 = (members[(_local4 % _local3)] as FlxObject);
_local1++;
};
return (_local2);
}
public function getFirstDead():FlxObject{
var _local1:FlxObject;
var _local2:uint = members.length;
var _local3:uint;
while (_local3 < _local2) {
_local1 = (members[_local3] as FlxObject);
if (((!((_local1 == null))) && (_local1.dead))){
return (_local1);
};
_local3++;
};
return (null);
}
protected function destroyMembers():void{
var _local1:FlxObject;
var _local2:uint = members.length;
var _local3:uint;
while (_local3 < _local2) {
_local1 = (members[_local3] as FlxObject);
if (_local1 != null){
_local1.destroy();
};
_local3++;
};
members.length = 0;
}
}
}//package org.flixel
Section 138
//FlxMonitor (org.flixel.FlxMonitor)
package org.flixel {
public class FlxMonitor {
protected var _size:uint;
protected var _itr:uint;
protected var _data:Array;
public function FlxMonitor(_arg1:uint, _arg2:Number=0){
_size = _arg1;
if (_size <= 0){
_size = 1;
};
_itr = 0;
_data = new Array(_size);
var _local3:uint;
while (_local3 < _size) {
_data[_local3] = _arg2;
_local3++;
};
}
public function add(_arg1:Number):void{
var _local2 = _itr++;
_data[_local2] = _arg1;
if (_itr >= _size){
_itr = 0;
};
}
public function average():Number{
var _local1:Number = 0;
var _local2:uint;
while (_local2 < _size) {
_local1 = (_local1 + _data[_local2]);
_local2++;
};
return ((_local1 / _size));
}
}
}//package org.flixel
Section 139
//FlxObject (org.flixel.FlxObject)
package org.flixel {
import flash.geom.*;
public class FlxObject extends FlxRect {
public var acceleration:FlxPoint;
public var angularAcceleration:Number;
public var active:Boolean;
public var collideBottom:Boolean;
var _group:Boolean;
protected var _point:FlxPoint;
public var colHullX:FlxRect;
protected var _flickerTimer:Number;
public var colHullY:FlxRect;
protected var _flashPoint:Point;
public var colOffsets:Array;
protected var _solid:Boolean;
public var origin:FlxPoint;
public var drag:FlxPoint;
public var angularDrag:Number;
public var collideTop:Boolean;
protected var _flicker:Boolean;
protected var _rect:FlxRect;
public var moves:Boolean;
public var angle:Number;
public var exists:Boolean;
public var velocity:FlxPoint;
public var maxAngular:Number;
public var angularVelocity:Number;
public var maxVelocity:FlxPoint;
public var maxThrust:Number;
public var dead:Boolean;
public var collideLeft:Boolean;
public var thrust:Number;
public var onFloor:Boolean;
public var health:Number;
protected var _fixed:Boolean;
public var visible:Boolean;
public var colVector:FlxPoint;
public var scrollFactor:FlxPoint;
public var collideRight:Boolean;
protected static const _pZero:FlxPoint = new FlxPoint();
static var _refreshBounds:Boolean;
public function FlxObject(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0){
super(_arg1, _arg2, _arg3, _arg4);
exists = true;
active = true;
visible = true;
_solid = true;
_fixed = false;
moves = true;
collideLeft = true;
collideRight = true;
collideTop = true;
collideBottom = true;
origin = new FlxPoint();
velocity = new FlxPoint();
acceleration = new FlxPoint();
drag = new FlxPoint();
maxVelocity = new FlxPoint(10000, 10000);
angle = 0;
angularVelocity = 0;
angularAcceleration = 0;
angularDrag = 0;
maxAngular = 10000;
thrust = 0;
scrollFactor = new FlxPoint(1, 1);
_flicker = false;
_flickerTimer = -1;
health = 1;
dead = false;
_point = new FlxPoint();
_rect = new FlxRect();
_flashPoint = new Point();
colHullX = new FlxRect();
colHullY = new FlxRect();
colVector = new FlxPoint();
colOffsets = new Array(new FlxPoint());
_group = false;
}
public function getScreenXY(_arg1:FlxPoint=null):FlxPoint{
if (_arg1 == null){
_arg1 = new FlxPoint();
};
_arg1.x = (FlxU.floor((x + FlxU.roundingError)) + FlxU.floor((FlxG.scroll.x * scrollFactor.x)));
_arg1.y = (FlxU.floor((y + FlxU.roundingError)) + FlxU.floor((FlxG.scroll.y * scrollFactor.y)));
return (_arg1);
}
public function onScreen():Boolean{
getScreenXY(_point);
if (((((((((_point.x + width) < 0)) || ((_point.x > FlxG.width)))) || (((_point.y + height) < 0)))) || ((_point.y > FlxG.height)))){
return (false);
};
return (true);
}
public function kill():void{
exists = false;
dead = true;
}
protected function updateFlickering():void{
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 render():void{
}
public function hitBottom(_arg1:FlxObject, _arg2:Number):void{
onFloor = true;
if (!fixed){
velocity.y = _arg2;
};
}
public function get fixed():Boolean{
return (_fixed);
}
public function overlaps(_arg1:FlxObject):Boolean{
var _local10:FlxSprite;
var _local11:FlxSprite;
getScreenXY(_point);
var _local2:Number = _point.x;
var _local3:Number = _point.y;
var _local4:Number = width;
var _local5:Number = height;
if ((this is FlxSprite)){
_local10 = (this as FlxSprite);
_local4 = _local10.frameWidth;
_local5 = _local10.frameHeight;
};
_arg1.getScreenXY(_point);
var _local6:Number = _point.x;
var _local7:Number = _point.y;
var _local8:Number = _arg1.width;
var _local9:Number = _arg1.height;
if ((_arg1 is FlxSprite)){
_local11 = (_arg1 as FlxSprite);
_local8 = _local11.frameWidth;
_local9 = _local11.frameHeight;
};
if ((((((((_local6 <= (_local2 - _local8))) || ((_local6 >= (_local2 + _local4))))) || ((_local7 <= (_local3 - _local9))))) || ((_local7 >= (_local3 + _local5))))){
return (false);
};
return (true);
}
public function preCollide(_arg1:FlxObject):void{
}
public function get solid():Boolean{
return (_solid);
}
public function hurt(_arg1:Number):void{
if ((health = (health - _arg1)) <= 0){
kill();
};
}
public function refreshHulls():void{
colHullX.x = x;
colHullX.y = y;
colHullX.width = width;
colHullX.height = height;
colHullY.x = x;
colHullY.y = y;
colHullY.width = width;
colHullY.height = height;
}
public function hitLeft(_arg1:FlxObject, _arg2:Number):void{
if (!fixed){
velocity.x = _arg2;
};
}
public function collide(_arg1:FlxObject=null):Boolean{
return (FlxU.collide(this, ((_arg1)==null) ? this : _arg1));
}
public function reset(_arg1:Number, _arg2:Number):void{
x = _arg1;
y = _arg2;
exists = true;
dead = false;
}
public function update():void{
updateMotion();
updateFlickering();
}
public function hitTop(_arg1:FlxObject, _arg2:Number):void{
if (!fixed){
velocity.y = _arg2;
};
}
public function set solid(_arg1:Boolean):void{
_solid = _arg1;
}
protected function updateMotion():void{
var _local1:Number;
var _local2:FlxPoint;
var _local5:FlxPoint;
var _local6:Number;
if (!moves){
return;
};
if (_solid){
refreshHulls();
};
onFloor = false;
_local1 = ((FlxU.computeVelocity(angularVelocity, angularAcceleration, angularDrag, maxAngular) - angularVelocity) / 2);
angularVelocity = (angularVelocity + _local1);
angle = (angle + (angularVelocity * FlxG.elapsed));
angularVelocity = (angularVelocity + _local1);
if (thrust != 0){
_local2 = FlxU.rotatePoint(-(thrust), 0, 0, 0, angle);
_local5 = FlxU.rotatePoint(-(maxThrust), 0, 0, 0, angle);
_local6 = ((_local5.x)>0) ? _local5.x : -(_local5.x);
if (_local6 > ((_local5.y)>0) ? _local5.y : -(_local5.y)){
_local5.y = _local6;
} else {
_local6 = ((_local5.y)>0) ? _local5.y : -(_local5.y);
};
maxVelocity.x = (maxVelocity.y = ((_local6)>0) ? _local6 : -(_local6));
} else {
_local2 = _pZero;
};
_local1 = ((FlxU.computeVelocity(velocity.x, (acceleration.x + _local2.x), drag.x, maxVelocity.x) - velocity.x) / 2);
velocity.x = (velocity.x + _local1);
var _local3:Number = (velocity.x * FlxG.elapsed);
velocity.x = (velocity.x + _local1);
_local1 = ((FlxU.computeVelocity(velocity.y, (acceleration.y + _local2.y), drag.y, maxVelocity.y) - velocity.y) / 2);
velocity.y = (velocity.y + _local1);
var _local4:Number = (velocity.y * FlxG.elapsed);
velocity.y = (velocity.y + _local1);
x = (x + _local3);
y = (y + _local4);
if (!_solid){
return;
};
colVector.x = _local3;
colVector.y = _local4;
colHullX.width = (colHullX.width + ((colVector.x)>0) ? colVector.x : -(colVector.x));
if (colVector.x < 0){
colHullX.x = (colHullX.x + colVector.x);
};
colHullY.x = x;
colHullY.height = (colHullY.height + ((colVector.y)>0) ? colVector.y : -(colVector.y));
if (colVector.y < 0){
colHullY.y = (colHullY.y + colVector.y);
};
}
public function getBoundingColor():uint{
if (solid){
if (fixed){
return (2130768421);
};
return (2147418130);
//unresolved jump
};
return (2130743529);
}
public function set fixed(_arg1:Boolean):void{
_fixed = _arg1;
}
public function flickering():Boolean{
return ((_flickerTimer >= 0));
}
public function overlapsPoint(_arg1:Number, _arg2:Number, _arg3:Boolean=false):Boolean{
_arg1 = (_arg1 + FlxU.floor(FlxG.scroll.x));
_arg2 = (_arg2 + FlxU.floor(FlxG.scroll.y));
getScreenXY(_point);
if ((((((((_arg1 <= _point.x)) || ((_arg1 >= (_point.x + width))))) || ((_arg2 <= _point.y)))) || ((_arg2 >= (_point.y + height))))){
return (false);
};
return (true);
}
public function hitRight(_arg1:FlxObject, _arg2:Number):void{
hitLeft(_arg1, _arg2);
}
public function destroy():void{
}
public function flicker(_arg1:Number=1):void{
_flickerTimer = _arg1;
if (_flickerTimer < 0){
_flicker = false;
visible = true;
};
}
}
}//package org.flixel
Section 140
//FlxPoint (org.flixel.FlxPoint)
package org.flixel {
public class FlxPoint {
public var x:Number;
public var y:Number;
public function FlxPoint(_arg1:Number=0, _arg2:Number=0){
x = _arg1;
y = _arg2;
}
public function toString():String{
return (FlxU.getClassName(this, true));
}
}
}//package org.flixel
Section 141
//FlxPreloader (org.flixel.FlxPreloader)
package org.flixel {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
public class FlxPreloader extends MovieClip {
protected var _height:uint;
protected var _width:uint;
protected var ImgLogoLight:Class;
protected var _logo:Bitmap;
protected var _text:TextField;
protected var _min:uint;
protected var _buffer:Sprite;
public var className:String;
public var myURL:String;
protected var _bmpBar:Bitmap;
protected var ImgLogo:Class;
protected var _init:Boolean;
protected var ImgLogoCorners:Class;
protected var _logoGlow:Bitmap;
public var minDisplayTime:Number;
public function FlxPreloader(){
var tmp:Bitmap;
var re:RegExp;
var fmt:TextFormat;
var txt:TextField;
ImgLogo = FlxPreloader_ImgLogo;
ImgLogoCorners = FlxPreloader_ImgLogoCorners;
ImgLogoLight = FlxPreloader_ImgLogoLight;
super();
minDisplayTime = 0;
stop();
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
try {
throw (new Error("Setting global debug flag..."));
} catch(e:Error) {
re = /\[.*:[0-9]+\]/;
FlxG.debug = re.test(e.getStackTrace());
};
if (((((!(FlxG.debug)) && (!((myURL == null))))) && ((root.loaderInfo.url.indexOf(myURL) < 0)))){
tmp = new Bitmap(new BitmapData(stage.stageWidth, stage.stageHeight, true, 4294967295));
addChild(tmp);
fmt = new TextFormat();
fmt.color = 0;
fmt.size = 16;
fmt.align = "center";
fmt.bold = true;
fmt.font = "system";
txt = new TextField();
txt.width = (tmp.width - 16);
txt.height = (tmp.height - 16);
txt.y = 8;
txt.multiline = true;
txt.wordWrap = true;
txt.embedFonts = true;
txt.defaultTextFormat = fmt;
txt.text = (("Hi there! It looks like somebody copied this game without my permission. Just click anywhere, or copy-paste this URL into your browser.\n\n" + myURL) + "\n\nto play the game at my site. Thanks, and have fun!");
addChild(txt);
txt.addEventListener(MouseEvent.CLICK, goToMyURL);
tmp.addEventListener(MouseEvent.CLICK, goToMyURL);
return;
};
_init = false;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
protected function update(_arg1:Number):void{
_bmpBar.scaleX = (_arg1 * (_width - 8));
_text.text = (((((("FLX v" + FlxG.LIBRARY_MAJOR_VERSION) + ".") + FlxG.LIBRARY_MINOR_VERSION) + " ") + FlxU.floor((_arg1 * 100))) + "%");
_text.setTextFormat(_text.defaultTextFormat);
if (_arg1 < 0.1){
_logoGlow.alpha = 0;
_logo.alpha = 0;
} else {
if (_arg1 < 0.15){
_logoGlow.alpha = FlxU.random(false);
_logo.alpha = 0;
} else {
if (_arg1 < 0.2){
_logoGlow.alpha = 0;
_logo.alpha = 0;
} else {
if (_arg1 < 0.25){
_logoGlow.alpha = 0;
_logo.alpha = FlxU.random(false);
} else {
if (_arg1 < 0.7){
_logoGlow.alpha = ((_arg1 - 0.45) / 0.45);
_logo.alpha = 1;
} else {
if ((((_arg1 > 0.8)) && ((_arg1 < 0.9)))){
_logoGlow.alpha = (1 - ((_arg1 - 0.8) / 0.1));
_logo.alpha = 0;
} else {
if (_arg1 > 0.9){
_buffer.alpha = (1 - ((_arg1 - 0.9) / 0.1));
};
};
};
};
};
};
};
}
private function goToMyURL(_arg1:MouseEvent=null):void{
navigateToURL(new URLRequest(("http://" + myURL)));
}
protected function onEnterFrame(_arg1:Event):void{
var _local2:int;
var _local4:Class;
var _local5:Object;
var _local6:Number;
if (!_init){
if ((((stage.stageWidth <= 0)) || ((stage.stageHeight <= 0)))){
return;
};
create();
_init = true;
};
graphics.clear();
var _local3:uint = getTimer();
if ((((framesLoaded >= totalFrames)) && ((_local3 > _min)))){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
nextFrame();
_local4 = Class(getDefinitionByName(className));
if (_local4){
_local5 = new (_local4);
addChild((_local5 as DisplayObject));
};
removeChild(_buffer);
} else {
_local6 = (root.loaderInfo.bytesLoaded / root.loaderInfo.bytesTotal);
if ((((_min > 0)) && ((_local6 > (_local3 / _min))))){
_local6 = (_local3 / _min);
};
update(_local6);
};
}
protected function create():void{
var _local3:uint;
_min = 0;
if (!FlxG.debug){
_min = (minDisplayTime * 1000);
};
_buffer = new Sprite();
_buffer.scaleX = 2;
_buffer.scaleY = 2;
addChild(_buffer);
_width = (stage.stageWidth / _buffer.scaleX);
_height = (stage.stageHeight / _buffer.scaleY);
_buffer.addChild(new Bitmap(new BitmapData(_width, _height, false, 13406)));
var _local1:Bitmap = new ImgLogoLight();
_local1.smoothing = true;
_local1.width = (_local1.height = _height);
_local1.x = ((_width - _local1.width) / 2);
_buffer.addChild(_local1);
_bmpBar = new Bitmap(new BitmapData(1, 7, false, 6253311));
_bmpBar.x = 4;
_bmpBar.y = (_height - 11);
_buffer.addChild(_bmpBar);
_text = new TextField();
_text.defaultTextFormat = new TextFormat("system", 8, 6253311);
_text.embedFonts = true;
_text.selectable = false;
_text.multiline = false;
_text.x = 2;
_text.y = (_bmpBar.y - 11);
_text.width = 80;
_buffer.addChild(_text);
_logo = new ImgLogo();
_logo.scaleX = (_logo.scaleY = (_height / 8));
_logo.x = ((_width - _logo.width) / 2);
_logo.y = ((_height - _logo.height) / 2);
_buffer.addChild(_logo);
_logoGlow = new ImgLogo();
_logoGlow.smoothing = true;
_logoGlow.blendMode = "screen";
_logoGlow.scaleX = (_logoGlow.scaleY = (_height / 8));
_logoGlow.x = ((_width - _logoGlow.width) / 2);
_logoGlow.y = ((_height - _logoGlow.height) / 2);
_buffer.addChild(_logoGlow);
_local1 = new ImgLogoCorners();
_local1.smoothing = true;
_local1.width = _width;
_local1.height = _height;
_buffer.addChild(_local1);
_local1 = new Bitmap(new BitmapData(_width, _height, false, 0xFFFFFF));
var _local2:uint;
while (_local2 < _height) {
_local3 = 0;
while (_local3 < _width) {
_local1.bitmapData.setPixel(_local3, _local2, 0);
_local3++;
};
_local2 = (_local2 + 2);
};
_local1.blendMode = "overlay";
_local1.alpha = 0.25;
_buffer.addChild(_local1);
}
}
}//package org.flixel
Section 142
//FlxPreloader_ImgLogo (org.flixel.FlxPreloader_ImgLogo)
package org.flixel {
import mx.core.*;
public class FlxPreloader_ImgLogo extends BitmapAsset {
}
}//package org.flixel
Section 143
//FlxPreloader_ImgLogoCorners (org.flixel.FlxPreloader_ImgLogoCorners)
package org.flixel {
import mx.core.*;
public class FlxPreloader_ImgLogoCorners extends BitmapAsset {
}
}//package org.flixel
Section 144
//FlxPreloader_ImgLogoLight (org.flixel.FlxPreloader_ImgLogoLight)
package org.flixel {
import mx.core.*;
public class FlxPreloader_ImgLogoLight extends BitmapAsset {
}
}//package org.flixel
Section 145
//FlxQuadTree (org.flixel.FlxQuadTree)
package org.flixel {
import org.flixel.data.*;
public class FlxQuadTree extends FlxRect {
protected var _sw:FlxQuadTree;
protected var _mx:Number;
protected var _my:Number;
protected var _ne:FlxQuadTree;
protected var _hh:Number;
protected var _headA:FlxList;
protected var _headB:FlxList;
protected var _canSubdivide:Boolean;
protected var _l:Number;
protected var _hw:Number;
protected var _nw:FlxQuadTree;
protected var _se:FlxQuadTree;
protected var _tailA:FlxList;
protected var _r:Number;
protected var _t:Number;
protected var _tailB:FlxList;
protected var _b:Number;
public static const A_LIST:uint = 0;
public static const B_LIST:uint = 1;
protected static var _ot:Number;
protected static var _or:Number;
protected static var _o:FlxObject;
protected static var _ob:Number;
protected static var _min:uint;
protected static var _oc:Function;
protected static var _ol:Number;
protected static var _oa:uint;
public function FlxQuadTree(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:FlxQuadTree=null){
var _local6:FlxList;
var _local7:FlxList;
super(_arg1, _arg2, _arg3, _arg4);
_headA = (_tailA = new FlxList());
_headB = (_tailB = new FlxList());
if (_arg5 != null){
if (_arg5._headA.object != null){
_local6 = _arg5._headA;
while (_local6 != null) {
if (_tailA.object != null){
_local7 = _tailA;
_tailA = new FlxList();
_local7.next = _tailA;
};
_tailA.object = _local6.object;
_local6 = _local6.next;
};
};
if (_arg5._headB.object != null){
_local6 = _arg5._headB;
while (_local6 != null) {
if (_tailB.object != null){
_local7 = _tailB;
_tailB = new FlxList();
_local7.next = _tailB;
};
_tailB.object = _local6.object;
_local6 = _local6.next;
};
};
} else {
_min = ((width + height) / (2 * FlxU.quadTreeDivisions));
};
_canSubdivide = (((width > _min)) || ((height > _min)));
_nw = null;
_ne = null;
_se = null;
_sw = null;
_l = x;
_r = (x + width);
_hw = (width / 2);
_mx = (_l + _hw);
_t = y;
_b = (y + height);
_hh = (height / 2);
_my = (_t + _hh);
}
protected function addObject():void{
if (((!(_canSubdivide)) || ((((((((_l >= _ol)) && ((_r <= _or)))) && ((_t >= _ot)))) && ((_b <= _ob)))))){
addToList();
return;
};
if ((((_ol > _l)) && ((_or < _mx)))){
if ((((_ot > _t)) && ((_ob < _my)))){
if (_nw == null){
_nw = new FlxQuadTree(_l, _t, _hw, _hh, this);
};
_nw.addObject();
return;
};
if ((((_ot > _my)) && ((_ob < _b)))){
if (_sw == null){
_sw = new FlxQuadTree(_l, _my, _hw, _hh, this);
};
_sw.addObject();
return;
};
};
if ((((_ol > _mx)) && ((_or < _r)))){
if ((((_ot > _t)) && ((_ob < _my)))){
if (_ne == null){
_ne = new FlxQuadTree(_mx, _t, _hw, _hh, this);
};
_ne.addObject();
return;
};
if ((((_ot > _my)) && ((_ob < _b)))){
if (_se == null){
_se = new FlxQuadTree(_mx, _my, _hw, _hh, this);
};
_se.addObject();
return;
};
};
if ((((((((_or > _l)) && ((_ol < _mx)))) && ((_ob > _t)))) && ((_ot < _my)))){
if (_nw == null){
_nw = new FlxQuadTree(_l, _t, _hw, _hh, this);
};
_nw.addObject();
};
if ((((((((_or > _mx)) && ((_ol < _r)))) && ((_ob > _t)))) && ((_ot < _my)))){
if (_ne == null){
_ne = new FlxQuadTree(_mx, _t, _hw, _hh, this);
};
_ne.addObject();
};
if ((((((((_or > _mx)) && ((_ol < _r)))) && ((_ob > _my)))) && ((_ot < _b)))){
if (_se == null){
_se = new FlxQuadTree(_mx, _my, _hw, _hh, this);
};
_se.addObject();
};
if ((((((((_or > _l)) && ((_ol < _mx)))) && ((_ob > _my)))) && ((_ot < _b)))){
if (_sw == null){
_sw = new FlxQuadTree(_l, _my, _hw, _hh, this);
};
_sw.addObject();
};
}
protected function addToList():void{
var _local1:FlxList;
if (_oa == A_LIST){
if (_tailA.object != null){
_local1 = _tailA;
_tailA = new FlxList();
_local1.next = _tailA;
};
_tailA.object = _o;
} else {
if (_tailB.object != null){
_local1 = _tailB;
_tailB = new FlxList();
_local1.next = _tailB;
};
_tailB.object = _o;
};
if (!_canSubdivide){
return;
};
if (_nw != null){
_nw.addToList();
};
if (_ne != null){
_ne.addToList();
};
if (_se != null){
_se.addToList();
};
if (_sw != null){
_sw.addToList();
};
}
public function overlap(_arg1:Boolean=true, _arg2:Function=null):Boolean{
var _local4:FlxList;
_oc = _arg2;
var _local3:Boolean;
if (_arg1){
_oa = B_LIST;
if (_headA.object != null){
_local4 = _headA;
while (_local4 != null) {
_o = _local4.object;
if (((((_o.exists) && (_o.solid))) && (overlapNode()))){
_local3 = true;
};
_local4 = _local4.next;
};
};
_oa = A_LIST;
if (_headB.object != null){
_local4 = _headB;
while (_local4 != null) {
_o = _local4.object;
if (((_o.exists) && (_o.solid))){
if (((!((_nw == null))) && (_nw.overlapNode()))){
_local3 = true;
};
if (((!((_ne == null))) && (_ne.overlapNode()))){
_local3 = true;
};
if (((!((_se == null))) && (_se.overlapNode()))){
_local3 = true;
};
if (((!((_sw == null))) && (_sw.overlapNode()))){
_local3 = true;
};
};
_local4 = _local4.next;
};
};
} else {
if (_headA.object != null){
_local4 = _headA;
while (_local4 != null) {
_o = _local4.object;
if (((((_o.exists) && (_o.solid))) && (overlapNode(_local4.next)))){
_local3 = true;
};
_local4 = _local4.next;
};
};
};
if (((!((_nw == null))) && (_nw.overlap(_arg1, _oc)))){
_local3 = true;
};
if (((!((_ne == null))) && (_ne.overlap(_arg1, _oc)))){
_local3 = true;
};
if (((!((_se == null))) && (_se.overlap(_arg1, _oc)))){
_local3 = true;
};
if (((!((_sw == null))) && (_sw.overlap(_arg1, _oc)))){
_local3 = true;
};
return (_local3);
}
public function add(_arg1:FlxObject, _arg2:uint):void{
var _local3:FlxObject;
var _local4:Array;
var _local5:uint;
var _local6:uint;
_oa = _arg2;
if (_arg1._group){
_local4 = (_arg1 as FlxGroup).members;
_local5 = _local4.length;
_local6 = 0;
while (_local6 < _local5) {
_local3 = (_local4[_local6] as FlxObject);
if (((!((_local3 == null))) && (_local3.exists))){
if (_local3._group){
add(_local3, _arg2);
} else {
if (_local3.solid){
_o = _local3;
_ol = _o.x;
_ot = _o.y;
_or = (_o.x + _o.width);
_ob = (_o.y + _o.height);
addObject();
};
};
};
_local6++;
};
};
if (_arg1.solid){
_o = _arg1;
_ol = _o.x;
_ot = _o.y;
_or = (_o.x + _o.width);
_ob = (_o.y + _o.height);
addObject();
};
}
protected function overlapNode(_arg1:FlxList=null):Boolean{
var _local3:FlxObject;
var _local2:Boolean;
var _local4:FlxList = _arg1;
if (_local4 == null){
if (_oa == A_LIST){
_local4 = _headA;
} else {
_local4 = _headB;
};
};
if (_local4.object != null){
while (_local4 != null) {
_local3 = _local4.object;
if ((((((((((((((((((_o === _local3)) || (!(_local3.exists)))) || (!(_o.exists)))) || (!(_local3.solid)))) || (!(_o.solid)))) || (((_o.x + _o.width) < (_local3.x + FlxU.roundingError))))) || (((_o.x + FlxU.roundingError) > (_local3.x + _local3.width))))) || (((_o.y + _o.height) < (_local3.y + FlxU.roundingError))))) || (((_o.y + FlxU.roundingError) > (_local3.y + _local3.height))))){
_local4 = _local4.next;
} else {
if (_oc == null){
_o.kill();
_local3.kill();
_local2 = true;
} else {
if (_oc(_o, _local3)){
_local2 = true;
};
};
_local4 = _local4.next;
};
};
};
return (_local2);
}
}
}//package org.flixel
Section 146
//FlxRect (org.flixel.FlxRect)
package org.flixel {
public class FlxRect extends FlxPoint {
public var width:Number;
public var height:Number;
public function FlxRect(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0){
super(_arg1, _arg2);
width = _arg3;
height = _arg4;
}
public function get bottom():Number{
return ((y + height));
}
public function get top():Number{
return (y);
}
public function get left():Number{
return (x);
}
public function get right():Number{
return ((x + width));
}
}
}//package org.flixel
Section 147
//FlxSave (org.flixel.FlxSave)
package org.flixel {
import flash.net.*;
public class FlxSave {
protected var _so:SharedObject;
public var data:Object;
public var name:String;
public function FlxSave(){
name = null;
_so = null;
data = null;
}
public function read(_arg1:String):Object{
if (_so == null){
FlxG.log("WARNING: You must call FlxSave.bind()\nbefore calling FlxSave.read().");
return (null);
};
return (data[_arg1]);
}
public function forceSave(_arg1:uint=0):Boolean{
var MinFileSize = _arg1;
if (_so == null){
FlxG.log("WARNING: You must call FlxSave.bind()\nbefore calling FlxSave.forceSave().");
return (false);
};
var status:Object;
try {
status = _so.flush(MinFileSize);
} catch(e:Error) {
FlxG.log("WARNING: There was a problem flushing\nthe shared object data from FlxSave.");
return (false);
};
return ((status == SharedObjectFlushStatus.FLUSHED));
}
public function bind(_arg1:String):Boolean{
var Name = _arg1;
name = null;
_so = null;
data = null;
name = Name;
try {
_so = SharedObject.getLocal(name);
} catch(e:Error) {
FlxG.log("WARNING: There was a problem binding to\nthe shared object data from FlxSave.");
name = null;
_so = null;
data = null;
return (false);
};
data = _so.data;
return (true);
}
public function erase(_arg1:uint=0):Boolean{
if (_so == null){
FlxG.log("WARNING: You must call FlxSave.bind()\nbefore calling FlxSave.erase().");
return (false);
};
_so.clear();
return (forceSave(_arg1));
}
public function write(_arg1:String, _arg2:Object, _arg3:uint=0):Boolean{
if (_so == null){
FlxG.log("WARNING: You must call FlxSave.bind()\nbefore calling FlxSave.write().");
return (false);
};
data[_arg1] = _arg2;
return (forceSave(_arg3));
}
}
}//package org.flixel
Section 148
//FlxSound (org.flixel.FlxSound)
package org.flixel {
import flash.events.*;
import flash.media.*;
import flash.net.*;
public class FlxSound extends FlxObject {
public var name:String;
protected var _position:Number;
protected var _fadeOutTotal:Number;
protected var _fadeOutTimer:Number;
protected var _sound:Sound;
protected var _pauseOnFadeOut:Boolean;
protected var _volumeAdjust:Number;
public var playing:Boolean;
protected var _radius:Number;
protected var _volume:Number;
protected var _point2:FlxPoint;
protected var _fadeInTimer:Number;
public var artist:String;
protected var _channel:SoundChannel;
protected var _fadeInTotal:Number;
protected var _looped:Boolean;
protected var _pan:Boolean;
protected var _transform:SoundTransform;
protected var _init:Boolean;
public var survive:Boolean;
protected var _core:FlxObject;
public function FlxSound(){
_point2 = new FlxPoint();
_transform = new SoundTransform();
init();
fixed = true;
}
public function loadStream(_arg1:String, _arg2:Boolean=false):FlxSound{
stop();
init();
_sound = new Sound();
_sound.addEventListener(Event.ID3, gotID3);
_sound.load(new URLRequest(_arg1));
_looped = _arg2;
updateTransform();
active = true;
return (this);
}
public function stop():void{
_position = 0;
if (_channel != null){
_channel.stop();
stopped();
};
}
public function loadEmbedded(_arg1:Class, _arg2:Boolean=false):FlxSound{
stop();
init();
_sound = new (_arg1);
_looped = _arg2;
updateTransform();
active = true;
return (this);
}
public function get volume():Number{
return (_volume);
}
function updateTransform():void{
_transform.volume = (((FlxG.getMuteValue() * FlxG.volume) * _volume) * _volumeAdjust);
if (_channel != null){
_channel.soundTransform = _transform;
};
}
public function fadeOut(_arg1:Number, _arg2:Boolean=false):void{
_pauseOnFadeOut = _arg2;
_fadeInTimer = 0;
_fadeOutTimer = _arg1;
_fadeOutTotal = _fadeOutTimer;
}
public function play():void{
if (_position < 0){
return;
};
if (_looped){
if (_position == 0){
if (_channel == null){
_channel = _sound.play(0, 9999, _transform);
};
if (_channel == null){
active = false;
};
} else {
_channel = _sound.play(_position, 0, _transform);
if (_channel == null){
active = false;
} else {
_channel.addEventListener(Event.SOUND_COMPLETE, looped);
};
};
} else {
if (_position == 0){
if (_channel == null){
_channel = _sound.play(0, 0, _transform);
if (_channel == null){
active = false;
} else {
_channel.addEventListener(Event.SOUND_COMPLETE, stopped);
};
};
} else {
_channel = _sound.play(_position, 0, _transform);
if (_channel == null){
active = false;
};
};
};
playing = !((_channel == null));
_position = 0;
}
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{
_transform.pan = 0;
_sound = null;
_position = 0;
_volume = 1;
_volumeAdjust = 1;
_looped = false;
_core = null;
_radius = 0;
_pan = false;
_fadeOutTimer = 0;
_fadeOutTotal = 0;
_pauseOnFadeOut = false;
_fadeInTimer = 0;
_fadeInTotal = 0;
active = false;
visible = false;
solid = false;
playing = false;
name = null;
artist = null;
}
protected function looped(_arg1:Event=null):void{
if (_channel == null){
return;
};
_channel.removeEventListener(Event.SOUND_COMPLETE, looped);
_channel = null;
play();
}
protected function updateSound():void{
var _local3:FlxPoint;
var _local4:FlxPoint;
var _local5:Number;
var _local6:Number;
var _local7:Number;
if (_position != 0){
return;
};
var _local1:Number = 1;
var _local2:Number = 1;
if (_core != null){
_local3 = new FlxPoint();
_local4 = new FlxPoint();
_core.getScreenXY(_local3);
getScreenXY(_local4);
_local5 = (_local3.x - _local4.x);
_local6 = (_local3.y - _local4.y);
_local1 = ((_radius - Math.sqrt(((_local5 * _local5) + (_local6 * _local6)))) / _radius);
if (_local1 < 0){
_local1 = 0;
};
if (_local1 > 1){
_local1 = 1;
};
if (_pan){
_local7 = (-(_local5) / _radius);
if (_local7 < -1){
_local7 = -1;
} else {
if (_local7 > 1){
_local7 = 1;
};
};
_transform.pan = _local7;
};
};
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 / _fadeInTotal);
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();
}
override public function update():void{
super.update();
updateSound();
}
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;
playing = false;
}
protected function gotID3(_arg1:Event=null):void{
FlxG.log("got ID3 info!");
if (_sound.id3.songName.length > 0){
name = _sound.id3.songName;
};
if (_sound.id3.artist.length > 0){
artist = _sound.id3.artist;
};
_sound.removeEventListener(Event.ID3, gotID3);
}
public function pause():void{
if (_channel == null){
_position = -1;
return;
};
_position = _channel.position;
_channel.stop();
if (_looped){
while (_position >= _sound.length) {
_position = (_position - _sound.length);
};
};
_channel = null;
playing = false;
}
override public function destroy():void{
if (active){
stop();
};
}
public function proximity(_arg1:Number, _arg2:Number, _arg3:FlxObject, _arg4:Number, _arg5:Boolean=true):FlxSound{
x = _arg1;
y = _arg2;
_core = _arg3;
_radius = _arg4;
_pan = _arg5;
return (this);
}
}
}//package org.flixel
Section 149
//FlxSprite (org.flixel.FlxSprite)
package org.flixel {
import flash.display.*;
import flash.geom.*;
import org.flixel.data.*;
public class FlxSprite extends FlxObject {
protected var _mtx:Matrix;
protected var _caf:uint;
public var finished:Boolean;
protected var _animations:Array;
protected var _ct:ColorTransform;
public var offset:FlxPoint;
protected var _callback:Function;
protected var _curAnim:FlxAnim;
protected var _framePixels:BitmapData;
protected var _flipped:uint;
public var scale:FlxPoint;
protected var _pixels:BitmapData;
protected var _bakedRotation:Number;
public var blend:String;
public var frameWidth:uint;
protected var _flashRect2:Rectangle;
protected var _bbb:BitmapData;
protected var _alpha:Number;
protected var _flashPointZero:Point;
protected var _curFrame:uint;
public var frameHeight:uint;
protected var _flashRect:Rectangle;
protected var _frameTimer:Number;
protected var _facing:uint;
public var antialiasing:Boolean;
protected var _color:uint;
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:Number=0, _arg2:Number=0, _arg3:Class=null){
x = _arg1;
y = _arg2;
_flashRect = new Rectangle();
_flashRect2 = new Rectangle();
_flashPointZero = new Point();
offset = new FlxPoint();
scale = new FlxPoint(1, 1);
_alpha = 1;
_color = 0xFFFFFF;
blend = null;
antialiasing = false;
finished = false;
_facing = RIGHT;
_animations = new Array();
_flipped = 0;
_curAnim = null;
_curFrame = 0;
_caf = 0;
_frameTimer = 0;
_mtx = new Matrix();
_callback = null;
if (_arg3 == null){
createGraphic(8, 8);
} else {
loadGraphic(_arg3);
};
}
override public function set fixed(_arg1:Boolean):void{
var _local2:Boolean = _fixed;
_fixed = _arg1;
if (((!((_local2 == _fixed))) && (FlxG.showBounds))){
calcFrame();
};
}
protected function renderSprite():void{
if (_refreshBounds){
calcFrame();
};
getScreenXY(_point);
_flashPoint.x = _point.x;
_flashPoint.y = _point.y;
if ((((((((((angle == 0)) || ((_bakedRotation > 0)))) && ((scale.x == 1)))) && ((scale.y == 1)))) && ((blend == null)))){
FlxG.buffer.copyPixels(_framePixels, _flashRect, _flashPoint, null, null, true);
return;
};
_mtx.identity();
_mtx.translate(-(origin.x), -(origin.y));
_mtx.scale(scale.x, scale.y);
if (angle != 0){
_mtx.rotate(((Math.PI * 2) * (angle / 360)));
};
_mtx.translate((_point.x + origin.x), (_point.y + origin.y));
FlxG.buffer.draw(_framePixels, _mtx, null, blend, null, antialiasing);
}
public function fill(_arg1:uint):void{
_pixels.fillRect(_flashRect2, _arg1);
if (_pixels != _framePixels){
calcFrame();
};
}
public function get color():uint{
return (_color);
}
override public function getScreenXY(_arg1:FlxPoint=null):FlxPoint{
if (_arg1 == null){
_arg1 = new FlxPoint();
};
_arg1.x = ((FlxU.floor((x + FlxU.roundingError)) + FlxU.floor((FlxG.scroll.x * scrollFactor.x))) - offset.x);
_arg1.y = ((FlxU.floor((y + FlxU.roundingError)) + FlxU.floor((FlxG.scroll.y * scrollFactor.y))) - offset.y);
return (_arg1);
}
public function get frame():uint{
return (_caf);
}
override public function overlapsPoint(_arg1:Number, _arg2:Number, _arg3:Boolean=false):Boolean{
_arg1 = (_arg1 - FlxU.floor(FlxG.scroll.x));
_arg2 = (_arg2 - FlxU.floor(FlxG.scroll.y));
getScreenXY(_point);
if (_arg3){
return (_framePixels.hitTest(new Point(0, 0), 0xFF, new Point((_arg1 - _point.x), (_arg2 - _point.y))));
};
if ((((((((_arg1 <= _point.x)) || ((_arg1 >= (_point.x + frameWidth))))) || ((_arg2 <= _point.y)))) || ((_arg2 >= (_point.y + frameHeight))))){
return (false);
};
return (true);
}
override public function render():void{
renderSprite();
}
protected function drawBounds():void{
var _local1:uint = getBoundingColor();
_bbb.fillRect(_flashRect, 0);
var _local2:uint = _flashRect.width;
var _local3:uint = _flashRect.height;
_flashRect.width = width;
_flashRect.height = height;
_flashRect.x = int(offset.x);
_flashRect.y = int(offset.y);
_bbb.fillRect(_flashRect, _local1);
_flashRect.width = (_flashRect.width - 2);
_flashRect.height = (_flashRect.height - 2);
_flashRect.x++;
_flashRect.y++;
_bbb.fillRect(_flashRect, 0);
_flashRect.width = _local2;
_flashRect.height = _local3;
_flashRect.x = (_flashRect.y = 0);
_framePixels.copyPixels(_bbb, _flashRect, _flashPointZero, null, null, true);
}
protected function calcFrame():void{
var _local1:uint = (_caf * frameWidth);
var _local2:uint;
var _local3:uint = (_flipped) ? _flipped : _pixels.width;
if (_local1 >= _local3){
_local2 = (uint((_local1 / _local3)) * frameHeight);
_local1 = (_local1 % _local3);
};
if (((_flipped) && ((_facing == LEFT)))){
_local1 = (((_flipped << 1) - _local1) - frameWidth);
};
_flashRect.x = _local1;
_flashRect.y = _local2;
_framePixels.copyPixels(_pixels, _flashRect, _flashPointZero);
_flashRect.x = (_flashRect.y = 0);
if (_ct != null){
_framePixels.colorTransform(_flashRect, _ct);
};
if (FlxG.showBounds){
drawBounds();
};
if (_callback != null){
_callback(_curAnim.name, _curFrame, _caf);
};
}
function unsafeBind(_arg1:BitmapData):void{
_pixels = (_framePixels = _arg1);
}
public function loadGraphic(_arg1:Class, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:uint=0, _arg5:uint=0, _arg6:Boolean=false):FlxSprite{
_bakedRotation = 0;
_pixels = FlxG.addBitmap(_arg1, _arg3, _arg6);
if (_arg3){
_flipped = (_pixels.width >> 1);
} else {
_flipped = 0;
};
if (_arg4 == 0){
if (_arg2){
_arg4 = _pixels.height;
} else {
if (_flipped > 0){
_arg4 = (_pixels.width / 2);
} else {
_arg4 = _pixels.width;
};
};
};
width = (frameWidth = _arg4);
if (_arg5 == 0){
if (_arg2){
_arg5 = width;
} else {
_arg5 = _pixels.height;
};
};
height = (frameHeight = _arg5);
resetHelpers();
return (this);
}
public function get pixels():BitmapData{
return (_pixels);
}
public function set facing(_arg1:uint):void{
var _local2 = !((_facing == _arg1));
_facing = _arg1;
if (_local2){
calcFrame();
};
}
protected function resetHelpers():void{
_flashRect.x = 0;
_flashRect.y = 0;
_flashRect.width = frameWidth;
_flashRect.height = frameHeight;
_flashRect2.x = 0;
_flashRect2.y = 0;
_flashRect2.width = _pixels.width;
_flashRect2.height = _pixels.height;
if ((((((_framePixels == null)) || (!((_framePixels.width == width))))) || (!((_framePixels.height == height))))){
_framePixels = new BitmapData(width, height);
};
if ((((((_bbb == null)) || (!((_bbb.width == width))))) || (!((_bbb.height == height))))){
_bbb = new BitmapData(width, height);
};
origin.x = (frameWidth / 2);
origin.y = (frameHeight / 2);
_framePixels.copyPixels(_pixels, _flashRect, _flashPointZero);
if (FlxG.showBounds){
drawBounds();
};
_caf = 0;
refreshHulls();
}
public function addAnimation(_arg1:String, _arg2:Array, _arg3:Number=0, _arg4:Boolean=true):void{
_animations.push(new FlxAnim(_arg1, _arg2, _arg3, _arg4));
}
public function set alpha(_arg1:Number):void{
if (_arg1 > 1){
_arg1 = 1;
};
if (_arg1 < 0){
_arg1 = 0;
};
if (_arg1 == _alpha){
return;
};
_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();
}
protected function updateAnimation():void{
var _local1:uint;
var _local2:int;
if (_bakedRotation){
_local1 = _caf;
_local2 = (angle % 360);
if (_local2 < 0){
_local2 = (_local2 + 360);
};
_caf = (_local2 / _bakedRotation);
if (_local1 != _caf){
calcFrame();
};
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();
};
};
}
public function draw(_arg1:FlxSprite, _arg2:int=0, _arg3:int=0):void{
var _local4:BitmapData = _arg1._framePixels;
if ((((((((((_arg1.angle == 0)) || ((_arg1._bakedRotation > 0)))) && ((_arg1.scale.x == 1)))) && ((_arg1.scale.y == 1)))) && ((_arg1.blend == null)))){
_flashPoint.x = _arg2;
_flashPoint.y = _arg3;
_flashRect2.width = _local4.width;
_flashRect2.height = _local4.height;
_pixels.copyPixels(_local4, _flashRect2, _flashPoint, null, null, true);
_flashRect2.width = _pixels.width;
_flashRect2.height = _pixels.height;
calcFrame();
return;
};
_mtx.identity();
_mtx.translate(-(_arg1.origin.x), -(_arg1.origin.y));
_mtx.scale(_arg1.scale.x, _arg1.scale.y);
if (_arg1.angle != 0){
_mtx.rotate(((Math.PI * 2) * (_arg1.angle / 360)));
};
_mtx.translate((_arg2 + _arg1.origin.x), (_arg3 + _arg1.origin.y));
_pixels.draw(_local4, _mtx, null, _arg1.blend, null, _arg1.antialiasing);
calcFrame();
}
public function loadRotatedGraphic(_arg1:Class, _arg2:uint=16, _arg3:int=-1, _arg4:Boolean=false, _arg5:Boolean=false):FlxSprite{
var _local12:BitmapData;
var _local13:uint;
var _local14:uint;
var _local15:uint;
var _local16:uint;
var _local17:uint;
var _local18:Number;
var _local19:uint;
var _local20:uint;
var _local21:uint;
var _local22:uint;
var _local6:uint = Math.sqrt(_arg2);
var _local7:BitmapData = FlxG.addBitmap(_arg1);
if (_arg3 >= 0){
_local12 = _local7;
_local7 = new BitmapData(_local12.height, _local12.height);
_local13 = (_arg3 * _local7.width);
_local14 = 0;
_local15 = _local12.width;
if (_local13 >= _local15){
_local14 = (uint((_local13 / _local15)) * _local7.height);
_local13 = (_local13 % _local15);
};
_flashRect.x = _local13;
_flashRect.y = _local14;
_flashRect.width = _local7.width;
_flashRect.height = _local7.height;
_local7.copyPixels(_local12, _flashRect, _flashPointZero);
};
var _local8:uint = _local7.width;
if (_local7.height > _local8){
_local8 = _local7.height;
};
if (_arg5){
_local8 = (_local8 * 1.5);
};
var _local9:uint = FlxU.ceil((_arg2 / _local6));
width = (_local8 * _local9);
height = (_local8 * _local6);
var _local10:String = ((((((String(_arg1) + ":") + _arg3) + ":") + width) + "x") + height);
var _local11:Boolean = FlxG.checkBitmapCache(_local10);
_pixels = FlxG.createBitmap(width, height, 0, true, _local10);
width = (frameWidth = _pixels.width);
height = (frameHeight = _pixels.height);
_bakedRotation = (360 / _arg2);
if (!_local11){
_local18 = 0;
_local19 = (_local7.width / 2);
_local20 = (_local7.height / 2);
_local21 = (_local8 / 2);
_local22 = (_local8 / 2);
_local16 = 0;
while (_local16 < _local6) {
_local17 = 0;
while (_local17 < _local9) {
_mtx.identity();
_mtx.translate(-(_local19), -(_local20));
_mtx.rotate(((Math.PI * 2) * (_local18 / 360)));
_mtx.translate(((_local8 * _local17) + _local21), _local22);
_local18 = (_local18 + _bakedRotation);
_pixels.draw(_local7, _mtx, null, null, null, _arg4);
_local17++;
};
_local22 = (_local22 + _local8);
_local16++;
};
};
frameWidth = (frameHeight = (width = (height = _local8)));
resetHelpers();
return (this);
}
override public function update():void{
updateMotion();
updateAnimation();
updateFlickering();
}
public function set color(_arg1:uint):void{
_arg1 = (_arg1 & 0xFFFFFF);
if (_color == _arg1){
return;
};
_color = _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 createGraphic(_arg1:uint, _arg2:uint, _arg3:uint=4294967295, _arg4:Boolean=false, _arg5:String=null):FlxSprite{
_bakedRotation = 0;
_pixels = FlxG.createBitmap(_arg1, _arg2, _arg3, _arg4, _arg5);
width = (frameWidth = _pixels.width);
height = (frameHeight = _pixels.height);
resetHelpers();
return (this);
}
override public function set solid(_arg1:Boolean):void{
var _local2:Boolean = _solid;
_solid = _arg1;
if (((!((_local2 == _solid))) && (FlxG.showBounds))){
calcFrame();
};
}
public function addAnimationCallback(_arg1:Function):void{
_callback = _arg1;
}
public function set pixels(_arg1:BitmapData):void{
_pixels = _arg1;
width = (frameWidth = _pixels.width);
height = (frameHeight = _pixels.height);
resetHelpers();
}
public function get alpha():Number{
return (_alpha);
}
public function get facing():uint{
return (_facing);
}
public function set frame(_arg1:uint):void{
_curAnim = null;
_caf = _arg1;
calcFrame();
}
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){
_curAnim = _animations[_local4];
if (_curAnim.delay <= 0){
finished = true;
} else {
finished = false;
};
_caf = _curAnim.frames[_curFrame];
calcFrame();
return;
};
_local4++;
};
}
public function randomFrame():void{
_curAnim = null;
_caf = int((FlxU.random() * (_pixels.width / frameWidth)));
calcFrame();
}
}
}//package org.flixel
Section 150
//FlxState (org.flixel.FlxState)
package org.flixel {
import flash.display.*;
public class FlxState extends Sprite {
public var defaultGroup:FlxGroup;
public static var screen:FlxSprite;
public static var bgColor:uint;
public function FlxState(){
defaultGroup = new FlxGroup();
if (screen == null){
screen = new FlxSprite();
screen.createGraphic(FlxG.width, FlxG.height, 0, true);
screen.origin.x = (screen.origin.y = 0);
screen.antialiasing = true;
screen.exists = false;
screen.solid = false;
screen.fixed = true;
};
}
public function add(_arg1:FlxObject):FlxObject{
return (defaultGroup.add(_arg1));
}
public function preProcess():void{
screen.fill(bgColor);
}
public function collide():void{
FlxU.collide(defaultGroup, defaultGroup);
}
public function render():void{
defaultGroup.render();
}
public function update():void{
defaultGroup.update();
}
public function destroy():void{
defaultGroup.destroy();
}
public function create():void{
}
public function postProcess():void{
}
}
}//package org.flixel
Section 151
//FlxText (org.flixel.FlxText)
package org.flixel {
import flash.display.*;
import flash.text.*;
public class FlxText extends FlxSprite {
protected var _tf:TextField;
protected var _regen:Boolean;
protected var _shadow:uint;
public function FlxText(_arg1:Number, _arg2:Number, _arg3:uint, _arg4:String=null, _arg5:Boolean=true){
super(_arg1, _arg2);
createGraphic(_arg3, 1, 0);
if (_arg4 == null){
_arg4 = "";
};
_tf = new TextField();
_tf.width = _arg3;
_tf.embedFonts = _arg5;
_tf.selectable = false;
_tf.sharpness = 100;
_tf.multiline = true;
_tf.wordWrap = true;
_tf.text = _arg4;
var _local6:TextFormat = new TextFormat("system", 8, 0xFFFFFF);
_tf.defaultTextFormat = _local6;
_tf.setTextFormat(_local6);
if (_arg4.length <= 0){
_tf.height = 1;
} else {
_tf.height = 10;
};
_regen = true;
_shadow = 0;
solid = false;
calcFrame();
}
public function get shadow():uint{
return (_shadow);
}
public function get size():Number{
return ((_tf.defaultTextFormat.size as Number));
}
override public function get color():uint{
return ((_tf.defaultTextFormat.color as uint));
}
override public function set color(_arg1:uint):void{
var _local2:TextFormat = dtfCopy();
_local2.color = _arg1;
_tf.defaultTextFormat = _local2;
_tf.setTextFormat(_local2);
_regen = true;
calcFrame();
}
public function set shadow(_arg1:uint):void{
_shadow = _arg1;
calcFrame();
}
public function set size(_arg1:Number):void{
var _local2:TextFormat = dtfCopy();
_local2.size = _arg1;
_tf.defaultTextFormat = _local2;
_tf.setTextFormat(_local2);
_regen = true;
calcFrame();
}
public function get alignment():String{
return (_tf.defaultTextFormat.align);
}
protected function dtfCopy():TextFormat{
var _local1:TextFormat = _tf.defaultTextFormat;
return (new TextFormat(_local1.font, _local1.size, _local1.color, _local1.bold, _local1.italic, _local1.underline, _local1.url, _local1.target, _local1.align));
}
public function get text():String{
return (_tf.text);
}
public function get font():String{
return (_tf.defaultTextFormat.font);
}
public function set alignment(_arg1:String):void{
var _local2:TextFormat = dtfCopy();
_local2.align = _arg1;
_tf.defaultTextFormat = _local2;
_tf.setTextFormat(_local2);
calcFrame();
}
public function set font(_arg1:String):void{
var _local2:TextFormat = dtfCopy();
_local2.font = _arg1;
_tf.defaultTextFormat = _local2;
_tf.setTextFormat(_local2);
_regen = true;
calcFrame();
}
override protected function calcFrame():void{
var _local1:uint;
var _local2:uint;
var _local3:TextFormat;
var _local4:TextFormat;
if (_regen){
_local1 = _tf.numLines;
height = 0;
_local2 = 0;
while (_local2 < _local1) {
height = (height + _tf.getLineMetrics(_local2).height);
_local2++;
};
height = (height + 4);
_pixels = new BitmapData(width, height, true, 0);
_bbb = new BitmapData(width, height, true, 0);
frameHeight = height;
_tf.height = (height * 1.2);
_flashRect.x = 0;
_flashRect.y = 0;
_flashRect.width = width;
_flashRect.height = height;
_regen = false;
} else {
_pixels.fillRect(_flashRect, 0);
};
if (((((!((_tf == null))) && (!((_tf.text == null))))) && ((_tf.text.length > 0)))){
_local3 = _tf.defaultTextFormat;
_local4 = _local3;
_mtx.identity();
if ((((_local3.align == "center")) && ((_tf.numLines == 1)))){
_local4 = new TextFormat(_local3.font, _local3.size, _local3.color, null, null, null, null, null, "left");
_tf.setTextFormat(_local4);
_mtx.translate(Math.floor(((width - _tf.getLineMetrics(0).width) / 2)), 0);
};
if (_shadow > 0){
_tf.setTextFormat(new TextFormat(_local4.font, _local4.size, _shadow, null, null, null, null, null, _local4.align));
_mtx.translate(1, 1);
_pixels.draw(_tf, _mtx, _ct);
_mtx.translate(-1, -1);
_tf.setTextFormat(new TextFormat(_local4.font, _local4.size, _local4.color, null, null, null, null, null, _local4.align));
};
_pixels.draw(_tf, _mtx, _ct);
_tf.setTextFormat(new TextFormat(_local3.font, _local3.size, _local3.color, null, null, null, null, null, _local3.align));
};
if ((((((_framePixels == null)) || (!((_framePixels.width == _pixels.width))))) || (!((_framePixels.height == _pixels.height))))){
_framePixels = new BitmapData(_pixels.width, _pixels.height, true, 0);
};
_framePixels.copyPixels(_pixels, _flashRect, _flashPointZero);
if (FlxG.showBounds){
drawBounds();
};
if (solid){
refreshHulls();
};
}
public function setFormat(_arg1:String=null, _arg2:Number=8, _arg3:uint=0xFFFFFF, _arg4:String=null, _arg5:uint=0):FlxText{
if (_arg1 == null){
_arg1 = "";
};
var _local6:TextFormat = dtfCopy();
_local6.font = _arg1;
_local6.size = _arg2;
_local6.color = _arg3;
_local6.align = _arg4;
_tf.defaultTextFormat = _local6;
_tf.setTextFormat(_local6);
_shadow = _arg5;
_regen = true;
calcFrame();
return (this);
}
public function set text(_arg1:String):void{
var _local2:String = _tf.text;
_tf.text = _arg1;
if (_tf.text != _local2){
_regen = true;
calcFrame();
};
}
}
}//package org.flixel
Section 152
//FlxTileblock (org.flixel.FlxTileblock)
package org.flixel {
import flash.display.*;
import flash.geom.*;
public class FlxTileblock extends FlxObject {
protected var _bbRect:Rectangle;
protected var _pixels:BitmapData;
protected var _tileSize:uint;
protected var _rects:Array;
protected var _flashRect:Rectangle;
public function FlxTileblock(_arg1:int, _arg2:int, _arg3:uint, _arg4:uint){
x = _arg1;
y = _arg2;
width = _arg3;
height = _arg4;
fixed = true;
_bbRect = new Rectangle(width, height);
refreshHulls();
}
public function loadGraphic(_arg1:Class, _arg2:uint=0):void{
if (_arg1 == null){
return;
};
_pixels = FlxG.addBitmap(_arg1);
_rects = new Array();
_tileSize = _pixels.height;
var _local3:uint = Math.ceil((width / _tileSize));
var _local4:uint = Math.ceil((height / _tileSize));
width = (_local3 * _tileSize);
height = (_local4 * _tileSize);
var _local5:uint = (_local3 * _local4);
var _local6:uint = (_pixels.width / _tileSize);
var _local7:uint;
while (_local7 < _local5) {
if ((FlxU.random() * (_local6 + _arg2)) > _arg2){
_rects.push(new Rectangle((_tileSize * Math.floor((FlxU.random() * _local6))), 0, _tileSize, _tileSize));
} else {
_rects.push(null);
};
_local7++;
};
}
override public function render():void{
renderBlock();
}
protected function renderBlock():void{
var _local4:uint;
getScreenXY(_point);
var _local1:int = _point.x;
var _local2:uint = _rects.length;
_flashPoint.x = _point.x;
_flashPoint.y = _point.y;
var _local3:uint;
while (_local3 < _local2) {
_flashRect = (_rects[_local3] as Rectangle);
if (_flashRect != null){
FlxG.buffer.copyPixels(_pixels, _flashRect, _flashPoint, null, null, true);
};
_flashPoint.x = (_flashPoint.x + _tileSize);
if (_flashPoint.x >= (_local1 + width)){
_flashPoint.x = _local1;
_flashPoint.y = (_flashPoint.y + _tileSize);
};
_local3++;
};
if (FlxG.showBounds){
_local4 = getBoundingColor();
_bbRect.x = _point.x;
_bbRect.y = _point.y;
_bbRect.width = width;
_bbRect.height = 1;
FlxG.buffer.fillRect(_bbRect, _local4);
_bbRect.y = (_bbRect.y + (height - 1));
FlxG.buffer.fillRect(_bbRect, _local4);
_bbRect.y = (_point.y + 1);
_bbRect.width = 1;
_bbRect.height = (height - 2);
FlxG.buffer.fillRect(_bbRect, _local4);
_bbRect.x = (_bbRect.x + (width - 1));
FlxG.buffer.fillRect(_bbRect, _local4);
};
}
}
}//package org.flixel
Section 153
//FlxU (org.flixel.FlxU)
package org.flixel {
import flash.utils.*;
import flash.net.*;
public class FlxU {
protected static var _originalSeed:Number;
public static var quadTree:FlxQuadTree;
protected static var _seed:Number;
static var roundingError:Number = 1E-7;
public static var quadTreeBounds:FlxRect;
public static var quadTreeDivisions:uint = 3;
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 mutate(_arg1:Number, _arg2:Number):Number{
_arg1 = (_arg1 + _arg2);
if (_arg1 > 1){
_arg1 = (_arg1 - int(_arg1));
};
return (_arg1);
}
public static function overlap(_arg1:FlxObject, _arg2:FlxObject, _arg3:Function=null):Boolean{
if ((((((((_arg1 == null)) || (!(_arg1.exists)))) || ((_arg2 == null)))) || (!(_arg2.exists)))){
return (false);
};
quadTree = new FlxQuadTree(quadTreeBounds.x, quadTreeBounds.y, quadTreeBounds.width, quadTreeBounds.height);
quadTree.add(_arg1, FlxQuadTree.A_LIST);
if (_arg1 === _arg2){
return (quadTree.overlap(false, _arg3));
};
quadTree.add(_arg2, FlxQuadTree.B_LIST);
return (quadTree.overlap(true, _arg3));
}
public static function openURL(_arg1:String):void{
navigateToURL(new URLRequest(_arg1), "_blank");
}
public static function endProfile(_arg1:uint, _arg2:String="Profiler", _arg3:Boolean=true):uint{
var _local4:uint = getTimer();
if (_arg3){
FlxG.log((((_arg2 + ": ") + ((_local4 - _arg1) / 1000)) + "s"));
};
return (_local4);
}
public static function getClass(_arg1:String):Class{
return ((getDefinitionByName(_arg1) as Class));
}
public static function floor(_arg1:Number):Number{
var _local2:Number = int(_arg1);
return (((_arg1)>0) ? _local2 : ((_local2)!=_arg1) ? (_local2 - 1) : _local2);
}
public static function solveYCollision(_arg1:FlxObject, _arg2:FlxObject):Boolean{
var _local5:Number;
var _local7:Boolean;
var _local14:uint;
var _local15:uint;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local3:Number = _arg1.colVector.y;
var _local4:Number = _arg2.colVector.y;
if (_local3 == _local4){
return (false);
};
_arg1.preCollide(_arg2);
_arg2.preCollide(_arg1);
var _local6:Boolean;
var _local8 = (_local3 == 0);
var _local9 = (_local3 < 0);
var _local10 = (_local3 > 0);
var _local11 = (_local4 == 0);
var _local12 = (_local4 < 0);
var _local13 = (_local4 > 0);
var _local16:FlxRect = _arg1.colHullY;
var _local17:FlxRect = _arg2.colHullY;
var _local18:Array = _arg1.colOffsets;
var _local19:Array = _arg2.colOffsets;
var _local20:uint = _local18.length;
var _local21:uint = _local19.length;
_local7 = ((((((((((_local8) && (_local12))) || (((_local10) && (_local11))))) || (((_local10) && (_local12))))) || (((((_local9) && (_local12))) && ((((_local3)>0) ? _local3 : -(_local3) < ((_local4)>0) ? _local4 : -(_local4))))))) || (((((_local10) && (_local13))) && ((((_local3)>0) ? _local3 : -(_local3) > ((_local4)>0) ? _local4 : -(_local4))))));
if ((_local7) ? ((!(_arg1.collideBottom)) || (!(_arg2.collideTop))) : ((!(_arg1.collideTop)) || (!(_arg2.collideBottom)))){
return (false);
};
_local14 = 0;
while (_local14 < _local20) {
_local22 = _local18[_local14].x;
_local23 = _local18[_local14].y;
_local16.x = (_local16.x + _local22);
_local16.y = (_local16.y + _local23);
_local15 = 0;
while (_local15 < _local21) {
_local24 = _local19[_local15].x;
_local25 = _local19[_local15].y;
_local17.x = (_local17.x + _local24);
_local17.y = (_local17.y + _local25);
if (((((((((_local16.x + _local16.width) < (_local17.x + roundingError))) || (((_local16.x + roundingError) > (_local17.x + _local17.width))))) || (((_local16.y + _local16.height) < (_local17.y + roundingError))))) || (((_local16.y + roundingError) > (_local17.y + _local17.height))))){
_local17.x = (_local17.x - _local24);
_local17.y = (_local17.y - _local25);
} else {
if (_local7){
if (_local9){
_local26 = (_local16.y + _arg1.colHullX.height);
} else {
_local26 = (_local16.y + _local16.height);
};
if (_local12){
_local27 = _local17.y;
} else {
_local27 = ((_local17.y + _local17.height) - _arg2.colHullX.height);
};
} else {
if (_local12){
_local26 = (-(_local17.y) - _arg2.colHullX.height);
} else {
_local26 = (-(_local17.y) - _local17.height);
};
if (_local9){
_local27 = -(_local16.y);
} else {
_local27 = ((-(_local16.y) - _local16.height) + _arg1.colHullX.height);
};
};
_local5 = (_local26 - _local27);
if ((((((_local5 == 0)) || (((!(_arg1.fixed)) && ((((_local5)>0) ? _local5 : -(_local5) > (_local16.height * 0.8))))))) || (((!(_arg2.fixed)) && ((((_local5)>0) ? _local5 : -(_local5) > (_local17.height * 0.8))))))){
_local17.x = (_local17.x - _local24);
_local17.y = (_local17.y - _local25);
} else {
_local6 = true;
_local28 = _arg2.velocity.y;
_local29 = _arg1.velocity.y;
if (((!(_arg1.fixed)) && (_arg2.fixed))){
if (_arg1._group){
_arg1.reset(_arg1.x, (_arg1.y - _local5));
} else {
_arg1.y = (_arg1.y - _local5);
};
} else {
if (((_arg1.fixed) && (!(_arg2.fixed)))){
if (_arg2._group){
_arg2.reset(_arg2.x, (_arg2.y + _local5));
} else {
_arg2.y = (_arg2.y + _local5);
};
} else {
if (((!(_arg1.fixed)) && (!(_arg2.fixed)))){
_local5 = (_local5 / 2);
if (_arg1._group){
_arg1.reset(_arg1.x, (_arg1.y - _local5));
} else {
_arg1.y = (_arg1.y - _local5);
};
if (_arg2._group){
_arg2.reset(_arg2.x, (_arg2.y + _local5));
} else {
_arg2.y = (_arg2.y + _local5);
};
_local28 = (_local28 / 2);
_local29 = (_local29 / 2);
};
};
};
if (_local7){
_arg1.hitBottom(_arg2, _local28);
_arg2.hitTop(_arg1, _local29);
} else {
_arg1.hitTop(_arg2, _local28);
_arg2.hitBottom(_arg1, _local29);
};
if (((!(_arg1.fixed)) && (!((_local5 == 0))))){
if (_local7){
_local16.y = (_local16.y - _local5);
if (((_arg2.fixed) && (_arg2.moves))){
_local28 = _arg2.colVector.x;
_arg1.x = (_arg1.x + _local28);
_local16.x = (_local16.x + _local28);
_arg1.colHullX.x = (_arg1.colHullX.x + _local28);
};
} else {
_local16.y = (_local16.y - _local5);
_local16.height = (_local16.height + _local5);
};
};
if (((!(_arg2.fixed)) && (!((_local5 == 0))))){
if (_local7){
_local17.y = (_local17.y + _local5);
_local17.height = (_local17.height - _local5);
} else {
_local17.height = (_local17.height + _local5);
if (((_arg1.fixed) && (_arg1.moves))){
_local29 = _arg1.colVector.x;
_arg2.x = (_arg2.x + _local29);
_local17.x = (_local17.x + _local29);
_arg2.colHullX.x = (_arg2.colHullX.x + _local29);
};
};
};
_local17.x = (_local17.x - _local24);
_local17.y = (_local17.y - _local25);
};
};
_local15++;
};
_local16.x = (_local16.x - _local22);
_local16.y = (_local16.y - _local23);
_local14++;
};
return (_local6);
}
public static function ceil(_arg1:Number):Number{
var _local2:Number = int(_arg1);
return (((_arg1)>0) ? ((_local2)!=_arg1) ? (_local2 + 1) : _local2 : _local2);
}
public static function getAngle(_arg1:Number, _arg2:Number):Number{
return (((Math.atan2(_arg2, _arg1) * 180) / Math.PI));
}
public static function setWorldBounds(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5:uint=3):void{
if (quadTreeBounds == null){
quadTreeBounds = new FlxRect();
};
quadTreeBounds.x = _arg1;
quadTreeBounds.y = _arg2;
if (_arg3 > 0){
quadTreeBounds.width = _arg3;
};
if (_arg4 > 0){
quadTreeBounds.height = _arg4;
};
if (_arg5 > 0){
quadTreeDivisions = _arg5;
};
}
public static function startProfile():uint{
return (getTimer());
}
public static function set seed(_arg1:Number):void{
_seed = _arg1;
_originalSeed = _seed;
}
public static function getClassName(_arg1:Object, _arg2:Boolean=false):String{
var _local3:String = getQualifiedClassName(_arg1);
_local3 = _local3.replace("::", ".");
if (_arg2){
_local3 = _local3.substr((_local3.lastIndexOf(".") + 1));
};
return (_local3);
}
public static function randomize(_arg1:Number):Number{
return ((((69621 * int((_arg1 * 2147483647))) % 2147483647) / 2147483647));
}
public static function abs(_arg1:Number):Number{
return (((_arg1)>0) ? _arg1 : -(_arg1));
}
public static function rotatePoint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:FlxPoint=null):FlxPoint{
if (_arg6 == null){
_arg6 = new FlxPoint();
};
var _local7:Number = ((-(_arg5) / 180) * Math.PI);
var _local8:Number = (_arg1 - _arg3);
var _local9:Number = (_arg4 - _arg2);
_arg6.x = ((_arg3 + (Math.cos(_local7) * _local8)) - (Math.sin(_local7) * _local9));
_arg6.y = (_arg4 - ((Math.sin(_local7) * _local8) + (Math.cos(_local7) * _local9)));
return (_arg6);
}
public static function get seed():Number{
return (_originalSeed);
}
public static function solveXCollision(_arg1:FlxObject, _arg2:FlxObject):Boolean{
var _local5:Boolean;
var _local6:Boolean;
var _local7:Number;
var _local9:Boolean;
var _local16:uint;
var _local17:uint;
var _local19:FlxRect;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local3:Number = _arg1.colVector.x;
var _local4:Number = _arg2.colVector.x;
if (_local3 == _local4){
return (false);
};
_arg1.preCollide(_arg2);
_arg2.preCollide(_arg1);
var _local8:Boolean;
var _local10 = (_local3 == 0);
var _local11 = (_local3 < 0);
var _local12 = (_local3 > 0);
var _local13 = (_local4 == 0);
var _local14 = (_local4 < 0);
var _local15 = (_local4 > 0);
var _local18:FlxRect = _arg1.colHullX;
_local19 = _arg2.colHullX;
var _local20:Array = _arg1.colOffsets;
var _local21:Array = _arg2.colOffsets;
var _local22:uint = _local20.length;
var _local23:uint = _local21.length;
_local9 = ((((((((((_local10) && (_local14))) || (((_local12) && (_local13))))) || (((_local12) && (_local14))))) || (((((_local11) && (_local14))) && ((((_local3)>0) ? _local3 : -(_local3) < ((_local4)>0) ? _local4 : -(_local4))))))) || (((((_local12) && (_local15))) && ((((_local3)>0) ? _local3 : -(_local3) > ((_local4)>0) ? _local4 : -(_local4))))));
if ((_local9) ? ((!(_arg1.collideRight)) || (!(_arg2.collideLeft))) : ((!(_arg1.collideLeft)) || (!(_arg2.collideRight)))){
return (false);
};
_local16 = 0;
while (_local16 < _local22) {
_local24 = _local20[_local16].x;
_local25 = _local20[_local16].y;
_local18.x = (_local18.x + _local24);
_local18.y = (_local18.y + _local25);
_local17 = 0;
while (_local17 < _local23) {
_local26 = _local21[_local17].x;
_local27 = _local21[_local17].y;
_local19.x = (_local19.x + _local26);
_local19.y = (_local19.y + _local27);
if (((((((((_local18.x + _local18.width) < (_local19.x + roundingError))) || (((_local18.x + roundingError) > (_local19.x + _local19.width))))) || (((_local18.y + _local18.height) < (_local19.y + roundingError))))) || (((_local18.y + roundingError) > (_local19.y + _local19.height))))){
_local19.x = (_local19.x - _local26);
_local19.y = (_local19.y - _local27);
} else {
if (_local9){
if (_local11){
_local28 = (_local18.x + _arg1.colHullY.width);
} else {
_local28 = (_local18.x + _local18.width);
};
if (_local14){
_local29 = _local19.x;
} else {
_local29 = ((_local19.x + _local19.width) - _arg2.colHullY.width);
};
} else {
if (_local14){
_local28 = (-(_local19.x) - _arg2.colHullY.width);
} else {
_local28 = (-(_local19.x) - _local19.width);
};
if (_local11){
_local29 = -(_local18.x);
} else {
_local29 = ((-(_local18.x) - _local18.width) + _arg1.colHullY.width);
};
};
_local7 = (_local28 - _local29);
if ((((((_local7 == 0)) || (((!(_arg1.fixed)) && ((((_local7)>0) ? _local7 : -(_local7) > (_local18.width * 0.8))))))) || (((!(_arg2.fixed)) && ((((_local7)>0) ? _local7 : -(_local7) > (_local19.width * 0.8))))))){
_local19.x = (_local19.x - _local26);
_local19.y = (_local19.y - _local27);
} else {
_local8 = true;
_local30 = _arg2.velocity.x;
_local31 = _arg1.velocity.x;
if (((!(_arg1.fixed)) && (_arg2.fixed))){
if (_arg1._group){
_arg1.reset((_arg1.x - _local7), _arg1.y);
} else {
_arg1.x = (_arg1.x - _local7);
};
} else {
if (((_arg1.fixed) && (!(_arg2.fixed)))){
if (_arg2._group){
_arg2.reset((_arg2.x + _local7), _arg2.y);
} else {
_arg2.x = (_arg2.x + _local7);
};
} else {
if (((!(_arg1.fixed)) && (!(_arg2.fixed)))){
_local7 = (_local7 / 2);
if (_arg1._group){
_arg1.reset((_arg1.x - _local7), _arg1.y);
} else {
_arg1.x = (_arg1.x - _local7);
};
if (_arg2._group){
_arg2.reset((_arg2.x + _local7), _arg2.y);
} else {
_arg2.x = (_arg2.x + _local7);
};
_local30 = (_local30 / 2);
_local31 = (_local31 / 2);
};
};
};
if (_local9){
_arg1.hitRight(_arg2, _local30);
_arg2.hitLeft(_arg1, _local31);
} else {
_arg1.hitLeft(_arg2, _local30);
_arg2.hitRight(_arg1, _local31);
};
if (((!(_arg1.fixed)) && (!((_local7 == 0))))){
if (_local9){
_local18.width = (_local18.width - _local7);
} else {
_local18.x = (_local18.x - _local7);
_local18.width = (_local18.width + _local7);
};
_arg1.colHullY.x = (_arg1.colHullY.x - _local7);
};
if (((!(_arg2.fixed)) && (!((_local7 == 0))))){
if (_local9){
_local19.x = (_local19.x + _local7);
_local19.width = (_local19.width - _local7);
} else {
_local19.width = (_local19.width + _local7);
};
_arg2.colHullY.x = (_arg2.colHullY.x + _local7);
};
_local19.x = (_local19.x - _local26);
_local19.y = (_local19.y - _local27);
};
};
_local17++;
};
_local18.x = (_local18.x - _local24);
_local18.y = (_local18.y - _local25);
_local16++;
};
return (_local8);
}
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 collide(_arg1:FlxObject, _arg2:FlxObject):Boolean{
if ((((((((_arg1 == null)) || (!(_arg1.exists)))) || ((_arg2 == null)))) || (!(_arg2.exists)))){
return (false);
};
quadTree = new FlxQuadTree(quadTreeBounds.x, quadTreeBounds.y, quadTreeBounds.width, quadTreeBounds.height);
quadTree.add(_arg1, FlxQuadTree.A_LIST);
var _local3 = (_arg1 === _arg2);
if (!_local3){
quadTree.add(_arg2, FlxQuadTree.B_LIST);
};
var _local4:Boolean = quadTree.overlap(!(_local3), solveXCollision);
var _local5:Boolean = quadTree.overlap(!(_local3), solveYCollision);
return (((_local4) || (_local5)));
}
}
}//package org.flixel
Section 154
//Encode (SWFStats.Encode)
package SWFStats {
import flash.utils.*;
import flash.display.*;
public class Encode {
private static const BASE64_CHARS:String = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
private static var crcTableComputed:Boolean = false;
private static var hex_chr:String = "0123456789abcdef";
private static var crcTable:Array;
private static function ff(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (cmn(bitOR(bitAND(_arg2, _arg3), bitAND(~(_arg2), _arg4)), _arg1, _arg2, _arg5, _arg6, _arg7));
}
private static function hh(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (cmn(bitXOR(bitXOR(_arg2, _arg3), _arg4), _arg1, _arg2, _arg5, _arg6, _arg7));
}
private static function cmn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):Number{
return (addme(rol(addme(addme(_arg2, _arg1), addme(_arg4, _arg6)), _arg5), _arg3));
}
private static function gg(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (cmn(bitOR(bitAND(_arg2, _arg4), bitAND(_arg3, ~(_arg4))), _arg1, _arg2, _arg5, _arg6, _arg7));
}
private static function bitAND(_arg1:Number, _arg2:Number):Number{
var _local3:Number = ((_arg1 & 1) & (_arg2 & 1));
var _local4:Number = ((_arg1 >>> 1) & (_arg2 >>> 1));
return (((_local4 << 1) | _local3));
}
private static function writeChunk(_arg1:ByteArray, _arg2:uint, _arg3:ByteArray):void{
var _local8:uint;
var _local9:uint;
var _local10:uint;
if (!crcTableComputed){
crcTableComputed = true;
crcTable = [];
_local9 = 0;
while (_local9 < 0x0100) {
_local8 = _local9;
_local10 = 0;
while (_local10 < 8) {
if ((_local8 & 1)){
_local8 = uint((uint(3988292384) ^ uint((_local8 >>> 1))));
} else {
_local8 = uint((_local8 >>> 1));
};
_local10++;
};
crcTable[_local9] = _local8;
_local9++;
};
};
var _local4:uint;
if (_arg3 != null){
_local4 = _arg3.length;
};
_arg1.writeUnsignedInt(_local4);
var _local5:uint = _arg1.position;
_arg1.writeUnsignedInt(_arg2);
if (_arg3 != null){
_arg1.writeBytes(_arg3);
};
var _local6:uint = _arg1.position;
_arg1.position = _local5;
_local8 = 4294967295;
var _local7:int;
while (_local7 < (_local6 - _local5)) {
_local8 = uint((crcTable[((_local8 ^ _arg1.readUnsignedByte()) & uint(0xFF))] ^ uint((_local8 >>> 8))));
_local7++;
};
_local8 = uint((_local8 ^ uint(4294967295)));
_arg1.position = _local6;
_arg1.writeUnsignedInt(_local8);
}
public static function Base64(_arg1:ByteArray):String{
var _local3:Array;
var _local5:uint;
var _local6:uint;
var _local7:uint;
var _local2 = "";
var _local4:Array = new Array(4);
_arg1.position = 0;
while (_arg1.bytesAvailable > 0) {
_local3 = new Array();
_local5 = 0;
while ((((_local5 < 3)) && ((_arg1.bytesAvailable > 0)))) {
_local3[_local5] = _arg1.readUnsignedByte();
_local5++;
};
_local4[0] = ((_local3[0] & 252) >> 2);
_local4[1] = (((_local3[0] & 3) << 4) | (_local3[1] >> 4));
_local4[2] = (((_local3[1] & 15) << 2) | (_local3[2] >> 6));
_local4[3] = (_local3[2] & 63);
_local6 = _local3.length;
while (_local6 < 3) {
_local4[(_local6 + 1)] = 64;
_local6++;
};
_local7 = 0;
while (_local7 < _local4.length) {
_local2 = (_local2 + BASE64_CHARS.charAt(_local4[_local7]));
_local7++;
};
};
return (_local2);
}
public static function PNG(_arg1:BitmapData):ByteArray{
var _local5:uint;
var _local6:int;
var _local2:ByteArray = new ByteArray();
_local2.writeUnsignedInt(2303741511);
_local2.writeUnsignedInt(218765834);
var _local3:ByteArray = new ByteArray();
_local3.writeInt(_arg1.width);
_local3.writeInt(_arg1.height);
_local3.writeUnsignedInt(134610944);
_local3.writeByte(0);
writeChunk(_local2, 1229472850, _local3);
var _local4:ByteArray = new ByteArray();
var _local7:int;
while (_local7 < _arg1.height) {
_local4.writeByte(0);
if (!_arg1.transparent){
_local6 = 0;
while (_local6 < _arg1.width) {
_local5 = _arg1.getPixel(_local6, _local7);
_local4.writeUnsignedInt(uint((((_local5 & 0xFFFFFF) << 8) | 0xFF)));
_local6++;
};
} else {
_local6 = 0;
while (_local6 < _arg1.width) {
_local5 = _arg1.getPixel32(_local6, _local7);
_local4.writeUnsignedInt(uint((((_local5 & 0xFFFFFF) << 8) | (_local5 >>> 24))));
_local6++;
};
};
_local7++;
};
_local4.compress();
writeChunk(_local2, 1229209940, _local4);
writeChunk(_local2, 1229278788, null);
return (_local2);
}
private static function ii(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (cmn(bitXOR(_arg3, bitOR(_arg2, ~(_arg4))), _arg1, _arg2, _arg5, _arg6, _arg7));
}
private static function rol(_arg1:Number, _arg2:Number):Number{
return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2))));
}
private static function bitOR(_arg1:Number, _arg2:Number):Number{
var _local3:Number = ((_arg1 & 1) | (_arg2 & 1));
var _local4:Number = ((_arg1 >>> 1) | (_arg2 >>> 1));
return (((_local4 << 1) | _local3));
}
private static function rhex(_arg1:Number):String{
var _local3:int;
var _local2 = "";
_local3 = 0;
while (_local3 <= 3) {
_local2 = (_local2 + (hex_chr.charAt(((_arg1 >> ((_local3 * 8) + 4)) & 15)) + hex_chr.charAt(((_arg1 >> (_local3 * 8)) & 15))));
_local3++;
};
return (_local2);
}
private static function addme(_arg1:Number, _arg2:Number):Number{
var _local3:Number = ((_arg1 & 0xFFFF) + (_arg2 & 0xFFFF));
var _local4:Number = (((_arg1 >> 16) + (_arg2 >> 16)) + (_local3 >> 16));
return (((_local4 << 16) | (_local3 & 0xFFFF)));
}
private static function bitXOR(_arg1:Number, _arg2:Number):Number{
var _local3:Number = ((_arg1 & 1) ^ (_arg2 & 1));
var _local4:Number = ((_arg1 >>> 1) ^ (_arg2 >>> 1));
return (((_local4 << 1) | _local3));
}
public static function MD5(_arg1:String):String{
var _local7:int;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local2:Array = str2blks_MD5(_arg1);
var _local3:Number = 1732584193;
var _local4:Number = -271733879;
var _local5:Number = -1732584194;
var _local6:Number = 271733878;
_local7 = 0;
while (_local7 < _local2.length) {
_local8 = _local3;
_local9 = _local4;
_local10 = _local5;
_local11 = _local6;
_local3 = ff(_local3, _local4, _local5, _local6, _local2[(_local7 + 0)], 7, -680876936);
_local6 = ff(_local6, _local3, _local4, _local5, _local2[(_local7 + 1)], 12, -389564586);
_local5 = ff(_local5, _local6, _local3, _local4, _local2[(_local7 + 2)], 17, 606105819);
_local4 = ff(_local4, _local5, _local6, _local3, _local2[(_local7 + 3)], 22, -1044525330);
_local3 = ff(_local3, _local4, _local5, _local6, _local2[(_local7 + 4)], 7, -176418897);
_local6 = ff(_local6, _local3, _local4, _local5, _local2[(_local7 + 5)], 12, 1200080426);
_local5 = ff(_local5, _local6, _local3, _local4, _local2[(_local7 + 6)], 17, -1473231341);
_local4 = ff(_local4, _local5, _local6, _local3, _local2[(_local7 + 7)], 22, -45705983);
_local3 = ff(_local3, _local4, _local5, _local6, _local2[(_local7 + 8)], 7, 1770035416);
_local6 = ff(_local6, _local3, _local4, _local5, _local2[(_local7 + 9)], 12, -1958414417);
_local5 = ff(_local5, _local6, _local3, _local4, _local2[(_local7 + 10)], 17, -42063);
_local4 = ff(_local4, _local5, _local6, _local3, _local2[(_local7 + 11)], 22, -1990404162);
_local3 = ff(_local3, _local4, _local5, _local6, _local2[(_local7 + 12)], 7, 1804603682);
_local6 = ff(_local6, _local3, _local4, _local5, _local2[(_local7 + 13)], 12, -40341101);
_local5 = ff(_local5, _local6, _local3, _local4, _local2[(_local7 + 14)], 17, -1502002290);
_local4 = ff(_local4, _local5, _local6, _local3, _local2[(_local7 + 15)], 22, 1236535329);
_local3 = gg(_local3, _local4, _local5, _local6, _local2[(_local7 + 1)], 5, -165796510);
_local6 = gg(_local6, _local3, _local4, _local5, _local2[(_local7 + 6)], 9, -1069501632);
_local5 = gg(_local5, _local6, _local3, _local4, _local2[(_local7 + 11)], 14, 643717713);
_local4 = gg(_local4, _local5, _local6, _local3, _local2[(_local7 + 0)], 20, -373897302);
_local3 = gg(_local3, _local4, _local5, _local6, _local2[(_local7 + 5)], 5, -701558691);
_local6 = gg(_local6, _local3, _local4, _local5, _local2[(_local7 + 10)], 9, 38016083);
_local5 = gg(_local5, _local6, _local3, _local4, _local2[(_local7 + 15)], 14, -660478335);
_local4 = gg(_local4, _local5, _local6, _local3, _local2[(_local7 + 4)], 20, -405537848);
_local3 = gg(_local3, _local4, _local5, _local6, _local2[(_local7 + 9)], 5, 568446438);
_local6 = gg(_local6, _local3, _local4, _local5, _local2[(_local7 + 14)], 9, -1019803690);
_local5 = gg(_local5, _local6, _local3, _local4, _local2[(_local7 + 3)], 14, -187363961);
_local4 = gg(_local4, _local5, _local6, _local3, _local2[(_local7 + 8)], 20, 1163531501);
_local3 = gg(_local3, _local4, _local5, _local6, _local2[(_local7 + 13)], 5, -1444681467);
_local6 = gg(_local6, _local3, _local4, _local5, _local2[(_local7 + 2)], 9, -51403784);
_local5 = gg(_local5, _local6, _local3, _local4, _local2[(_local7 + 7)], 14, 1735328473);
_local4 = gg(_local4, _local5, _local6, _local3, _local2[(_local7 + 12)], 20, -1926607734);
_local3 = hh(_local3, _local4, _local5, _local6, _local2[(_local7 + 5)], 4, -378558);
_local6 = hh(_local6, _local3, _local4, _local5, _local2[(_local7 + 8)], 11, -2022574463);
_local5 = hh(_local5, _local6, _local3, _local4, _local2[(_local7 + 11)], 16, 1839030562);
_local4 = hh(_local4, _local5, _local6, _local3, _local2[(_local7 + 14)], 23, -35309556);
_local3 = hh(_local3, _local4, _local5, _local6, _local2[(_local7 + 1)], 4, -1530992060);
_local6 = hh(_local6, _local3, _local4, _local5, _local2[(_local7 + 4)], 11, 1272893353);
_local5 = hh(_local5, _local6, _local3, _local4, _local2[(_local7 + 7)], 16, -155497632);
_local4 = hh(_local4, _local5, _local6, _local3, _local2[(_local7 + 10)], 23, -1094730640);
_local3 = hh(_local3, _local4, _local5, _local6, _local2[(_local7 + 13)], 4, 681279174);
_local6 = hh(_local6, _local3, _local4, _local5, _local2[(_local7 + 0)], 11, -358537222);
_local5 = hh(_local5, _local6, _local3, _local4, _local2[(_local7 + 3)], 16, -722521979);
_local4 = hh(_local4, _local5, _local6, _local3, _local2[(_local7 + 6)], 23, 76029189);
_local3 = hh(_local3, _local4, _local5, _local6, _local2[(_local7 + 9)], 4, -640364487);
_local6 = hh(_local6, _local3, _local4, _local5, _local2[(_local7 + 12)], 11, -421815835);
_local5 = hh(_local5, _local6, _local3, _local4, _local2[(_local7 + 15)], 16, 530742520);
_local4 = hh(_local4, _local5, _local6, _local3, _local2[(_local7 + 2)], 23, -995338651);
_local3 = ii(_local3, _local4, _local5, _local6, _local2[(_local7 + 0)], 6, -198630844);
_local6 = ii(_local6, _local3, _local4, _local5, _local2[(_local7 + 7)], 10, 1126891415);
_local5 = ii(_local5, _local6, _local3, _local4, _local2[(_local7 + 14)], 15, -1416354905);
_local4 = ii(_local4, _local5, _local6, _local3, _local2[(_local7 + 5)], 21, -57434055);
_local3 = ii(_local3, _local4, _local5, _local6, _local2[(_local7 + 12)], 6, 1700485571);
_local6 = ii(_local6, _local3, _local4, _local5, _local2[(_local7 + 3)], 10, -1894986606);
_local5 = ii(_local5, _local6, _local3, _local4, _local2[(_local7 + 10)], 15, -1051523);
_local4 = ii(_local4, _local5, _local6, _local3, _local2[(_local7 + 1)], 21, -2054922799);
_local3 = ii(_local3, _local4, _local5, _local6, _local2[(_local7 + 8)], 6, 1873313359);
_local6 = ii(_local6, _local3, _local4, _local5, _local2[(_local7 + 15)], 10, -30611744);
_local5 = ii(_local5, _local6, _local3, _local4, _local2[(_local7 + 6)], 15, -1560198380);
_local4 = ii(_local4, _local5, _local6, _local3, _local2[(_local7 + 13)], 21, 1309151649);
_local3 = ii(_local3, _local4, _local5, _local6, _local2[(_local7 + 4)], 6, -145523070);
_local6 = ii(_local6, _local3, _local4, _local5, _local2[(_local7 + 11)], 10, -1120210379);
_local5 = ii(_local5, _local6, _local3, _local4, _local2[(_local7 + 2)], 15, 718787259);
_local4 = ii(_local4, _local5, _local6, _local3, _local2[(_local7 + 9)], 21, -343485551);
_local3 = addme(_local3, _local8);
_local4 = addme(_local4, _local9);
_local5 = addme(_local5, _local10);
_local6 = addme(_local6, _local11);
_local7 = (_local7 + 16);
};
return ((((rhex(_local3) + rhex(_local4)) + rhex(_local5)) + rhex(_local6)));
}
private static function str2blks_MD5(_arg1:String):Array{
var _local4:int;
var _local2:Number = (((_arg1.length + 8) >> 6) + 1);
var _local3:Array = new Array((_local2 * 16));
_local4 = 0;
while (_local4 < (_local2 * 16)) {
_local3[_local4] = 0;
_local4++;
};
_local4 = 0;
while (_local4 < _arg1.length) {
_local3[(_local4 >> 2)] = (_local3[(_local4 >> 2)] | (_arg1.charCodeAt(_local4) << ((((_arg1.length * 8) + _local4) % 4) * 8)));
_local4++;
};
_local3[(_local4 >> 2)] = (_local3[(_local4 >> 2)] | (128 << ((((_arg1.length * 8) + _local4) % 4) * 8)));
var _local5:int = (_arg1.length * 8);
_local3[((_local2 * 16) - 2)] = (_local5 & 0xFF);
_local3[((_local2 * 16) - 2)] = (_local3[((_local2 * 16) - 2)] | (((_local5 >>> 8) & 0xFF) << 8));
_local3[((_local2 * 16) - 2)] = (_local3[((_local2 * 16) - 2)] | (((_local5 >>> 16) & 0xFF) << 16));
_local3[((_local2 * 16) - 2)] = (_local3[((_local2 * 16) - 2)] | (((_local5 >>> 24) & 0xFF) << 24));
return (_local3);
}
}
}//package SWFStats
Section 155
//HighScores (SWFStats.HighScores)
package SWFStats {
import flash.events.*;
import flash.net.*;
public class HighScores {
private static var ScoresCallback:Function;
private static var FacebookScoresCallback:Function;
private static var SubmitCallback:Function;
public static function Scores(_arg1:Boolean, _arg2:String, _arg3:Function, _arg4:String="alltime"):void{
ScoresCallback = _arg3;
var _local5:URLLoader = new URLLoader();
_local5.addEventListener(Event.COMPLETE, ScoresFinished);
_local5.addEventListener(IOErrorEvent.IO_ERROR, ScoresError);
_local5.addEventListener(HTTPStatusEvent.HTTP_STATUS, StatusChange);
_local5.addEventListener(SecurityErrorEvent.SECURITY_ERROR, ScoresError);
_local5.load(new URLRequest(((((((((((("http://utils.swfstats.com/leaderboards/get.aspx?guid=" + Log.GUID) + "&swfid=") + Log.SWFID) + "&table=") + _arg2) + "&mode=") + _arg4) + "&url=") + (((_arg1) || ((Log.SourceUrl == null)))) ? "global" : Log.SourceUrl) + "&") + Math.random())));
}
public static function FacebookScores(_arg1:String, _arg2:Function, _arg3:Array=null, _arg4:String="alltime"):void{
FacebookScoresCallback = _arg2;
var _local5:URLLoader = new URLLoader();
_local5.addEventListener(Event.COMPLETE, FacebookScoresFinished);
_local5.addEventListener(IOErrorEvent.IO_ERROR, FacebookScoresError);
_local5.addEventListener(HTTPStatusEvent.HTTP_STATUS, StatusChange);
_local5.addEventListener(SecurityErrorEvent.SECURITY_ERROR, ScoresError);
_local5.load(new URLRequest(((((((((((("http://utils.swfstats.com/leaderboards/getfb.aspx?guid=" + Log.GUID) + "&swfid=") + Log.SWFID) + "&table=") + _arg1) + "&friendlist=") + ((_arg3)!=null) ? _arg3.join(",") : "") + "&mode=") + _arg4) + "&") + Math.random())));
}
private static function FacebookScoresError(_arg1:Event):void{
FacebookScoresCallback(null);
FacebookScoresCallback = null;
}
private static function StatusChange(... _args):void{
}
private static function SubmitFinished(_arg1:Event):void{
if (SubmitCallback == null){
return;
};
SubmitCallback(((_arg1.target as URLLoader).data == "true"));
SubmitCallback = null;
}
private static function ScoresError(_arg1:Event):void{
ScoresCallback(null);
ScoresCallback = null;
}
private static function SubmitError(_arg1:Event):void{
SubmitCallback(false);
FacebookScoresCallback = null;
}
private static function ScoresFinished(_arg1:Event):void{
ScoresCallback(ProcessScores((_arg1.target as URLLoader)));
ScoresCallback = null;
}
private static function ProcessScores(_arg1:URLLoader):Array{
var _local5:String;
var _local6:int;
var _local7:int;
var _local8:int;
var _local10:XML;
var _local2:XML = XML(_arg1["data"]);
var _local3:XMLList = _local2["entry"];
var _local4:Array = new Array();
var _local9:Date = new Date();
for each (_local10 in _local3) {
_local5 = _local10["sdate"];
_local6 = int(_local5.substring((_local5.lastIndexOf("/") + 1)));
_local7 = int(_local5.substring(0, _local5.indexOf("/")));
_local8 = int(_local5.substring((_local5.indexOf("/") + 1)).substring(0, 2));
_local9.setFullYear(_local6, _local7, _local8);
_local4.push({Name:_local10["name"], Points:_local10["points"], Website:_local10["website"], Rank:(_local4.length + 1), SDate:_local9});
};
return (_local4);
}
private static function FacebookScoresFinished(_arg1:Event):void{
FacebookScoresCallback(ProcessScores((_arg1.target as URLLoader)));
FacebookScoresCallback = null;
}
public static function Submit(_arg1:String, _arg2:int, _arg3:String, _arg4:Function, _arg5:Boolean=false):void{
SubmitCallback = _arg4;
var _local6:URLLoader = new URLLoader();
_local6.addEventListener(Event.COMPLETE, SubmitFinished);
_local6.addEventListener(IOErrorEvent.IO_ERROR, SubmitError);
_local6.addEventListener(HTTPStatusEvent.HTTP_STATUS, StatusChange);
_local6.addEventListener(SecurityErrorEvent.SECURITY_ERROR, ScoresError);
_local6.load(new URLRequest(((((((((((((((((("http://utils.swfstats.com/leaderboards/save.aspx?guid=" + Log.GUID) + "&swfid=") + Log.SWFID) + "&table=") + _arg3) + "&name=") + _arg1) + "&score=") + _arg2) + "&auth=") + Encode.MD5((Log.SourceUrl + _arg2.toString()))) + "&fb=") + (_arg5) ? "1" : "0") + "&url=") + Log.SourceUrl) + "&r=") + Math.random())));
}
}
}//package SWFStats
Section 156
//Log (SWFStats.Log)
package SWFStats {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import flash.external.*;
public final class Log {
private static const PingR:Timer = new Timer(30000);
private static const PingF:Timer = new Timer(60000);
public static var GUID:String = "";
private static var Plays:int = 0;
public static var Enabled:Boolean = false;
private static var Request:LogRequest = new LogRequest();
private static var Pings:int = 0;
public static var Queue:Boolean = true;
public static var SourceUrl:String;
private static var HighestGoal:int = 0;
private static var FirstPing:Boolean = true;
public static var SWFID:int = 0;
private static function SaveCookie(_arg1:String, _arg2:int):void{
var _local3:SharedObject = SharedObject.getLocal("swfstats");
_local3.data[_arg1] = _arg2.toString();
_local3.flush();
}
public static function View(_arg1:int=0, _arg2:String="", _arg3:String=""):void{
if (SWFID > 0){
return;
};
SWFID = _arg1;
GUID = _arg2;
Enabled = true;
if ((((SWFID == 0)) || ((GUID == "")))){
Enabled = false;
return;
};
if (((((!((_arg3.indexOf("http://") == 0))) && (!((Security.sandboxType == "localWithNetwork"))))) && (!((Security.sandboxType == "localTrusted"))))){
Enabled = false;
return;
};
SourceUrl = GetUrl(_arg3);
if ((((SourceUrl == null)) || ((SourceUrl == "")))){
Enabled = false;
return;
};
Security.allowDomain("http://tracker.swfstats.com/");
Security.allowInsecureDomain("http://tracker.swfstats.com/");
Security.loadPolicyFile("http://tracker.swfstats.com/crossdomain.xml");
Security.allowDomain("http://utils.swfstats.com/");
Security.allowInsecureDomain("http://utils.swfstats.com/");
Security.loadPolicyFile("http://utils.swfstats.com/crossdomain.xml");
var _local4:int = GetCookie("views");
_local4++;
SaveCookie("views", _local4);
Send(("v/" + _local4), true);
PingF.addEventListener(TimerEvent.TIMER, PingServer);
PingF.start();
}
public static function LevelCounterMetric(_arg1:String, _arg2):void{
if (!Enabled){
return;
};
Send(((("lc/" + Clean(_arg1)) + "/") + Clean(_arg2)));
}
private static function Clean(_arg1:String):String{
return (escape(_arg1.replace("/", "\\").replace("~", "-")));
}
public static function Play():void{
if (!Enabled){
return;
};
Plays++;
Send(("p/" + Plays));
}
private static function Send(_arg1:String, _arg2:Boolean=false):void{
Request.Queue(_arg1);
if (((((Request.Ready) || (_arg2))) || (!(Queue)))){
Request.Send();
Request = new LogRequest();
};
}
private static function GetUrl(_arg1:String):String{
var url:String;
var defaulturl = _arg1;
if (ExternalInterface.available){
try {
url = String(ExternalInterface.call("window.location.href.toString"));
} catch(s:Error) {
url = defaulturl;
};
} else {
if (defaulturl.indexOf("http://") == 0){
url = defaulturl;
};
};
if ((((((url == null)) || ((url == "")))) || ((url == "null")))){
if ((((Security.sandboxType == "localWithNetwork")) || ((Security.sandboxType == "localTrusted")))){
url = "http://local-testing/";
} else {
url = null;
};
};
return (escape(url));
}
public static function LevelRangedMetric(_arg1:String, _arg2, _arg3:int):void{
if (!Enabled){
return;
};
Send(((((("lr/" + Clean(_arg1)) + "/") + Clean(_arg2)) + "/") + _arg3));
}
private static function GetCookie(_arg1:String):int{
var _local2:SharedObject = SharedObject.getLocal("swfstats");
if (_local2.data[_arg1] == undefined){
return (0);
};
return (int(_local2.data[_arg1]));
}
public static function Goal(_arg1:int, _arg2:String):void{
}
private static function PingServer(... _args):void{
if (!Enabled){
return;
};
Pings++;
Send(((("t/" + (FirstPing) ? "y" : "n") + "/") + Pings), true);
if (FirstPing){
PingF.stop();
PingR.addEventListener(TimerEvent.TIMER, PingServer);
PingR.start();
FirstPing = false;
};
}
public static function LevelAverageMetric(_arg1:String, _arg2, _arg3:int):void{
if (!Enabled){
return;
};
Send(((((("la/" + Clean(_arg1)) + "/") + Clean(_arg2)) + "/") + _arg3));
}
public static function CustomMetric(_arg1:String, _arg2:String=null):void{
if (!Enabled){
return;
};
if (_arg2 == null){
_arg2 = "";
};
Send(((("c/" + Clean(_arg1)) + "/") + Clean(_arg2)));
}
}
}//package SWFStats
Section 157
//LogRequest (SWFStats.LogRequest)
package SWFStats {
import flash.events.*;
import flash.net.*;
public final class LogRequest {
private var Data:String;// = ""
public var Ready:Boolean;// = false
private var Pieces:int;
private static var Failed:int = 0;
private function IOErrorHandler(_arg1:IOErrorEvent):void{
Failed++;
}
public function Queue(_arg1:String):void{
if (Failed > 3){
return;
};
this.Pieces++;
this.Data = (this.Data + (((this.Data == "")) ? "" : "~" + _arg1));
if ((((this.Pieces == 8)) || ((this.Data.length > 300)))){
this.Ready = true;
};
}
private function SecurityErrorHandler(_arg1:SecurityErrorEvent):void{
}
private function StatusChange(_arg1:HTTPStatusEvent):void{
}
public function Send():void{
var _local1:URLLoader = new URLLoader();
_local1.addEventListener(IOErrorEvent.IO_ERROR, this.IOErrorHandler);
_local1.addEventListener(HTTPStatusEvent.HTTP_STATUS, this.StatusChange);
_local1.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.SecurityErrorHandler);
_local1.load(new URLRequest((((((((((("http://tracker.swfstats.com/Games/q.aspx?guid=" + Log.GUID) + "&swfid=") + Log.SWFID) + "&q=") + this.Data) + "&url=") + Log.SourceUrl) + "&") + Math.random()) + "z")));
trace((((((((((("http://tracker.swfstats.com/Games/q.aspx?guid=" + Log.GUID) + "&swfid=") + Log.SWFID) + "&q=") + this.Data) + "&url=") + Log.SourceUrl) + "&") + Math.random()) + "z"));
}
}
}//package SWFStats
Section 158
//Blocks (Blocks)
package {
import org.flixel.*;
import halfbot.game.system.*;
import halfbot.game.gameScreen.*;
public class Blocks extends FlxGame {
public function Blocks(){
HB_GameData.GAME_RES = new HB_GameResources();
super(HB.SCREEN_WIDTH, HB.SCREEN_HEIGHT, titleScreen, 1);
pause = new blockPause();
}
}
}//package
Section 159
//GBPreloader (GBPreloader)
package {
import flash.events.*;
import flash.display.*;
import org.flixel.*;
import flash.utils.*;
import flash.text.*;
import CPMStar.*;
import SWFStats.*;
import halfbot.game.system.*;
import flash.net.*;
public class GBPreloader extends FlxPreloader {
private var bg:Class;
var failed1:Boolean;// = false
public var calledNextView:Boolean;// = false
public var mc:MovieClip;// = null
var failed2:Boolean;// = false
private var Swf:Class;
public var ad:AdLoader;
public var myURL2:String;// = "http://www.gamesbutler.com"
protected var m_swf:MovieClip;// = null
public var alreadyShowedFailed:Boolean;// = false
public var l:Loader;
public var mainClass:Class;// = null
public function GBPreloader():void{
var re:RegExp;
Swf = GBPreloader_Swf;
bg = GBPreloader_bg;
super();
className = "Blocks";
Log.View(992, "531f34829002", root.loaderInfo.loaderURL);
if (HB.KONG){
myURL = "kongregate.com";
myURL2 = "kongregate.com";
} else {
if (HB.IS_GENERIC){
myURL = "http://www.halfbot.com";
myURL2 = "http://www.halfbot.com";
} else {
if (HB.IS_GAME_BUTLER){
myURL = "http://www.gamesbutler.com";
myURL2 = "http://www.gamesbutler.com";
};
};
};
stop();
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
try {
throw (new Error("Setting global debug flag..."));
} catch(e:Error) {
re = /\[.*:[0-9]+\]/;
HB.DEBUG = re.test(e.getStackTrace());
};
if (((((!(HB.DEBUG)) && (!((myURL == null))))) && ((root.loaderInfo.url.indexOf(myURL) < 0)))){
failed1 = false;
};
if (((((!(HB.DEBUG)) && (!((myURL2 == null))))) && ((root.loaderInfo.url.indexOf(myURL2) < 0)))){
failed2 = false;
};
if (((failed1) && (failed2))){
} else {
_init = false;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
};
}
override protected function update(_arg1:Number):void{
}
private function goToMyURL(_arg1:MouseEvent=null):void{
if (HB.IS_GAME_BUTLER){
navigateToURL(new URLRequest("http://www.gamesbutler.com"));
} else {
navigateToURL(new URLRequest(myURL));
};
}
override protected function onEnterFrame(_arg1:Event):void{
var _local2:int;
var _local4:Number;
var _local5:Object;
var _local6:Bitmap;
var _local7:TextFormat;
var _local8:TextField;
if (!_init){
if ((((stage.stageWidth <= 0)) || ((stage.stageHeight <= 0)))){
return;
};
create();
_init = true;
};
graphics.clear();
var _local3:uint = getTimer();
if ((((((((((framesLoaded >= totalFrames)) && ((_local3 > _min)))) && (mc))) && ((mc.currentFrame >= 24)))) && (!(mainClass)))){
nextFrame();
mainClass = Class(getDefinitionByName(className));
if ((((mc.currentFrame >= 24)) && ((mc.currentFrame < 25)))){
mc.gotoAndPlay(25);
};
} else {
if (!mainClass){
_local4 = (root.loaderInfo.bytesLoaded / root.loaderInfo.bytesTotal);
if ((((_min > 0)) && ((_local4 > (_local3 / _min))))){
_local4 = (_local3 / _min);
};
update(_local4);
} else {
if (((((mainClass) && (!(failed1)))) && (!(failed2)))){
if ((((mc.currentFrame >= 200)) && (!(calledNextView)))){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
_local5 = new mainClass();
addChild((_local5 as DisplayObject));
removeChild(_buffer);
calledNextView = true;
};
} else {
if (((((((failed1) && (failed2))) && (!(alreadyShowedFailed)))) && ((mc.currentFrame >= 200)))){
alreadyShowedFailed = true;
Log.CustomMetric("Attempt To Play Off Site");
_local6 = new Bitmap(new BitmapData(stage.stageWidth, stage.stageHeight, true, 4294967295));
addChild(_local6);
_local7 = new TextFormat();
_local7.color = 0;
_local7.size = 16;
_local7.align = "center";
_local7.bold = true;
_local7.font = "system";
_local8 = new TextField();
_local8.width = (_local6.width - 16);
_local8.height = (_local6.height - 16);
_local8.y = 8;
_local8.multiline = true;
_local8.wordWrap = true;
_local8.embedFonts = true;
_local8.defaultTextFormat = _local7;
if (HB.IS_GENERIC){
_local8.text = (("It looks like somebody copied this game without HalfBot's permission. Just click anywhere, or copy-paste this URL into your browser.\n\n" + HB.COMPANY_URL) + "\n\nto play the game at our site. Thanks, and have fun!");
} else {
if (HB.IS_GAME_BUTLER){
_local8.text = (("It looks like somebody copied this game without GamesButler's permission. Just click anywhere, or copy-paste this URL into your browser.\n\n" + "http://www.gamesbutler.com") + "\n\nto play the game at our site. Thanks, and have fun!");
_local8.text = ((_local8.text + " error: ") + root.loaderInfo.url);
};
};
addChild(_local8);
_local8.addEventListener(MouseEvent.CLICK, goToMyURL);
_local6.addEventListener(MouseEvent.CLICK, goToMyURL);
};
};
};
};
}
private function onComplete(_arg1:Event):void{
l = (m_swf.getChildAt(0) as Loader);
mc = (l.content as MovieClip);
mc.gotoAndPlay(0);
}
override protected function create():void{
var _local1:Bitmap = new bg();
m_swf = new Swf();
m_swf.x = 0;
if (HB.CPM_ENABLED){
m_swf.y = -135;
} else {
m_swf.y = 0;
};
_min = 0;
if (!FlxG.debug){
_min = (minDisplayTime * 1000);
};
_buffer = new Sprite();
_buffer.scaleX = 1;
_buffer.scaleY = 1;
addChild(_buffer);
_width = (stage.stageWidth / _buffer.scaleX);
_height = (stage.stageHeight / _buffer.scaleY);
_buffer.addChild(new Bitmap(new BitmapData(_width, _height, false, 0)));
_buffer.addChild(_local1);
m_swf.addEventListener(Event.COMPLETE, onComplete);
var _local2 = "3174Q0BF8C32B";
if (HB.CPM_ENABLED){
ad = new AdLoader(_local2);
ad.x = ((320 / 2) - 150);
ad.y = 200;
_buffer.addChild(ad);
};
_buffer.addChild(m_swf);
}
}
}//package
Section 160
//GBPreloader_bg (GBPreloader_bg)
package {
import mx.core.*;
public class GBPreloader_bg extends BitmapAsset {
}
}//package
Section 161
//GBPreloader_Swf (GBPreloader_Swf)
package {
import mx.core.*;
import flash.utils.*;
public class GBPreloader_Swf extends MovieClipLoaderAsset {
public var dataClass:Class;
private static var bytes:ByteArray = null;
public function GBPreloader_Swf(){
dataClass = GBPreloader_Swf_dataClass;
super();
initialWidth = (0x1900 / 20);
initialHeight = (9600 / 20);
}
override public function get movieClipData():ByteArray{
if (bytes == null){
bytes = ByteArray(new dataClass());
};
return (bytes);
}
}
}//package
Section 162
//GBPreloader_Swf_dataClass (GBPreloader_Swf_dataClass)
package {
import mx.core.*;
public class GBPreloader_Swf_dataClass extends ByteArrayAsset {
}
}//package