Section 1
//bblogo_4 (bubblebox_submit_score_fla.bblogo_4)
package bubblebox_submit_score_fla {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.geom.*;
import flash.utils.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
public dynamic class bblogo_4 extends MovieClip {
public function bblogo_4(){
addFrameScript(0, frame1);
}
function frame1(){
this.addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent){
navigateToURL(new URLRequest("http://www.bubblebox.com/"), "_blank");
});
}
}
}//package bubblebox_submit_score_fla
Section 2
//bubblebox_saving_5 (bubblebox_submit_score_fla.bubblebox_saving_5)
package bubblebox_submit_score_fla {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.geom.*;
import flash.utils.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
public dynamic class bubblebox_saving_5 extends MovieClip {
public function bubblebox_saving_5(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package bubblebox_submit_score_fla
Section 3
//bubblebox_send_btn_2 (bubblebox_submit_score_fla.bubblebox_send_btn_2)
package bubblebox_submit_score_fla {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.geom.*;
import flash.utils.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
public dynamic class bubblebox_send_btn_2 extends MovieClip {
public function bubblebox_send_btn_2(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
this.mouseChildren = false;
this.useHandCursor = true;
this.buttonMode = true;
this.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1:MouseEvent){
_arg1.currentTarget.gotoAndStop(2);
});
this.addEventListener(MouseEvent.MOUSE_OUT, function (_arg1:MouseEvent){
_arg1.currentTarget.gotoAndStop(1);
});
}
}
}//package bubblebox_submit_score_fla
Section 4
//bubblebox_try_again_10 (bubblebox_submit_score_fla.bubblebox_try_again_10)
package bubblebox_submit_score_fla {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.geom.*;
import flash.utils.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
public dynamic class bubblebox_try_again_10 extends MovieClip {
public function bubblebox_try_again_10(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
this.mouseChildren = false;
this.useHandCursor = true;
this.buttonMode = true;
this.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1:MouseEvent){
_arg1.currentTarget.gotoAndStop(2);
});
this.addEventListener(MouseEvent.MOUSE_OUT, function (_arg1:MouseEvent){
_arg1.currentTarget.gotoAndStop(1);
});
}
}
}//package bubblebox_submit_score_fla
Section 5
//bubblebox_view_scores_8 (bubblebox_submit_score_fla.bubblebox_view_scores_8)
package bubblebox_submit_score_fla {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.geom.*;
import flash.utils.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
public dynamic class bubblebox_view_scores_8 extends MovieClip {
public function bubblebox_view_scores_8(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
this.mouseChildren = false;
this.useHandCursor = true;
this.buttonMode = true;
this.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1:MouseEvent){
_arg1.currentTarget.gotoAndStop(2);
});
this.addEventListener(MouseEvent.MOUSE_OUT, function (_arg1:MouseEvent){
_arg1.currentTarget.gotoAndStop(1);
});
}
}
}//package bubblebox_submit_score_fla
Section 6
//AdLoader (CPMStar.AdLoader)
package CPMStar {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.system.*;
public class AdLoader extends Sprite {
private var contentspotid:String;
private var cpmstarLoader:Loader;
public function AdLoader(_arg1:String){
this.contentspotid = _arg1;
addEventListener(Event.ADDED, addedHandler);
}
private function addedHandler(_arg1:Event):void{
var _local2:String;
var _local3:DisplayObjectContainer;
removeEventListener(Event.ADDED, addedHandler);
Security.allowDomain("server.cpmstar.com");
_local2 = "http://server.cpmstar.com/adviewas3.swf";
_local3 = 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);
}
private function dispatchHandler(_arg1:Event):void{
dispatchEvent(_arg1);
}
}
}//package CPMStar
Section 7
//g2dAnimation (g2d.g2dAnimation)
package g2d {
public class g2dAnimation {
protected var _delay:Number;
protected var _startFrame:int;
protected var _endFrame:int;
protected var _nextAnimation:String;
public function g2dAnimation(_arg1:int, _arg2:int, _arg3:String, _arg4:Number){
_startFrame = _arg1;
_endFrame = _arg2;
_nextAnimation = _arg3;
_delay = (1 / _arg4);
}
public function get delay():Number{
return (_delay);
}
public function get nextAnimation():String{
return (_nextAnimation);
}
public function get endFrame():int{
return (_endFrame);
}
public function get startFrame():int{
return (_startFrame);
}
}
}//package g2d
Section 8
//g2dCamera (g2d.g2dCamera)
package g2d {
public final class g2dCamera {
protected static var _max:g2dVector2 = new g2dVector2(0, 0);
protected static var _position:g2dVector2 = new g2dVector2(0, 0);
protected static var _target:g2dVector2 = new g2dVector2(0, 0);
protected static var _easing:Number = 0;
protected static var _min:g2dVector2 = new g2dVector2(0, 0);
public function update():void{
if (easing != 0){
_position.x = (_position.x + ((_target.x - _position.x) * (_easing * g2dTime.deltaTime)));
_position.y = (_position.y + ((_target.y - _position.y) * (_easing * g2dTime.deltaTime)));
} else {
_position.x = _target.x;
_position.y = _target.y;
};
if (_position.x < _min.x){
_position.x = _min.x;
};
if (_position.y < _min.y){
_position.y = _min.y;
};
if (_position.x > _max.x){
_position.x = _max.x;
};
if (_position.y > _max.y){
_position.y = _max.y;
};
}
public static function get max():g2dVector2{
return (_max);
}
public static function get position():g2dVector2{
return (_position);
}
public static function get easing():Number{
return (_easing);
}
public static function set max(_arg1:g2dVector2){
_max = _arg1;
}
public static function get min():g2dVector2{
return (_min);
}
public static function set easing(_arg1:Number){
_easing = _arg1;
}
public static function get target():g2dVector2{
return (_target);
}
public static function set target(_arg1:g2dVector2){
_target = _arg1;
}
public static function set min(_arg1:g2dVector2){
_min = _arg1;
}
}
}//package g2d
Section 9
//g2dCanvas (g2d.g2dCanvas)
package g2d {
import flash.display.*;
public class g2dCanvas {
protected var _bitmapData:BitmapData;
public function g2dCanvas(_arg1:int, _arg2:int){
_bitmapData = new BitmapData(_arg1, _arg2, true, 0);
}
public function set bitmapData(_arg1:BitmapData):void{
_bitmapData = _arg1;
}
public function get bitmapData():BitmapData{
return (_bitmapData);
}
}
}//package g2d
Section 10
//g2dEntity (g2d.g2dEntity)
package g2d {
import flash.utils.*;
public class g2dEntity {
protected var _position:g2dVector2;
protected var _scale:Number;// = 1
protected var _angle:Number;// = 0
protected var _alpha:Number;// = 1
protected var _sprite:g2dSprite;
protected var _boundingVolumes:Array;
protected var _velocity:g2dVector2;
private static var _pools:Dictionary = new Dictionary();
public function g2dEntity(){
_position = new g2dVector2(0, 0);
_velocity = new g2dVector2(0, 0);
_angle = 0;
_alpha = 1;
_scale = 1;
_boundingVolumes = new Array();
super();
}
public function set alpha(_arg1:Number):void{
_alpha = _arg1;
}
public function draw(_arg1:g2dCanvas):void{
if (_sprite != null){
_sprite.draw(_arg1, _position, _angle, alpha, scale);
};
}
public function update():void{
_position.x = (_position.x + (_velocity.x * g2dTime.deltaTime));
_position.y = (_position.y + (_velocity.y * g2dTime.deltaTime));
}
public function get scale():Number{
return (_scale);
}
public function set position(_arg1:g2dVector2):void{
_position = _arg1;
}
public function get angle():Number{
return (_angle);
}
public function get boundingVolumes():Array{
return (_boundingVolumes);
}
public function set scale(_arg1:Number):void{
_scale = _arg1;
}
public function get velocity():g2dVector2{
return (_velocity);
}
public function get alpha():Number{
return (_alpha);
}
public function set angle(_arg1:Number):void{
_angle = _arg1;
}
public function reset():void{
}
public function get position():g2dVector2{
return (_position);
}
public function set velocity(_arg1:g2dVector2):void{
_velocity = _arg1;
}
public static function destroy(_arg1:g2dEntity):void{
var _local2:Class;
var _local3:Array;
_local2 = (getDefinitionByName(getQualifiedClassName(_arg1)) as Class);
_local3 = ((_pools[_local2])!=null) ? _pools[_local2] : _pools[_local2] = new Array();
_local3.push(_arg1);
}
public static function emptyPool():void{
_pools = new Dictionary();
}
public static function create(_arg1:Class):g2dEntity{
var _local2:Array;
var _local3:g2dEntity;
_local2 = ((_pools[_arg1])!=null) ? _pools[_arg1] : _pools[_arg1] = new Array();
if (_local2.length != 0){
_local3 = _local2.pop();
_local3.reset();
return (_local3);
};
return (new (_arg1));
}
}
}//package g2d
Section 11
//g2dFrame (g2d.g2dFrame)
package g2d {
import flash.display.*;
public class g2dFrame {
protected var _offset:g2dVector2;
protected var _bitmapData:BitmapData;
public function g2dFrame(_arg1:BitmapData, _arg2:g2dVector2){
_bitmapData = _arg1;
_offset = _arg2;
}
public function get offset():g2dVector2{
return (_offset);
}
public function get bitmapData():BitmapData{
return (_bitmapData);
}
}
}//package g2d
Section 12
//g2dGame (g2d.g2dGame)
package g2d {
import flash.display.*;
import flash.events.*;
public class g2dGame {
protected var _camera:g2dCamera;
protected var _keyboard:g2dKeyboard;
protected var _mouse:g2dMouse;
protected var _time:g2dTime;
protected var _highscore:Highscore;
protected var _gameStates:Array;
protected var _canvas:g2dCanvas;
protected var _lastBest:Number;// = 0
protected var _bitmap:Bitmap;
public function g2dGame(_arg1:Stage){
_gameStates = new Array();
_highscore = new Highscore();
_lastBest = 0;
super();
_time = new g2dTime();
_camera = new g2dCamera();
_keyboard = new g2dKeyboard(_arg1);
_mouse = new g2dMouse(_arg1);
_canvas = new g2dCanvas(_arg1.stageWidth, _arg1.stageHeight);
_bitmap = new Bitmap(_canvas.bitmapData);
_highscore.x = (700 / 2);
_highscore.y = 340;
_arg1.addChild(_bitmap);
_arg1.addChild(_highscore);
_highscore.visible = false;
_arg1.addEventListener(Event.ENTER_FRAME, update);
}
protected function update(_arg1:Event):void{
var _local2:g2dGameState;
_time.update();
_mouse.update();
for each (_local2 in _gameStates) {
_local2.update();
};
if (_lastBest != SaveData.bestDistance){
_lastBest = SaveData.bestDistance;
_highscore.bubbleBox.setScore(SaveData.bestDistance, 1772);
};
_highscore.visible = SaveData.highscore;
_camera.update();
_canvas.bitmapData.lock();
_canvas.bitmapData.fillRect(_canvas.bitmapData.rect, 4294967295);
for each (_local2 in _gameStates) {
_local2.draw(_canvas);
};
_canvas.bitmapData.unlock();
_keyboard.postDraw();
_mouse.postDraw();
}
public function removeGameState(_arg1:g2dGameState):void{
var _local2:int;
_local2 = _gameStates.indexOf(_arg1);
if (_local2 != -1){
_gameStates.splice(_local2, 1);
};
}
public function addGameState(_arg1:g2dGameState):void{
_gameStates.push(_arg1);
}
}
}//package g2d
Section 13
//g2dGameState (g2d.g2dGameState)
package g2d {
public class g2dGameState {
protected var _game:g2dGame;
public function g2dGameState(_arg1:g2dGame){
_game = _arg1;
}
public function draw(_arg1:g2dCanvas):void{
}
public function update():void{
}
}
}//package g2d
Section 14
//g2dInputState (g2d.g2dInputState)
package g2d {
public class g2dInputState {
public static var DOWN:Number = 1;
public static var UP:Number = 0;
}
}//package g2d
Section 15
//g2dKeyboard (g2d.g2dKeyboard)
package g2d {
import flash.display.*;
import flash.events.*;
public final class g2dKeyboard {
protected static var _keys:Array = new Array(0x0100);
protected static var _previousKeys:Array = new Array(0x0100);
public function g2dKeyboard(_arg1:Stage){
var _local2:int;
super();
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
_arg1.addEventListener(KeyboardEvent.KEY_UP, keyReleased);
_arg1.addEventListener(Event.ACTIVATE, reset);
_arg1.addEventListener(Event.DEACTIVATE, reset);
_local2 = 0;
while (_local2 < 0x0100) {
_keys[_local2] = g2dInputState.UP;
_previousKeys[_local2] = g2dInputState.UP;
_local2++;
};
}
protected function keyPressed(_arg1:KeyboardEvent):void{
_keys[_arg1.keyCode] = g2dInputState.DOWN;
}
public function postDraw():void{
var _local1:int;
_local1 = 0;
while (_local1 < _keys.length) {
_previousKeys[_local1] = _keys[_local1];
_local1++;
};
}
protected function reset(_arg1:Event):void{
var _local2:int;
_local2 = 0;
while (_local2 < 0x0100) {
_keys[_local2] = g2dInputState.UP;
_previousKeys[_local2] = g2dInputState.UP;
_local2++;
};
}
protected function keyReleased(_arg1:KeyboardEvent):void{
_keys[_arg1.keyCode] = g2dInputState.UP;
}
public static function pressed(_arg1:int):Boolean{
return ((((_keys[_arg1] == g2dInputState.DOWN)) && ((_previousKeys[_arg1] == g2dInputState.UP))));
}
public static function down(_arg1:int):Boolean{
return ((_keys[_arg1] == g2dInputState.DOWN));
}
public static function up(_arg1:int):Boolean{
return ((_keys[_arg1] == g2dInputState.UP));
}
public static function released(_arg1:int):Boolean{
return ((((_keys[_arg1] == g2dInputState.UP)) && ((_previousKeys[_arg1] == g2dInputState.DOWN))));
}
}
}//package g2d
Section 16
//g2dKeys (g2d.g2dKeys)
package g2d {
public final class g2dKeys {
public static const Z:uint = 90;
public static const LEFT:uint = 37;
public static const RIGHTBRACKET:uint = 221;
public static const EQUAL:uint = 187;
public static const COMMAND:uint = 19;
public static const CONTROL:uint = 17;
public static const NUMPAD_DECIMAL:uint = 110;
public static const A:uint = 65;
public static const B:uint = 66;
public static const C:uint = 67;
public static const D:uint = 68;
public static const E:uint = 69;
public static const F:uint = 70;
public static const G:uint = 71;
public static const H:uint = 72;
public static const I:uint = 73;
public static const J:uint = 74;
public static const L:uint = 76;
public static const M:uint = 77;
public static const N:uint = 78;
public static const O:uint = 79;
public static const MINUS:uint = 189;
public static const K:uint = 75;
public static const S:uint = 83;
public static const NUMPAD:uint = 21;
public static const NUMPAD_ENTER:uint = 108;
public static const P:uint = 80;
public static const PAGE_DOWN:uint = 34;
public static const ALTERNATE:uint = 18;
public static const T:uint = 84;
public static const BACKSPACE:uint = 8;
public static const PAGE_UP:uint = 33;
public static const X:uint = 88;
public static const Y:uint = 89;
public static const Q:uint = 81;
public static const QUOTE:uint = 222;
public static const SLASH:uint = 191;
public static const U:uint = 85;
public static const W:uint = 87;
public static const SHIFT:uint = 16;
public static const TAB:uint = 9;
public static const R:uint = 82;
public static const ESCAPE:uint = 27;
public static const NUMPAD_ADD:uint = 107;
public static const LEFTBRACKET:uint = 219;
public static const DOWN:uint = 40;
public static const F1:uint = 112;
public static const F3:uint = 114;
public static const F4:uint = 115;
public static const F5:uint = 116;
public static const F6:uint = 117;
public static const F7:uint = 118;
public static const F8:uint = 119;
public static const F2:uint = 113;
public static const COMMA:uint = 188;
public static const ENTER:uint = 13;
public static const INSERT:uint = 45;
public static const DELETE:uint = 46;
public static const NUMBER_1:uint = 49;
public static const NUMBER_2:uint = 50;
public static const NUMBER_3:uint = 51;
public static const NUMBER_5:uint = 53;
public static const NUMBER_6:uint = 54;
public static const NUMBER_0:uint = 48;
public static const END:uint = 35;
public static const NUMBER_9:uint = 57;
public static const NUMPAD_6:uint = 102;
public static const NUMPAD_1:uint = 97;
public static const NUMPAD_2:uint = 98;
public static const NUMBER_7:uint = 55;
public static const CAPS_LOCK:uint = 20;
public static const F9:uint = 120;
public static const NUMBER_4:uint = 52;
public static const NUMBER_8:uint = 56;
public static const BACKQUOTE:uint = 192;
public static const BACKSLASH:uint = 220;
public static const SEMICOLON:uint = 186;
public static const NUMPAD_DIVIDE:uint = 111;
public static const NUMPAD_3:uint = 99;
public static const NUMPAD_4:uint = 100;
public static const NUMPAD_5:uint = 101;
public static const NUMPAD_7:uint = 103;
public static const NUMPAD_8:uint = 104;
public static const HOME:uint = 36;
public static const NUMPAD_0:uint = 96;
public static const PERIOD:uint = 190;
public static const F10:uint = 121;
public static const F11:uint = 122;
public static const F12:uint = 123;
public static const F13:uint = 124;
public static const F14:uint = 125;
public static const F15:uint = 126;
public static const V:uint = 86;
public static const SPACE:uint = 32;
public static const NUMPAD_MULTIPLY:uint = 106;
public static const NUMPAD_SUBTRACT:uint = 109;
public static const NUMPAD_9:uint = 105;
public static const RIGHT:uint = 39;
public static const UP:uint = 38;
}
}//package g2d
Section 17
//g2dMouse (g2d.g2dMouse)
package g2d {
import flash.display.*;
import flash.events.*;
import flash.ui.*;
public final class g2dMouse {
protected static var _position:g2dVector2 = new g2dVector2(0, 0);
protected static var _previousMouseButtonState:Number = g2dInputState.UP;
protected static var _mouseOver:Boolean = false;
protected static var _worldPosition:g2dVector2 = new g2dVector2(0, 0);
protected static var _previousPosition:g2dVector2 = new g2dVector2(0, 0);
protected static var _previousWorldPosition:g2dVector2 = new g2dVector2(0, 0);
protected static var _mouseButtonState:Number = g2dInputState.UP;
protected static var _stage:Stage;
public function g2dMouse(_arg1:Stage){
_arg1.addEventListener(MouseEvent.MOUSE_DOWN, mousePressed);
_arg1.addEventListener(MouseEvent.MOUSE_UP, mouseReleased);
_arg1.addEventListener(MouseEvent.MOUSE_MOVE, mouseMove);
_arg1.addEventListener(Event.MOUSE_LEAVE, mouseLeave);
_arg1.addEventListener(Event.ACTIVATE, reset);
_arg1.addEventListener(Event.DEACTIVATE, reset);
_stage = _arg1;
}
protected function mouseReleased(_arg1:MouseEvent):void{
_mouseButtonState = g2dInputState.UP;
}
public function postDraw():void{
_previousMouseButtonState = _mouseButtonState;
_previousPosition.x = _position.x;
_previousPosition.y = _position.y;
_previousWorldPosition.x = _worldPosition.x;
_previousWorldPosition.y = _worldPosition.y;
}
protected function mouseMove(_arg1:MouseEvent):void{
_mouseOver = true;
}
public function update():void{
_position.x = _stage.mouseX;
_position.y = _stage.mouseY;
_worldPosition.x = (_position.x - g2dCamera.position.x);
_worldPosition.y = (_position.y - g2dCamera.position.y);
}
protected function mouseLeave(_arg1:Event):void{
_mouseOver = false;
}
protected function mousePressed(_arg1:MouseEvent):void{
_mouseButtonState = g2dInputState.DOWN;
}
protected function reset(_arg1:Event):void{
_mouseButtonState = g2dInputState.UP;
}
public static function get previousPosition():g2dVector2{
return (_previousPosition);
}
public static function hide():void{
if (_mouseOver == true){
Mouse.hide();
};
}
public static function show():void{
Mouse.show();
}
public static function up():Boolean{
return ((_mouseButtonState == g2dInputState.UP));
}
public static function get previousWorldPosition():g2dVector2{
return (_previousWorldPosition);
}
public static function get position():g2dVector2{
return (_position);
}
public static function get worldPosition():g2dVector2{
return (_worldPosition);
}
public static function pressed():Boolean{
return ((((_mouseButtonState == g2dInputState.DOWN)) && ((_previousMouseButtonState == g2dInputState.UP))));
}
public static function down():Boolean{
return ((_mouseButtonState == g2dInputState.DOWN));
}
public static function released():Boolean{
return ((((_mouseButtonState == g2dInputState.UP)) && ((_previousMouseButtonState == g2dInputState.DOWN))));
}
}
}//package g2d
Section 18
//g2dSound (g2d.g2dSound)
package g2d {
import flash.media.*;
public class g2dSound {
protected static var _muted:Boolean = false;
public static function unmute(){
var _local1:SoundTransform;
_local1 = new SoundTransform(1, 0);
SoundMixer.soundTransform = _local1;
_muted = false;
}
public static function play(_arg1:Sound, _arg2:Boolean=false):SoundChannel{
return (_arg1.play(0, ((_arg2)==true) ? int.MAX_VALUE : 0));
}
public static function mute(){
var _local1:SoundTransform;
_local1 = new SoundTransform(0, 0);
SoundMixer.soundTransform = _local1;
_muted = true;
}
public static function get muted():Boolean{
return (_muted);
}
public static function stopAll():void{
SoundMixer.stopAll();
}
}
}//package g2d
Section 19
//g2dSprite (g2d.g2dSprite)
package g2d {
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
public class g2dSprite {
protected var _currentAnimationFrameDelay:Number;// = 0
protected var _currentAnimationFrame:int;// = 0
protected var _currentAnimation:g2dAnimation;
protected var _animationChangedCallback:Function;
protected var _name:String;
protected var _currentAnimationName:String;// = "void"
protected static var _colourTransform:ColorTransform = new ColorTransform();
protected static var _frames:Dictionary = new Dictionary();
protected static var _animations:Dictionary = new Dictionary();
public function g2dSprite(_arg1:String, _arg2:String="idle"){
_currentAnimationFrame = 0;
_currentAnimationFrameDelay = 0;
_currentAnimationName = "void";
super();
_name = _arg1;
if (_animations[_arg1] == null){
trace(("* g2d Sprite.g2dSprite() * No sprite exists with the name " + _arg1));
};
setAnimation(_arg2);
}
public function set animationChangedCallback(_arg1:Function):void{
_animationChangedCallback = _arg1;
}
public function draw(_arg1:g2dCanvas, _arg2:g2dVector2, _arg3:Number=0, _arg4:Number=1, _arg5:Number=1):void{
var _local6:g2dFrame;
var _local7:Matrix;
_currentAnimationFrameDelay = (_currentAnimationFrameDelay - g2dTime.deltaTime);
if (_currentAnimationFrameDelay <= 0){
_currentAnimationFrame++;
if (_currentAnimationFrame > _currentAnimation.endFrame){
setAnimation(_currentAnimation.nextAnimation, true);
} else {
_currentAnimationFrameDelay = _animations[_name][_currentAnimationName].delay;
};
};
_local6 = _frames[_name][_currentAnimationFrame];
if ((((((_arg3 == 0)) && ((_arg4 == 1)))) && ((_arg5 == 1)))){
g2dUtility.point.x = ((_arg2.x + _local6.offset.x) - g2dCamera.position.x);
g2dUtility.point.y = ((_arg2.y + _local6.offset.y) - g2dCamera.position.y);
_arg1.bitmapData.copyPixels(_local6.bitmapData, _local6.bitmapData.rect, g2dUtility.point, null, null, true);
} else {
g2dUtility.point.x = 0;
g2dUtility.point.y = 0;
_local7 = g2dUtility.matrix;
_local7.identity();
_local7.translate(_local6.offset.x, _local6.offset.y);
_local7.scale(_arg5, _arg5);
_local7.rotate(((Math.PI * 2) * (_arg3 / 360)));
_local7.translate((_arg2.x - g2dCamera.position.x), (_arg2.y - g2dCamera.position.y));
_colourTransform.alphaMultiplier = _arg4;
_arg1.bitmapData.draw(_local6.bitmapData, _local7, _colourTransform, null, null, true);
};
}
public function setAnimation(_arg1:String, _arg2:Boolean=false):void{
var _local3:g2dAnimation;
var _local4:String;
_local3 = _animations[_name][_arg1];
if (_local3 != null){
if (((!((_arg1 == _currentAnimationName))) || ((_arg2 == true)))){
_local4 = _currentAnimationName;
_currentAnimation = _local3;
_currentAnimationFrame = _currentAnimation.startFrame;
_currentAnimationFrameDelay = _currentAnimation.delay;
_currentAnimationName = _arg1;
if (_animationChangedCallback != null){
_animationChangedCallback(_local4, _arg1);
};
};
} else {
trace(((("* g2d Sprite.setAnimation() * Animation doesn't exist: " + _arg1) + " in sprite ") + _name));
};
}
public function get currentFrame():g2dFrame{
return (_frames[_name][_currentAnimationFrame]);
}
public static function parseMovieClip(_arg1:MovieClip, _arg2:Boolean=false, _arg3:Number=1):void{
var _local4:String;
var _local5:int;
var _local6:Rectangle;
var _local7:Array;
var _local8:Matrix;
var _local9:BitmapData;
var _local10:String;
var _local11:Array;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:int;
var _local16:String;
var _local17:int;
var _local18:Array;
var _local19:Object;
var _local20:g2dAnimation;
var _local21:g2dFrame;
_local4 = getQualifiedClassName(_arg1).replace("Sprite", "");
if (_frames[_local4] == null){
_frames[_local4] = new Array();
};
if (_animations[_local4] == null){
_animations[_local4] = new Dictionary();
};
_local5 = 0;
_local8 = g2dUtility.matrix;
_arg1.gotoAndStop(1);
if (_arg1.currentLabel.search("sheet") != -1){
_local11 = _arg1.currentLabel.split("_")[1].split("x");
_local5 = 2;
while (_local5 <= _arg1.totalFrames) {
_arg1.gotoAndStop(_local5);
_local6 = _arg1.getBounds(_arg1);
_local12 = (_local6.width / _local11[0]);
_local13 = (_local6.height / _local11[1]);
_local12 = ((_local12)<1) ? 1 : _local12;
_local13 = ((_local13)<1) ? 1 : _local13;
_local7 = _arg1.currentLabel.split("_");
_animations[_local4][_local7[0]] = new g2dAnimation(_frames[_local4].length, ((_frames[_local4].length + (_local12 * _local13)) - 1), _local7[2], _local7[1]);
_local14 = 0;
while (_local14 < _local13) {
_local15 = 0;
while (_local15 < _local12) {
_local9 = new BitmapData(_local11[0], _local11[1], true, 0);
_local8.identity();
_local8.scale(_arg3, _arg3);
_local8.translate(-((_local15 * _local11[0])), -((_local14 * _local11[1])));
_local9.draw(_arg1, _local8);
_frames[_local4].push(new g2dFrame(_local9, new g2dVector2(-((_local11[0] / 2)), -((_local11[1] / 2)))));
_local15++;
};
_local14++;
};
_local5++;
};
} else {
_local16 = _arg1.currentLabel;
_local17 = 0;
_local5 = 1;
while (_local5 <= _arg1.totalFrames) {
_arg1.gotoAndStop(_local5);
if (_arg1.currentLabel != _local16){
_local7 = _local16.split("_");
_animations[_local4][_local7[0]] = new g2dAnimation(_local17, (_local5 - 2), _local7[2], _local7[1]);
_local16 = _arg1.currentLabel;
_local17 = (_local5 - 1);
};
if (_local5 == _arg1.totalFrames){
_local7 = _arg1.currentLabel.split("_");
_animations[_local4][_local7[0]] = new g2dAnimation(_local17, (_local5 - 1), _local7[2], _local7[1]);
};
_local6 = _arg1.getBounds(_arg1);
_local9 = new BitmapData((_local6.width + 1), (_local6.height + 1), true, 0);
_local8.identity();
_local8.scale(_arg3, _arg3);
_local8.translate(-(_local6.x), -(_local6.y));
_local9.draw(_arg1, _local8);
_frames[_local4].push(new g2dFrame(_local9, new g2dVector2(_local6.x, _local6.y)));
_local5++;
};
};
if (_arg2 == true){
_local18 = new Array();
for (_local19 in _animations[_local4]) {
_local18.push((_local19 as String));
};
for each (_local10 in _local18) {
_local20 = _animations[_local4][_local10];
_animations[_local4][(_local10 + "flipped")] = new g2dAnimation(_frames[_local4].length, ((_frames[_local4].length + _local20.endFrame) - _local20.startFrame), (_local20.nextAnimation + "flipped"), Math.floor((1 / _local20.delay)));
_local5 = _local20.startFrame;
while (_local5 <= _local20.endFrame) {
_local21 = _frames[_local4][_local5];
_local9 = new BitmapData(_local21.bitmapData.width, _local21.bitmapData.height, true, 0);
_local8.identity();
_local8.scale(-1, 1);
_local8.translate(_local21.bitmapData.width, 0);
_local9.draw(_local21.bitmapData, _local8);
_frames[_local4].push(new g2dFrame(_local9, new g2dVector2(_local21.offset.x, _local21.offset.y)));
_local5++;
};
};
};
}
}
}//package g2d
Section 20
//g2dText (g2d.g2dText)
package g2d {
import flash.text.*;
import flash.geom.*;
import flash.filters.*;
public class g2dText {
protected var _textFormat:TextFormat;
protected var _position:g2dVector2;
protected var _textField:TextField;
public function g2dText(_arg1:Font, _arg2:String="", _arg3:g2dVector2=null, _arg4:Number=12, _arg5:uint=4294967295){
_textField = new TextField();
_textFormat = new TextFormat();
super();
_position = ((_arg3)==null) ? new g2dVector2(0, 0) : _arg3;
_textFormat.align = TextFormatAlign.LEFT;
_textFormat.color = _arg5;
_textFormat.font = _arg1.fontName;
_textFormat.size = _arg4;
_textField.autoSize = TextFieldAutoSize.LEFT;
_textField.defaultTextFormat = _textFormat;
_textField.embedFonts = true;
_textField.selectable = false;
_textField.text = _arg2;
}
public function set size(_arg1:Object):void{
_textFormat.size = _arg1;
}
public function set outline(_arg1:uint):void{
_textField.filters = [new GlowFilter(_arg1, 1, 2, 2, 1000, 2)];
}
public function get position():g2dVector2{
return (_position);
}
public function draw(_arg1:g2dCanvas):void{
var _local2:Matrix;
_local2 = g2dUtility.matrix;
_local2.identity();
_local2.translate(_position.x, _position.y);
_arg1.bitmapData.draw(_textField, _local2);
}
public function get colour():Object{
return (_textFormat.color);
}
public function get text():String{
return (_textField.text);
}
public function set position(_arg1:g2dVector2):void{
_position = _arg1;
}
public function set colour(_arg1:Object):void{
_textFormat.color = _arg1;
}
public function get size():Object{
return (_textFormat.size);
}
public function set text(_arg1:String):void{
_textField.text = _arg1;
}
}
}//package g2d
Section 21
//g2dTime (g2d.g2dTime)
package g2d {
import flash.utils.*;
public final class g2dTime {
protected var _time0:Number;
protected var _time1:Number;// = 1
protected static var _totalTime:Number = 0;
protected static var _deltaTime:Number = 0;
public function g2dTime(){
_time0 = getTimer();
_time1 = 1;
super();
}
public function update(){
_time1 = getTimer();
_deltaTime = (_time1 - _time0);
_time0 = _time1;
_deltaTime = (_deltaTime / 1000);
_totalTime = (_totalTime + deltaTime);
}
public static function get totalTime():Number{
return (_totalTime);
}
public static function get deltaTime():Number{
return (_deltaTime);
}
}
}//package g2d
Section 22
//g2dUtility (g2d.g2dUtility)
package g2d {
import flash.display.*;
import flash.geom.*;
public class g2dUtility {
public static var point:Point = new Point(0, 0);
public static var matrix:Matrix = new Matrix();
public static var vector:g2dVector2 = new g2dVector2(0, 0);
public static var bitmapData:BitmapData = new BitmapData(0x0200, 0x0200, true, 0);
public static var rectangle:Rectangle = new Rectangle(0, 0, 0, 0);
public static function randomRange(_arg1:Number, _arg2:Number):Number{
return ((Math.floor((Math.random() * ((_arg2 - _arg1) + 1))) + _arg1));
}
}
}//package g2d
Section 23
//g2dVector2 (g2d.g2dVector2)
package g2d {
public final class g2dVector2 {
protected var _x:Number;// = 0
protected var _y:Number;// = 0
public function g2dVector2(_arg1:Number=0, _arg2:Number=0){
_x = 0;
_y = 0;
super();
_x = _arg1;
_y = _arg2;
}
public function get length():Number{
return (Math.sqrt(((_x * _x) + (_y * _y))));
}
public function set y(_arg1:Number):void{
_y = _arg1;
}
public function normalize():void{
if (length > 0){
_x = (_x / length);
_y = (_y / length);
};
}
public function set x(_arg1:Number):void{
_x = _arg1;
}
public function dotProduct(_arg1:g2dVector2):Number{
return (((_x * _arg1.x) + (_y * _arg1.y)));
}
public function get x():Number{
return (_x);
}
public function get y():Number{
return (_y);
}
public function distance(_arg1:g2dVector2):Number{
var _local2:Number;
var _local3:Number;
_local2 = (_arg1.x - _x);
_local3 = (_arg1.y - _y);
return (Math.sqrt(((_local2 * _local2) + (_local3 * _local3))));
}
}
}//package g2d
Section 24
//bubble_logo3_129 (Launcher_fla.bubble_logo3_129)
package Launcher_fla {
import flash.display.*;
public dynamic class bubble_logo3_129 extends MovieClip {
public function bubble_logo3_129(){
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
stop();
}
function frame1(){
stop();
}
}
}//package Launcher_fla
Section 25
//BubbleBoxLogoGraphicMc_131 (Launcher_fla.BubbleBoxLogoGraphicMc_131)
package Launcher_fla {
import flash.display.*;
public dynamic class BubbleBoxLogoGraphicMc_131 extends MovieClip {
public var play_latest_text:MovieClip;
}
}//package Launcher_fla
Section 26
//BubbleBoxSplash_127 (Launcher_fla.BubbleBoxSplash_127)
package Launcher_fla {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public dynamic class BubbleBoxSplash_127 extends MovieClip {
public var link:MovieClip;
public var play_latest_text:MovieClip;
public function BubbleBoxSplash_127(){
addFrameScript(0, frame1, 160, frame161);
}
function frame161(){
MovieClip(parent).nextFrame();
stop();
}
function frame1(){
play();
link.addEventListener(MouseEvent.CLICK, Bubblebox_fnc);
}
public function Bubblebox_fnc(_arg1:MouseEvent):void{
var _local2:String;
var _local3:URLRequest;
_local2 = "http://www.bubblebox.com/clickreg.php?type=gamestats&id=1772&subid=splash";
_local3 = new URLRequest(_local2);
navigateToURL(_local3, "_blank");
}
}
}//package Launcher_fla
Section 27
//bubblxbox_smallLogo_ro_125 (Launcher_fla.bubblxbox_smallLogo_ro_125)
package Launcher_fla {
import flash.display.*;
public dynamic class bubblxbox_smallLogo_ro_125 extends MovieClip {
public function bubblxbox_smallLogo_ro_125(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Launcher_fla
Section 28
//Collission_mailbox_79 (Launcher_fla.Collission_mailbox_79)
package Launcher_fla {
import flash.display.*;
public dynamic class Collission_mailbox_79 extends MovieClip {
public function Collission_mailbox_79(){
addFrameScript(95, frame96);
}
function frame96(){
stop();
}
}
}//package Launcher_fla
Section 29
//Creditspage_16 (Launcher_fla.Creditspage_16)
package Launcher_fla {
import flash.display.*;
public dynamic class Creditspage_16 extends MovieClip {
public var sponsor:MovieClip;
}
}//package Launcher_fla
Section 30
//large_logo_17 (Launcher_fla.large_logo_17)
package Launcher_fla {
import flash.display.*;
public dynamic class large_logo_17 extends MovieClip {
public var logo_ro:MovieClip;
}
}//package Launcher_fla
Section 31
//large_logo_ro_18 (Launcher_fla.large_logo_ro_18)
package Launcher_fla {
import flash.display.*;
public dynamic class large_logo_ro_18 extends MovieClip {
public function large_logo_ro_18(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Launcher_fla
Section 32
//MainTimeline (Launcher_fla.MainTimeline)
package Launcher_fla {
import flash.display.*;
import g2d.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import CPMStar.*;
import flash.ui.*;
import flash.geom.*;
import flash.utils.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var counter:Number;
public var mainMenuPlayMoreGamesButton:SimpleButton;
public var ad:DisplayObject;
public var blacklist:Array;
public var game:LauncherGame;
public var preloaderInfo:TextField;
public var mainMenuPlayButton:SimpleButton;
public var url:String;
public var skip:SimpleButton;
public var customContextMenu:ContextMenu;
public var cutscene:MovieClip;
public var credits:MovieClip;
public var copyrightNotice:ContextMenuItem;
public var allowAds:Boolean;
public var adBox:MovieClip;
public var mainMenuCreditsButton:SimpleButton;
public var CPMStarContentSpotID:String;
public var step:Number;
public var preloaderSponsor:SponsorLogo;
public var sponsorLogo:SponsorLogo;
public function MainTimeline(){
addFrameScript(0, frame1, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7);
}
public function precacheResources(_arg1:Event):void{
switch (step){
case 0:
g2dSprite.parseMovieClip(new BackgroundSprite());
g2dSprite.parseMovieClip(new ForegroundSprite());
g2dSprite.parseMovieClip(new CloudsSprite());
g2dSprite.parseMovieClip(new CatapultBaseSprite(), false);
g2dSprite.parseMovieClip(new CatapultArmSprite(), false);
break;
case 1:
g2dSprite.parseMovieClip(new PlayerSittingRegularSprite(), false, 0.75);
g2dSprite.parseMovieClip(new PlayerSittingPatchmanSprite(), false, 0.75);
g2dSprite.parseMovieClip(new PlayerFlyingRegularSprite(), false, 0.75);
g2dSprite.parseMovieClip(new PlayerFlyingPatchmanSprite(), false, 0.75);
g2dSprite.parseMovieClip(new PlayerBirdRegularSprite(), false, 0.75);
g2dSprite.parseMovieClip(new PlayerBirdPatchmanSprite(), false, 0.75);
break;
case 2:
g2dSprite.parseMovieClip(new PlayerRocketRegularSprite(), false, 0.75);
g2dSprite.parseMovieClip(new PlayerRocketPatchmanSprite(), false, 0.75);
g2dSprite.parseMovieClip(new PlayerIcbmRegularSprite(), false, 0.75);
g2dSprite.parseMovieClip(new PlayerIcbmPatchmanSprite(), false, 0.75);
g2dSprite.parseMovieClip(new PlayerBounce1RegularSprite(), false, 0.75);
g2dSprite.parseMovieClip(new PlayerBounce1PatchmanSprite(), false, 0.75);
break;
case 3:
g2dSprite.parseMovieClip(new PlayerBounce2RegularSprite(), false, 0.75);
g2dSprite.parseMovieClip(new PlayerBounce2PatchmanSprite(), false, 0.75);
g2dSprite.parseMovieClip(new PlayerBounce3RegularSprite(), false, 0.75);
g2dSprite.parseMovieClip(new PlayerBounce3PatchmanSprite(), false, 0.75);
g2dSprite.parseMovieClip(new PlayerStandRegularSprite(), false, 0.85);
g2dSprite.parseMovieClip(new PlayerStandPatchmanSprite(), false, 0.75);
g2dSprite.parseMovieClip(new SpaceIndicatorSprite());
g2dSprite.parseMovieClip(new PersonalBestSprite());
break;
case 4:
g2dSprite.parseMovieClip(new BearWaitingSprite(), false, 0.75);
g2dSprite.parseMovieClip(new BearChasing1Sprite(), false, 0.75);
g2dSprite.parseMovieClip(new BearChasing2Sprite(), false, 0.75);
g2dSprite.parseMovieClip(new BearChasing3Sprite(), false, 0.75);
g2dSprite.parseMovieClip(new BearChasing4Sprite(), false, 0.75);
break;
case 5:
g2dSprite.parseMovieClip(new BearChasing5Sprite(), false, 0.85);
g2dSprite.parseMovieClip(new BearChasing6Sprite(), false, 0.75);
g2dSprite.parseMovieClip(new BearChasing7Sprite(), false, 0.75);
g2dSprite.parseMovieClip(new BearChasing8Sprite(), false, 0.75);
break;
case 6:
g2dSprite.parseMovieClip(new ExplosionSprite(), false);
g2dSprite.parseMovieClip(new SceneObjectSprite(), false);
g2dSprite.parseMovieClip(new FlamingoSprite(), false);
g2dSprite.parseMovieClip(new LawnmowerSprite(), false);
g2dSprite.parseMovieClip(new MailboxSprite(), false);
break;
case 7:
g2dSprite.parseMovieClip(new SandboxSprite(), false);
g2dSprite.parseMovieClip(new BalloonSprite(), false);
g2dSprite.parseMovieClip(new HotDogStandSprite(), false, 0.75);
g2dSprite.parseMovieClip(new GnomeSprite(), false);
g2dSprite.parseMovieClip(new BusinessmanSprite(), false);
break;
case 8:
g2dSprite.parseMovieClip(new BbqSprite(), false, 0.75);
g2dSprite.parseMovieClip(new GrateSprite(), false);
g2dSprite.parseMovieClip(new SpinnerSprite(), false);
g2dSprite.parseMovieClip(new LeftBirdSprite(), false);
g2dSprite.parseMovieClip(new RightBirdSprite(), false);
g2dSprite.parseMovieClip(new RetryButtonSprite());
g2dSprite.parseMovieClip(new ShopButtonSprite());
g2dSprite.parseMovieClip(new AchivementsButtonSprite());
g2dSprite.parseMovieClip(new ResultsButtonSprite());
g2dSprite.parseMovieClip(new DistanceScoreButtonSprite());
g2dSprite.parseMovieClip(new MoreGamesButtonSprite());
break;
case 9:
g2dSprite.parseMovieClip(new BackButtonSprite());
g2dSprite.parseMovieClip(new MetalpultButtonSprite(), false, 0.5);
g2dSprite.parseMovieClip(new SpoonpultButtonSprite(), false, 0.5);
g2dSprite.parseMovieClip(new SkelepultButtonSprite(), false, 0.5);
g2dSprite.parseMovieClip(new PatchpultButtonSprite(), false, 0.5);
break;
case 10:
g2dSprite.parseMovieClip(new BouncesButtonSprite(), false, 0.7);
g2dSprite.parseMovieClip(new AccuracyButtonSprite(), false, 0.7);
g2dSprite.parseMovieClip(new ExplosionsButtonSprite(), false, 0.7);
g2dSprite.parseMovieClip(new VersionCardSprite());
break;
case 11:
g2dSprite.parseMovieClip(new ShopBackgroundSprite());
g2dSprite.parseMovieClip(new BirdButtonSprite());
g2dSprite.parseMovieClip(new RocketButtonSprite());
g2dSprite.parseMovieClip(new IcbmButtonSprite());
break;
case 12:
g2dSprite.parseMovieClip(new MuteButtonSprite());
g2dSprite.parseMovieClip(new TutorialSprite());
break;
case 13:
stage.removeEventListener(Event.ENTER_FRAME, precacheResources);
break;
};
step++;
}
public function preloaderSponsorClick(_arg1:MouseEvent):void{
var _local2:String;
var _local3:URLRequest;
_local2 = "http://www.bubblebox.com/clickreg.php?type=gamestats&id=1772&subid=preloader";
_local3 = new URLRequest(_local2);
navigateToURL(_local3, "_blank");
}
public function mainMenuCreditsButtonClick(_arg1:MouseEvent):void{
credits.visible = true;
}
function frame3(){
stop();
gotoAndStop(4);
}
function frame6(){
stop();
cutscene.gotoAndStop(1);
this.addEventListener(Event.ENTER_FRAME, updateCutscene);
skip.addEventListener(MouseEvent.CLICK, skipClick);
counter = 0;
}
function frame7(){
stop();
stage.frameRate = 60;
game = new LauncherGame(this.stage);
}
public function skipClick(_arg1:MouseEvent):void{
this.removeEventListener(Event.ENTER_FRAME, updateCutscene);
skip.removeEventListener(MouseEvent.CLICK, skipClick);
gotoAndStop(7);
}
function frame5(){
stop();
credits.visible = false;
credits.addEventListener(MouseEvent.CLICK, mainMenuCreditsClick);
mainMenuPlayButton.addEventListener(MouseEvent.CLICK, mainMenuPlayButtonClick);
mainMenuCreditsButton.addEventListener(MouseEvent.CLICK, mainMenuCreditsButtonClick);
mainMenuPlayMoreGamesButton.addEventListener(MouseEvent.CLICK, mainMenuPlayMoreGamesButtonClick);
sponsorLogo.addEventListener(MouseEvent.CLICK, sponsorLogoClick);
credits.sponsor.addEventListener(MouseEvent.CLICK, sponsorLogoClick);
}
function frame1(){
stop();
allowAds = true;
blacklist = ["flashgamelicense.com", "xiaoyouxi.cn", "game.com.cn", "game.asia", ".agame.com", "kaisergames.de", "andkon.com", "gamezhero.com", "addictinggames.com", "freeonlinegames.com", "kongregate.com"];
for each (url in blacklist) {
if (root.loaderInfo.url.indexOf(url) != -1){
allowAds = false;
};
};
customContextMenu = new ContextMenu();
customContextMenu.hideBuiltInItems();
copyrightNotice = new ContextMenuItem("Copyright 2010");
customContextMenu.customItems.push(copyrightNotice);
contextMenu = customContextMenu;
if (allowAds){
CPMStarContentSpotID = "2096QD52DD02C";
ad = new AdLoader(CPMStarContentSpotID);
adBox.addChild(ad);
} else {
adBox.visible = false;
};
this.addEventListener(Event.ENTER_FRAME, updatePreloader);
preloaderInfo.addEventListener(MouseEvent.CLICK, playGame);
preloaderInfo.mouseEnabled = true;
preloaderSponsor.addEventListener(MouseEvent.CLICK, preloaderSponsorClick);
}
public function updateCutscene(_arg1:Event):void{
counter++;
if (counter == 1){
cutscene.nextFrame();
counter = 0;
};
if (cutscene.currentFrame == cutscene.totalFrames){
this.removeEventListener(Event.ENTER_FRAME, updateCutscene);
gotoAndStop(7);
};
}
public function updatePreloader(_arg1:Event):void{
preloaderInfo.text = (("Loading " + Math.floor(((this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal) * 100))) + "%");
if (this.loaderInfo.bytesLoaded == this.loaderInfo.bytesTotal){
preloaderInfo.text = "Play Game";
this.removeEventListener(Event.ENTER_FRAME, updatePreloader);
};
}
public function playGame(_arg1:MouseEvent):void{
if (preloaderInfo.text == "Play Game"){
gotoAndStop(3);
};
}
public function sponsorLogoClick(_arg1:MouseEvent):void{
var _local2:String;
var _local3:URLRequest;
_local2 = "http://www.bubblebox.com/clickreg.php?type=gamestats&id=1772&subid=mainmenu";
_local3 = new URLRequest(_local2);
navigateToURL(_local3, "_blank");
}
public function mainMenuPlayMoreGamesButtonClick(_arg1:MouseEvent):void{
var _local2:String;
var _local3:URLRequest;
_local2 = "http://www.bubblebox.com/clickreg.php?type=gamestats&id=1772&subid=mainmenu";
_local3 = new URLRequest(_local2);
navigateToURL(_local3, "_blank");
}
public function mainMenuPlayButtonClick(_arg1:MouseEvent):void{
credits.removeEventListener(MouseEvent.CLICK, mainMenuCreditsClick);
mainMenuPlayButton.removeEventListener(MouseEvent.CLICK, mainMenuPlayButtonClick);
mainMenuCreditsButton.removeEventListener(MouseEvent.CLICK, mainMenuCreditsButtonClick);
mainMenuPlayMoreGamesButton.removeEventListener(MouseEvent.CLICK, mainMenuPlayMoreGamesButtonClick);
sponsorLogo.removeEventListener(MouseEvent.CLICK, sponsorLogoClick);
gotoAndStop(6);
}
function frame4(){
stop();
stage.addEventListener(Event.ENTER_FRAME, precacheResources);
step = 0;
}
public function mainMenuCreditsClick(_arg1:MouseEvent):void{
if (credits.visible == true){
credits.visible = false;
};
}
public function sitelock(_arg1:String){
var _local2:Array;
var _local3:Array;
_local2 = root.loaderInfo.url.split("://");
_local3 = _local2[1].split("/");
trace(_local3[0]);
trace(_arg1);
if (_local3[0] == _arg1){
gotoAndStop(4);
};
}
}
}//package Launcher_fla
Section 33
//small_btn_logo_4 (Launcher_fla.small_btn_logo_4)
package Launcher_fla {
import flash.display.*;
public dynamic class small_btn_logo_4 extends MovieClip {
public function small_btn_logo_4(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Launcher_fla
Section 34
//AccuracyButtonSprite (AccuracyButtonSprite)
package {
import flash.display.*;
public dynamic class AccuracyButtonSprite extends MovieClip {
}
}//package
Section 35
//AchivementDialog (AchivementDialog)
package {
import flash.display.*;
import flash.text.*;
public dynamic class AchivementDialog extends MovieClip {
public var description:TextField;
}
}//package
Section 36
//AchivementIcons (AchivementIcons)
package {
import flash.display.*;
public dynamic class AchivementIcons extends MovieClip {
}
}//package
Section 37
//AchivementPanel (AchivementPanel)
package {
import flash.display.*;
import flash.text.*;
public dynamic class AchivementPanel extends MovieClip {
public var description:TextField;
public var icon:AchivementIcons;
}
}//package
Section 38
//Achivements (Achivements)
package {
import g2d.*;
import flash.geom.*;
import flash.utils.*;
public class Achivements {
protected static var _idleTime:Number = 0;
protected static var _panel:AchivementPanel = new AchivementPanel();
protected static var _achivements:Dictionary = new Dictionary();
protected static var _position:g2dVector2 = new g2dVector2((700 / 2), 450);
protected static var _state = "hidden";
public static function update():void{
switch (_state){
case "rising":
_position.y = (_position.y - (96 * g2dTime.deltaTime));
if (_position.y < 370){
_position.y = 370;
_state = "idling";
_idleTime = 0;
};
break;
case "idling":
_idleTime = (_idleTime + g2dTime.deltaTime);
if (_idleTime > 4){
_state = "falling";
};
break;
case "falling":
_position.y = (_position.y + (96 * g2dTime.deltaTime));
if (_position.y > 450){
_position.y = 450;
_state = "hidden";
};
break;
};
}
public static function isUnlocked(_arg1:Number):Boolean{
switch (_arg1){
case 1:
return (_achivements["first"]);
case 2:
return (_achivements["100k"]);
case 3:
return (_achivements["perfect"]);
case 4:
return (_achivements["metalpult"]);
case 5:
return (_achivements["fifty"]);
case 6:
return (_achivements["icbm"]);
case 7:
return (_achivements["space"]);
case 8:
return (_achivements["businessman"]);
case 9:
return (_achivements["patchpult"]);
case 10:
return (_achivements["patchman"]);
};
return (false);
}
public static function draw(_arg1:g2dCanvas):void{
var _local2:Matrix;
_local2 = g2dUtility.matrix;
_local2.identity();
_local2.translate(_position.x, _position.y);
_arg1.bitmapData.draw(_panel, _local2);
}
public static function registerAchivements():void{
_achivements["first"] = false;
_achivements["100k"] = false;
_achivements["perfect"] = false;
_achivements["metalpult"] = false;
_achivements["fifty"] = false;
_achivements["icbm"] = false;
_achivements["space"] = false;
_achivements["businessman"] = false;
_achivements["patchpult"] = false;
_achivements["patchman"] = false;
}
public static function unlock(_arg1:String):void{
if (_achivements[_arg1] == false){
_state = "rising";
_achivements[_arg1] = true;
_panel.icon.gotoAndStop(_arg1);
switch (_arg1){
case "first":
_panel.description.text = "First Launch";
break;
case "100k":
_panel.description.text = "Travel 100km";
break;
case "perfect":
_panel.description.text = "Perfect Shot";
break;
case "metalpult":
_panel.description.text = "New Catapult";
break;
case "fifty":
_panel.description.text = "50 Launches";
break;
case "icbm":
_panel.description.text = "Nuke Cowboy";
break;
case "space":
_panel.description.text = "To Boldly Go";
break;
case "businessman":
_panel.description.text = "Takin' Care of Business";
break;
case "patchpult":
_panel.description.text = "Best Catapult";
break;
case "patchman":
_panel.description.text = "Patchman Unlocked";
break;
};
};
}
}
}//package
Section 39
//AchivementsButtonSprite (AchivementsButtonSprite)
package {
import flash.display.*;
public dynamic class AchivementsButtonSprite extends MovieClip {
}
}//package
Section 40
//AimCurve (AimCurve)
package {
import flash.display.*;
public dynamic class AimCurve extends MovieClip {
public var target:MovieClip;
}
}//package
Section 41
//BackButtonSprite (BackButtonSprite)
package {
import flash.display.*;
public dynamic class BackButtonSprite extends MovieClip {
}
}//package
Section 42
//BackgroundSprite (BackgroundSprite)
package {
import flash.display.*;
public dynamic class BackgroundSprite extends MovieClip {
}
}//package
Section 43
//Balloon (Balloon)
package {
import g2d.*;
public class Balloon extends BoosterEntity {
public function Balloon(){
_sprite = new g2dSprite("Balloon");
_radius = 50;
_horizontalMultiplier = 1000;
_verticalMultiplier = 1000;
_explode = true;
}
}
}//package
Section 44
//BalloonSprite (BalloonSprite)
package {
import flash.display.*;
public dynamic class BalloonSprite extends MovieClip {
}
}//package
Section 45
//Bbq (Bbq)
package {
import g2d.*;
public class Bbq extends BoosterEntity {
public function Bbq(){
_sprite = new g2dSprite("Bbq");
_radius = 50;
_horizontalMultiplier = 1000;
_verticalMultiplier = 1000;
_explode = true;
}
}
}//package
Section 46
//BbqSprite (BbqSprite)
package {
import flash.display.*;
public dynamic class BbqSprite extends MovieClip {
}
}//package
Section 47
//Bear (Bear)
package {
import g2d.*;
public class Bear extends g2dEntity {
protected var _chasing:Boolean;// = false
protected static var _nextAnimation:Number = 5;
public function Bear(){
_chasing = false;
super();
_sprite = new g2dSprite("BearWaiting");
reset();
}
public function chase():void{
var _local1:Number;
if (_chasing == false){
_position.x = (g2dCamera.position.x - 140);
_position.y = 390;
_velocity.x = 290;
_sprite = new g2dSprite(("BearChasing" + _nextAnimation));
_local1 = g2dUtility.randomRange(1, 8);
while (_local1 == _nextAnimation) {
_local1 = g2dUtility.randomRange(1, 8);
};
_nextAnimation = _local1;
_chasing = true;
};
}
}
}//package
Section 48
//BearChasing1Sprite (BearChasing1Sprite)
package {
import flash.display.*;
public dynamic class BearChasing1Sprite extends MovieClip {
}
}//package
Section 49
//BearChasing2Sprite (BearChasing2Sprite)
package {
import flash.display.*;
public dynamic class BearChasing2Sprite extends MovieClip {
}
}//package
Section 50
//BearChasing3Sprite (BearChasing3Sprite)
package {
import flash.display.*;
public dynamic class BearChasing3Sprite extends MovieClip {
}
}//package
Section 51
//BearChasing4Sprite (BearChasing4Sprite)
package {
import flash.display.*;
public dynamic class BearChasing4Sprite extends MovieClip {
}
}//package
Section 52
//BearChasing5Sprite (BearChasing5Sprite)
package {
import flash.display.*;
public dynamic class BearChasing5Sprite extends MovieClip {
}
}//package
Section 53
//BearChasing6Sprite (BearChasing6Sprite)
package {
import flash.display.*;
public dynamic class BearChasing6Sprite extends MovieClip {
}
}//package
Section 54
//BearChasing7Sprite (BearChasing7Sprite)
package {
import flash.display.*;
public dynamic class BearChasing7Sprite extends MovieClip {
}
}//package
Section 55
//BearChasing8Sprite (BearChasing8Sprite)
package {
import flash.display.*;
public dynamic class BearChasing8Sprite extends MovieClip {
}
}//package
Section 56
//BearWaitingSprite (BearWaitingSprite)
package {
import flash.display.*;
public dynamic class BearWaitingSprite extends MovieClip {
}
}//package
Section 57
//BirdButtonSprite (BirdButtonSprite)
package {
import flash.display.*;
public dynamic class BirdButtonSprite extends MovieClip {
}
}//package
Section 58
//BlockerEntity (BlockerEntity)
package {
import g2d.*;
public class BlockerEntity extends SceneEntity {
protected var _impacted:Boolean;// = false
public function BlockerEntity(){
_impacted = false;
super();
_sprite = new g2dSprite("Flamingo");
}
override public function reset():void{
_sprite.setAnimation("idle");
_impacted = false;
}
override public function checkPlayerCollision(_arg1:Player):Boolean{
if (_impacted == true){
return (false);
};
if (_position.distance(_arg1.position) <= (_radius + 50)){
_sprite.setAnimation("impact");
_impacted = true;
if ((this is Lawnmower)){
g2dSound.play(SoundBank.lawnmower);
};
_arg1.velocity.x = (_arg1.velocity.x * 0.7);
return (true);
//unresolved jump
};
return (false);
}
}
}//package
Section 59
//BoosterEntity (BoosterEntity)
package {
import g2d.*;
public class BoosterEntity extends SceneEntity {
protected var _verticalMultiplier:Number;// = 1
protected var _impacted:Boolean;// = false
protected var _horizontalMultiplier:Number;// = 1
protected var _explode:Boolean;// = false
protected var _explosionSprite:g2dSprite;
public function BoosterEntity(){
_impacted = false;
_explode = false;
_horizontalMultiplier = 1;
_verticalMultiplier = 1;
super();
_explosionSprite = new g2dSprite("Explosion");
}
override public function draw(_arg1:g2dCanvas):void{
if ((((_impacted == true)) && ((_explode == true)))){
_explosionSprite.draw(_arg1, _position);
} else {
super.draw(_arg1);
};
}
override public function reset():void{
_sprite.setAnimation("idle");
_impacted = false;
}
override public function checkPlayerCollision(_arg1:Player):Boolean{
if (_impacted == true){
return (false);
};
if (_position.distance(_arg1.position) <= (_radius + 50)){
_arg1.velocity.x = (_arg1.velocity.x + ((_horizontalMultiplier + (200 * SaveData.explosions)) * 0.75));
if (_arg1.velocity.y > 0){
_arg1.velocity.y = (_arg1.velocity.y * -1);
};
_arg1.velocity.y = (_arg1.velocity.y - ((_verticalMultiplier + (200 * SaveData.explosions)) * 0.75));
if (_arg1.velocity.y < -5000){
_arg1.velocity.y = -5000;
};
if (_explode == true){
g2dSound.play(SoundBank.explosion);
_explosionSprite.setAnimation("idle", true);
} else {
if ((this is Spinner)){
g2dSound.play(SoundBank.playground);
};
};
if ((this is Businessman)){
Achivements.unlock("businessman");
};
_impacted = true;
_arg1.setBounceAnimation();
return (true);
//unresolved jump
};
return (false);
}
}
}//package
Section 60
//BouncesButtonSprite (BouncesButtonSprite)
package {
import flash.display.*;
public dynamic class BouncesButtonSprite extends MovieClip {
}
}//package
Section 61
//bubblebox_submit_score (bubblebox_submit_score)
package {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.geom.*;
import flash.utils.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
public dynamic class bubblebox_submit_score extends BubbleboxScores {
public var hexArray_chr;
public var vartext;
public var validWeeklyScore;
public var validScore;
public function bubblebox_submit_score(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
}
public function ii(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7){
return (cmn((_arg3 ^ (_arg2 | ~(_arg4))), _arg1, _arg2, _arg5, _arg6, _arg7));
}
public function gg(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7){
return (cmn((MathbitAND(_arg2, _arg4) | MathbitAND(_arg3, ~(_arg4))), _arg1, _arg2, _arg5, _arg6, _arg7));
}
public function cmn(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6){
return (addme(rol(addme(addme(_arg2, _arg1), addme(_arg4, _arg6)), _arg5), _arg3));
}
function frame2(){
stop();
}
function frame3(){
this.bubblebox_view_score.addEventListener(MouseEvent.CLICK, function (_arg1:Event){
navigateToURL(new URLRequest((("http://www.bubblebox.com/highscores/" + _arg1.currentTarget.parent.bubbleboxGameID) + ".htm")), "_blank");
_arg1.target.parent.dispatchEvent(new Event("viewScores"));
});
vartext = "";
validScore = true;
validWeeklyScore = true;
if (isNaN(this.result_scorepos)){
validScore = false;
};
if (isNaN(this.result_scorepos)){
validWeeklyScore = false;
};
if ((((validScore == true)) && ((this.result_scorepos <= 1000)))){
vartext = (("Congratulations, you're ranked nr " + this.result_scorepos) + " in the alltime highscores!!");
} else {
if ((((validWeeklyScore == true)) && ((this.result_weeklyScorepos <= 1000)))){
vartext = (("Congratulations, you're ranked nr " + this.result_weeklyScorepos) + " in the weekly highscores.");
} else {
vartext = "Sorry, you did not make it into the weekly or alltime top 1000.";
};
};
this.postext.text = vartext;
}
public function hh(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7){
return (cmn(((_arg2 ^ _arg3) ^ _arg4), _arg1, _arg2, _arg5, _arg6, _arg7));
}
function frame1(){
MathbitAND = function (_arg1, _arg2){
var _local3:*;
var _local4:*;
if ((((_arg1 < 0)) && ((_arg2 < 0)))){
_local3 = ((_arg1 & 1) & (_arg2 & 1));
_local4 = ((_arg1 >>> 1) & (_arg2 >>> 1));
return (((_local4 << 1) | _local3));
};
return ((_arg1 & _arg2));
};
hexArray_chr = "0123456789abcdef";
String.prototype.MD5 = function (){
var _local1:* = this;
xArray = str2blks_MD5(_local1);
a = 1732584193;
b = -271733879;
c = -1732584194;
d = 271733878;
i = 0;
while (i < xArray.length) {
olda = a;
oldb = b;
oldc = c;
oldd = d;
a = ff(a, b, c, d, xArray[(i + 0)], 7, -680876936);
d = ff(d, a, b, c, xArray[(i + 1)], 12, -389564586);
c = ff(c, d, a, b, xArray[(i + 2)], 17, 606105819);
b = ff(b, c, d, a, xArray[(i + 3)], 22, -1044525330);
a = ff(a, b, c, d, xArray[(i + 4)], 7, -176418897);
d = ff(d, a, b, c, xArray[(i + 5)], 12, 1200080426);
c = ff(c, d, a, b, xArray[(i + 6)], 17, -1473231341);
b = ff(b, c, d, a, xArray[(i + 7)], 22, -45705983);
a = ff(a, b, c, d, xArray[(i + 8)], 7, 1770035416);
d = ff(d, a, b, c, xArray[(i + 9)], 12, -1958414417);
c = ff(c, d, a, b, xArray[(i + 10)], 17, -42063);
b = ff(b, c, d, a, xArray[(i + 11)], 22, -1990404162);
a = ff(a, b, c, d, xArray[(i + 12)], 7, 1804603682);
d = ff(d, a, b, c, xArray[(i + 13)], 12, -40341101);
c = ff(c, d, a, b, xArray[(i + 14)], 17, -1502002290);
b = ff(b, c, d, a, xArray[(i + 15)], 22, 1236535329);
a = gg(a, b, c, d, xArray[(i + 1)], 5, -165796510);
d = gg(d, a, b, c, xArray[(i + 6)], 9, -1069501632);
c = gg(c, d, a, b, xArray[(i + 11)], 14, 643717713);
b = gg(b, c, d, a, xArray[(i + 0)], 20, -373897302);
a = gg(a, b, c, d, xArray[(i + 5)], 5, -701558691);
d = gg(d, a, b, c, xArray[(i + 10)], 9, 38016083);
c = gg(c, d, a, b, xArray[(i + 15)], 14, -660478335);
b = gg(b, c, d, a, xArray[(i + 4)], 20, -405537848);
a = gg(a, b, c, d, xArray[(i + 9)], 5, 568446438);
d = gg(d, a, b, c, xArray[(i + 14)], 9, -1019803690);
c = gg(c, d, a, b, xArray[(i + 3)], 14, -187363961);
b = gg(b, c, d, a, xArray[(i + 8)], 20, 1163531501);
a = gg(a, b, c, d, xArray[(i + 13)], 5, -1444681467);
d = gg(d, a, b, c, xArray[(i + 2)], 9, -51403784);
c = gg(c, d, a, b, xArray[(i + 7)], 14, 1735328473);
b = gg(b, c, d, a, xArray[(i + 12)], 20, -1926607734);
a = hh(a, b, c, d, xArray[(i + 5)], 4, -378558);
d = hh(d, a, b, c, xArray[(i + 8)], 11, -2022574463);
c = hh(c, d, a, b, xArray[(i + 11)], 16, 1839030562);
b = hh(b, c, d, a, xArray[(i + 14)], 23, -35309556);
a = hh(a, b, c, d, xArray[(i + 1)], 4, -1530992060);
d = hh(d, a, b, c, xArray[(i + 4)], 11, 1272893353);
c = hh(c, d, a, b, xArray[(i + 7)], 16, -155497632);
b = hh(b, c, d, a, xArray[(i + 10)], 23, -1094730640);
a = hh(a, b, c, d, xArray[(i + 13)], 4, 681279174);
d = hh(d, a, b, c, xArray[(i + 0)], 11, -358537222);
c = hh(c, d, a, b, xArray[(i + 3)], 16, -722521979);
b = hh(b, c, d, a, xArray[(i + 6)], 23, 76029189);
a = hh(a, b, c, d, xArray[(i + 9)], 4, -640364487);
d = hh(d, a, b, c, xArray[(i + 12)], 11, -421815835);
c = hh(c, d, a, b, xArray[(i + 15)], 16, 530742520);
b = hh(b, c, d, a, xArray[(i + 2)], 23, -995338651);
a = ii(a, b, c, d, xArray[(i + 0)], 6, -198630844);
d = ii(d, a, b, c, xArray[(i + 7)], 10, 1126891415);
c = ii(c, d, a, b, xArray[(i + 14)], 15, -1416354905);
b = ii(b, c, d, a, xArray[(i + 5)], 21, -57434055);
a = ii(a, b, c, d, xArray[(i + 12)], 6, 1700485571);
d = ii(d, a, b, c, xArray[(i + 3)], 10, -1894986606);
c = ii(c, d, a, b, xArray[(i + 10)], 15, -1051523);
b = ii(b, c, d, a, xArray[(i + 1)], 21, -2054922799);
a = ii(a, b, c, d, xArray[(i + 8)], 6, 1873313359);
d = ii(d, a, b, c, xArray[(i + 15)], 10, -30611744);
c = ii(c, d, a, b, xArray[(i + 6)], 15, -1560198380);
b = ii(b, c, d, a, xArray[(i + 13)], 21, 1309151649);
a = ii(a, b, c, d, xArray[(i + 4)], 6, -145523070);
d = ii(d, a, b, c, xArray[(i + 11)], 10, -1120210379);
c = ii(c, d, a, b, xArray[(i + 2)], 15, 718787259);
b = ii(b, c, d, a, xArray[(i + 9)], 21, -343485551);
a = addme(a, olda);
b = addme(b, oldb);
c = addme(c, oldc);
d = addme(d, oldd);
i = (i + 16);
};
return ((((rhexArray(a) + rhexArray(b)) + rhexArray(c)) + rhexArray(d)));
};
stop();
scoreMc = this;
sendBubbleBoxScore = function (_arg1, _arg2:Sprite){
var gameID = _arg1;
var root = _arg2;
userData = new URLLoader();
var sendStr:* = ((((gameID + "_") + root.score) + "_") + root.bubblebox_name.text);
var preHashStr:* = ((((((((((gameID + "_") + "4234232143214421") + "_") + root.score) + "_") + "2537625476251") + "_") + root.bubblebox_name.text) + "_") + "desleutelistessa");
var hashStr:* = preHashStr.MD5();
var data:URLVariables = new URLVariables(((("datastring=" + sendStr) + "&hashstring=") + hashStr));
userData.addEventListener(IOErrorEvent.IO_ERROR, function (_arg1:Event){
scoreMc.gotoAndStop("tryagain");
});
userData.addEventListener(Event.COMPLETE, function (_arg1:Event){
var _local5:String;
var _local6:Array;
var _local2:* = _arg1.target;
var _local3:Array = _local2.data.split("&");
var _local4:Object = {};
for each (_local5 in _local3) {
_local6 = _local5.split("=");
if (_local6.length == 2){
_local4[_local6[0]] = _local6[1];
};
};
scoreMc.result_scoreID = _local4.id;
scoreMc.result_weeklyID = _local4.weekly_id;
scoreMc.result_scorepos = _local4.scorepos;
scoreMc.result_weeklyScorepos = _local4.weeklyScorepos;
scoreMc.gotoAndStop("success");
});
var request:URLRequest = new URLRequest("http://www.bubblebox.com/scripts/insertscore2009.php");
request.method = URLRequestMethod.POST;
request.data = data;
userData.load(request);
};
this.send_btn.addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent){
var _local2:Sprite = _arg1.target.parent;
if (((!((_local2.bubblebox_name.text == "YOUR NAME"))) && ((_local2.bubblebox_name.text.length > 0)))){
trace(_local2.bubbleboxGameID);
sendBubbleBoxScore(_local2.bubbleboxGameID, _local2);
_local2.gotoAndStop("saving");
_local2.dispatchEvent(new Event("sendScores"));
};
});
}
function frame4(){
this.try_again.addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent){
_arg1.currentTarget.parent.gotoAndStop(1);
});
}
public function ff(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7){
return (cmn((MathbitAND(_arg2, _arg3) | MathbitAND(~(_arg2), _arg4)), _arg1, _arg2, _arg5, _arg6, _arg7));
}
public function rhexArray(_arg1){
str = "";
j = 0;
while (j <= 3) {
str = (str + (hexArray_chr.charAt(MathbitAND((_arg1 >> ((j * 8) + 4)), 15)) + hexArray_chr.charAt(MathbitAND((_arg1 >> (j * 8)), 15))));
j++;
};
return (str);
}
public function str2blks_MD5(_arg1){
_arg1 = String(_arg1);
nblk = (((_arg1.length + 8) >> 6) + 1);
blks = new Array((nblk * 16));
i = 0;
while (i < (nblk * 16)) {
blks[i] = 0;
i++;
};
i = 0;
while (i < _arg1.length) {
blks[(i >> 2)] = (blks[(i >> 2)] | (_arg1.charCodeAt(i) << ((i % 4) * 8)));
i++;
};
blks[(i >> 2)] = (blks[(i >> 2)] | (128 << ((i % 4) * 8)));
blks[((nblk * 16) - 2)] = (_arg1.length * 8);
return (blks);
}
public function rol(_arg1, _arg2){
return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2))));
}
public function addme(_arg1, _arg2){
var _local3:* = (MathbitAND(_arg1, 0xFFFF) + MathbitAND(_arg2, 0xFFFF));
var _local4:* = (((_arg1 >> 16) + (_arg2 >> 16)) + (_local3 >> 16));
return (((_local4 << 16) | MathbitAND(_local3, 0xFFFF)));
}
}
}//package
Section 62
//BubbleboxScores (BubbleboxScores)
package {
import flash.display.*;
public dynamic class BubbleboxScores extends MovieClip {
public function setScore(_arg1:Number, _arg2:int):void{
this.bubbleboxGameID = _arg2;
this.score = _arg1;
this.gotoAndStop(1);
}
}
}//package
Section 63
//Businessman (Businessman)
package {
import g2d.*;
public class Businessman extends BoosterEntity {
public function Businessman(){
_sprite = new g2dSprite("Businessman");
_radius = 50;
_horizontalMultiplier = 1000;
_verticalMultiplier = 1000;
_explode = true;
_velocity.x = -128;
}
}
}//package
Section 64
//BusinessmanSprite (BusinessmanSprite)
package {
import flash.display.*;
public dynamic class BusinessmanSprite extends MovieClip {
}
}//package
Section 65
//Catapult (Catapult)
package {
import g2d.*;
public class Catapult extends g2dEntity {
protected var _firing:Boolean;// = false
protected var _catapult:String;// = "wood"
protected var _arm:g2dSprite;
public function Catapult(){
_firing = false;
_catapult = "wood";
super();
_catapult = "wood";
if (SaveData.metalpult == true){
_catapult = "metal";
};
if (SaveData.spoonpult == true){
_catapult = "spoon";
};
if (SaveData.skelepult == true){
_catapult = "bone";
};
if (SaveData.patchpult == true){
_catapult = "patchman";
};
_sprite = new g2dSprite("CatapultBase", _catapult);
_arm = new g2dSprite("CatapultArm", _catapult);
reset();
}
public function launch():void{
if (_firing == false){
_firing = true;
};
}
override public function draw(_arg1:g2dCanvas):void{
_sprite.draw(_arg1, _position, 0);
_arm.draw(_arg1, _position, _angle);
}
public function get power():Number{
switch (_catapult){
case "wood":
return (2000);
case "metal":
return (3000);
case "spoon":
return (4000);
case "bone":
return (5000);
case "patchman":
return (6000);
};
return (2000);
}
override public function update():void{
if (_firing == true){
_angle = (_angle + (300 * g2dTime.deltaTime));
if (_angle > 75){
_angle = 75;
};
};
}
override public function reset():void{
_angle = -10;
_firing = false;
}
}
}//package
Section 66
//CatapultArmSprite (CatapultArmSprite)
package {
import flash.display.*;
public dynamic class CatapultArmSprite extends MovieClip {
}
}//package
Section 67
//CatapultBaseSprite (CatapultBaseSprite)
package {
import flash.display.*;
public dynamic class CatapultBaseSprite extends MovieClip {
}
}//package
Section 68
//CatapultSound (CatapultSound)
package {
import flash.media.*;
public dynamic class CatapultSound extends Sound {
}
}//package
Section 69
//CloudsSprite (CloudsSprite)
package {
import flash.display.*;
public dynamic class CloudsSprite extends MovieClip {
}
}//package
Section 70
//DistanceScoreButtonSprite (DistanceScoreButtonSprite)
package {
import flash.display.*;
public dynamic class DistanceScoreButtonSprite extends MovieClip {
}
}//package
Section 71
//DistanceText (DistanceText)
package {
import flash.display.*;
import flash.text.*;
public dynamic class DistanceText extends MovieClip {
public var description:TextField;
}
}//package
Section 72
//ExplosionsButtonSprite (ExplosionsButtonSprite)
package {
import flash.display.*;
public dynamic class ExplosionsButtonSprite extends MovieClip {
}
}//package
Section 73
//ExplosionSound (ExplosionSound)
package {
import flash.media.*;
public dynamic class ExplosionSound extends Sound {
}
}//package
Section 74
//ExplosionSprite (ExplosionSprite)
package {
import flash.display.*;
public dynamic class ExplosionSprite extends MovieClip {
}
}//package
Section 75
//Flamingo (Flamingo)
package {
import g2d.*;
public class Flamingo extends BlockerEntity {
public function Flamingo(){
_sprite = new g2dSprite("Flamingo");
_radius = 50;
}
}
}//package
Section 76
//FlamingoSprite (FlamingoSprite)
package {
import flash.display.*;
public dynamic class FlamingoSprite extends MovieClip {
}
}//package
Section 77
//FlightMusic (FlightMusic)
package {
import flash.media.*;
public dynamic class FlightMusic extends Sound {
}
}//package
Section 78
//ForegroundSprite (ForegroundSprite)
package {
import flash.display.*;
public dynamic class ForegroundSprite extends MovieClip {
}
}//package
Section 79
//Garfield16 (Garfield16)
package {
import flash.text.*;
public dynamic class Garfield16 extends Font {
}
}//package
Section 80
//Gnome (Gnome)
package {
import g2d.*;
public class Gnome extends BoosterEntity {
public function Gnome(){
_sprite = new g2dSprite("Gnome");
_radius = 60;
_horizontalMultiplier = 1000;
_verticalMultiplier = 1000;
_explode = true;
}
}
}//package
Section 81
//GnomeSprite (GnomeSprite)
package {
import flash.display.*;
public dynamic class GnomeSprite extends MovieClip {
}
}//package
Section 82
//Grate (Grate)
package {
import g2d.*;
public class Grate extends BoosterEntity {
public function Grate(){
_sprite = new g2dSprite("Grate");
_radius = 80;
_horizontalMultiplier = 500;
_verticalMultiplier = 1500;
_explode = false;
}
}
}//package
Section 83
//GrateSprite (GrateSprite)
package {
import flash.display.*;
public dynamic class GrateSprite extends MovieClip {
}
}//package
Section 84
//Highscore (Highscore)
package {
import flash.display.*;
public dynamic class Highscore extends MovieClip {
public var bubbleBox:bubblebox_submit_score;
}
}//package
Section 85
//HotDogStand (HotDogStand)
package {
import g2d.*;
public class HotDogStand extends BoosterEntity {
public function HotDogStand(){
_sprite = new g2dSprite("HotDogStand");
_radius = 150;
_horizontalMultiplier = 1500;
_verticalMultiplier = 1500;
_explode = true;
}
}
}//package
Section 86
//HotDogStandSprite (HotDogStandSprite)
package {
import flash.display.*;
public dynamic class HotDogStandSprite extends MovieClip {
}
}//package
Section 87
//IcbmButtonSprite (IcbmButtonSprite)
package {
import flash.display.*;
public dynamic class IcbmButtonSprite extends MovieClip {
}
}//package
Section 88
//IcbmSound (IcbmSound)
package {
import flash.media.*;
public dynamic class IcbmSound extends Sound {
}
}//package
Section 89
//LauncherGame (LauncherGame)
package {
import flash.display.*;
import g2d.*;
public class LauncherGame extends g2dGame {
public function LauncherGame(_arg1:Stage){
super(_arg1);
Achivements.registerAchivements();
addGameState(new PlayGameState(this));
}
}
}//package
Section 90
//Lawnmower (Lawnmower)
package {
import g2d.*;
public class Lawnmower extends BlockerEntity {
public function Lawnmower(){
_sprite = new g2dSprite("Lawnmower");
_radius = 70;
}
}
}//package
Section 91
//LawnmowerSound (LawnmowerSound)
package {
import flash.media.*;
public dynamic class LawnmowerSound extends Sound {
}
}//package
Section 92
//LawnmowerSprite (LawnmowerSprite)
package {
import flash.display.*;
public dynamic class LawnmowerSprite extends MovieClip {
}
}//package
Section 93
//LeftBird (LeftBird)
package {
import g2d.*;
public class LeftBird extends BoosterEntity {
public function LeftBird(){
_sprite = new g2dSprite("LeftBird");
_radius = 50;
_horizontalMultiplier = 1000;
_verticalMultiplier = 1000;
_explode = true;
_velocity.x = -120;
}
}
}//package
Section 94
//LeftBirdSprite (LeftBirdSprite)
package {
import flash.display.*;
public dynamic class LeftBirdSprite extends MovieClip {
}
}//package
Section 95
//Mailbox (Mailbox)
package {
import g2d.*;
public class Mailbox extends BlockerEntity {
public function Mailbox(){
_sprite = new g2dSprite("Mailbox");
_radius = 70;
}
}
}//package
Section 96
//MailboxSprite (MailboxSprite)
package {
import flash.display.*;
public dynamic class MailboxSprite extends MovieClip {
}
}//package
Section 97
//MainMusic (MainMusic)
package {
import flash.media.*;
public dynamic class MainMusic extends Sound {
}
}//package
Section 98
//MetalpultButtonSprite (MetalpultButtonSprite)
package {
import flash.display.*;
public dynamic class MetalpultButtonSprite extends MovieClip {
}
}//package
Section 99
//MoneySound (MoneySound)
package {
import flash.media.*;
public dynamic class MoneySound extends Sound {
}
}//package
Section 100
//MoneyText (MoneyText)
package {
import flash.display.*;
import flash.text.*;
public dynamic class MoneyText extends MovieClip {
public var description:TextField;
}
}//package
Section 101
//MoreGamesButtonSprite (MoreGamesButtonSprite)
package {
import flash.display.*;
public dynamic class MoreGamesButtonSprite extends MovieClip {
}
}//package
Section 102
//MuteButtonSprite (MuteButtonSprite)
package {
import flash.display.*;
public dynamic class MuteButtonSprite extends MovieClip {
}
}//package
Section 103
//PatchpultButtonSprite (PatchpultButtonSprite)
package {
import flash.display.*;
public dynamic class PatchpultButtonSprite extends MovieClip {
}
}//package
Section 104
//PersonalBestSprite (PersonalBestSprite)
package {
import flash.display.*;
public dynamic class PersonalBestSprite extends MovieClip {
}
}//package
Section 105
//Player (Player)
package {
import g2d.*;
public class Player extends g2dEntity {
protected var _sitting:Array;
protected var _state:int;// = 0
protected var _bird:Array;
protected var _launchAngle:Number;// = 0
protected var _flying:Array;
protected var _attire:int;// = 0
protected var _stand:Array;
protected var _runTimer:Number;// = 0
protected var _launchPower:Number;// = 0
protected var _boosterCountdown:Number;// = 0
protected var _bounce1:Array;
protected var _bounce2:Array;
protected var _bounce3:Array;
protected var _icbm:Array;
protected var _rocket:Array;
protected var _catapult:Catapult;
public static const BOUNCING:int = 6;
public static const FOLLOWING_CATAPULT:int = 1;
public static const BIRDING:int = 3;
public static const ROCKETING:int = 4;
public static const STANDING:int = 7;
public static const IDLE:int = 0;
public static const ATTIRE_PATCHMAN:int = 1;
public static const LAUNCHED:int = 2;
public static const ICBMING:int = 5;
public static const ATTIRE_REGULAR:int = 0;
public function Player(){
_state = IDLE;
_attire = ATTIRE_REGULAR;
_sitting = new Array();
_flying = new Array();
_bird = new Array();
_rocket = new Array();
_icbm = new Array();
_bounce1 = new Array();
_bounce2 = new Array();
_bounce3 = new Array();
_stand = new Array();
_runTimer = 0;
_boosterCountdown = 0;
_launchAngle = 0;
_launchPower = 0;
super();
if ((((((((((((((((((((SaveData.accuracy == 3)) && ((SaveData.bounces == 3)))) && ((SaveData.duck == true)))) && ((SaveData.explosions == 3)))) && ((SaveData.icbm == true)))) && ((SaveData.metalpult == true)))) && ((SaveData.patchpult == true)))) && ((SaveData.rocket == true)))) && ((SaveData.skelepult == true)))) && ((SaveData.spoonpult == true)))){
_attire = ATTIRE_PATCHMAN;
};
_sitting[ATTIRE_REGULAR] = new g2dSprite("PlayerSittingRegular");
_sitting[ATTIRE_PATCHMAN] = new g2dSprite("PlayerSittingPatchman");
_flying[ATTIRE_REGULAR] = new g2dSprite("PlayerFlyingRegular");
_flying[ATTIRE_PATCHMAN] = new g2dSprite("PlayerFlyingPatchman");
_bird[ATTIRE_REGULAR] = new g2dSprite("PlayerBirdRegular");
_bird[ATTIRE_PATCHMAN] = new g2dSprite("PlayerBirdPatchman");
_rocket[ATTIRE_REGULAR] = new g2dSprite("PlayerRocketRegular");
_rocket[ATTIRE_PATCHMAN] = new g2dSprite("PlayerRocketPatchman");
_icbm[ATTIRE_REGULAR] = new g2dSprite("PlayerIcbmRegular");
_icbm[ATTIRE_PATCHMAN] = new g2dSprite("PlayerIcbmPatchman");
_bounce1[ATTIRE_REGULAR] = new g2dSprite("PlayerBounce1Regular");
_bounce1[ATTIRE_PATCHMAN] = new g2dSprite("PlayerBounce1Patchman");
_bounce2[ATTIRE_REGULAR] = new g2dSprite("PlayerBounce2Regular");
_bounce2[ATTIRE_PATCHMAN] = new g2dSprite("PlayerBounce2Patchman");
_bounce3[ATTIRE_REGULAR] = new g2dSprite("PlayerBounce3Regular");
_bounce3[ATTIRE_PATCHMAN] = new g2dSprite("PlayerBounce3Patchman");
_stand[ATTIRE_REGULAR] = new g2dSprite("PlayerStandRegular");
_stand[ATTIRE_PATCHMAN] = new g2dSprite("PlayerStandPatchman");
setAnimation(_sitting);
reset();
}
public function useBooster():void{
if ((((((SaveData.duck == false)) && ((SaveData.rocket == false)))) && ((SaveData.icbm == false)))){
return;
};
if (SaveData.icbm == true){
setAnimation(_icbm);
g2dSound.play(SoundBank.icbm);
} else {
if (SaveData.rocket == true){
setAnimation(_rocket);
g2dSound.play(SoundBank.rocket);
} else {
setAnimation(_bird);
g2dSound.play(SoundBank.quack);
};
};
_angle = 0;
_velocity.x = (_velocity.x + ((1000 + ((SaveData.rocket == true)) ? 1000 : 0) + ((SaveData.icbm == true)) ? 1000 : 0));
_velocity.y = 0;
_state = ROCKETING;
_boosterCountdown = 5;
}
public function get state():int{
return (_state);
}
public function bounce():void{
_velocity.x = (_velocity.x / (1.7 - (0.2 * SaveData.bounces)));
_velocity.y = (_velocity.y / (1.7 - (0.08 * SaveData.bounces)));
_velocity.y = (_velocity.y * -1);
setBounceAnimation();
if (_velocity.x < 200){
_state = STANDING;
_velocity.x = 0;
_velocity.y = 0;
_angle = 0;
_position.y = 400;
setAnimation(_stand);
} else {
g2dSound.play(SoundBank.thud);
};
}
public function setBounceAnimation():void{
switch (g2dUtility.randomRange(0, 2)){
case 0:
setAnimation(_bounce1);
break;
case 1:
setAnimation(_bounce2);
break;
case 2:
setAnimation(_bounce3);
break;
};
if (_state == LAUNCHED){
_angle = 90;
_state = BOUNCING;
};
}
override public function update():void{
switch (_state){
case FOLLOWING_CATAPULT:
if (_catapult.angle <= 55){
_position.y = (320 - (_catapult.angle * 3));
};
if (_catapult.angle > 0){
if (_catapult.angle < 55){
_position.x = (510 + (_catapult.angle * 1.85));
} else {
_state = LAUNCHED;
setAnimation(_flying);
_velocity.x = ((1 - (_launchAngle / 90)) * _launchPower);
_velocity.y = -(((_launchAngle / 90) * _launchPower));
_velocity.x = (_velocity.x + 100);
};
};
break;
case BOUNCING:
_angle = (_angle + (360 * g2dTime.deltaTime));
break;
case ROCKETING:
_boosterCountdown = (_boosterCountdown - g2dTime.deltaTime);
_velocity.y = (_velocity.y - (((5 - _boosterCountdown) * 30) * g2dTime.deltaTime));
if (_boosterCountdown <= 0){
setAnimation(_flying);
_state = LAUNCHED;
};
break;
case STANDING:
_runTimer = (_runTimer + g2dTime.deltaTime);
if (_runTimer > 1){
_velocity.x = 500;
if (_attire == ATTIRE_PATCHMAN){
_velocity.y = -78;
};
};
break;
};
super.update();
}
protected function setAnimation(_arg1:Array):void{
_sprite = _arg1[_attire];
_sprite.setAnimation("idle");
}
public function launch(_arg1:Catapult, _arg2:Number, _arg3:Number):void{
if (_state == IDLE){
_state = FOLLOWING_CATAPULT;
_catapult = _arg1;
_launchAngle = _arg2;
_launchPower = _arg3;
};
}
}
}//package
Section 106
//PlayerBirdPatchmanSprite (PlayerBirdPatchmanSprite)
package {
import flash.display.*;
public dynamic class PlayerBirdPatchmanSprite extends MovieClip {
}
}//package
Section 107
//PlayerBirdRegularSprite (PlayerBirdRegularSprite)
package {
import flash.display.*;
public dynamic class PlayerBirdRegularSprite extends MovieClip {
}
}//package
Section 108
//PlayerBounce1PatchmanSprite (PlayerBounce1PatchmanSprite)
package {
import flash.display.*;
public dynamic class PlayerBounce1PatchmanSprite extends MovieClip {
}
}//package
Section 109
//PlayerBounce1RegularSprite (PlayerBounce1RegularSprite)
package {
import flash.display.*;
public dynamic class PlayerBounce1RegularSprite extends MovieClip {
}
}//package
Section 110
//PlayerBounce2PatchmanSprite (PlayerBounce2PatchmanSprite)
package {
import flash.display.*;
public dynamic class PlayerBounce2PatchmanSprite extends MovieClip {
}
}//package
Section 111
//PlayerBounce2RegularSprite (PlayerBounce2RegularSprite)
package {
import flash.display.*;
public dynamic class PlayerBounce2RegularSprite extends MovieClip {
}
}//package
Section 112
//PlayerBounce3PatchmanSprite (PlayerBounce3PatchmanSprite)
package {
import flash.display.*;
public dynamic class PlayerBounce3PatchmanSprite extends MovieClip {
}
}//package
Section 113
//PlayerBounce3RegularSprite (PlayerBounce3RegularSprite)
package {
import flash.display.*;
public dynamic class PlayerBounce3RegularSprite extends MovieClip {
}
}//package
Section 114
//PlayerFlyingPatchmanSprite (PlayerFlyingPatchmanSprite)
package {
import flash.display.*;
public dynamic class PlayerFlyingPatchmanSprite extends MovieClip {
}
}//package
Section 115
//PlayerFlyingRegularSprite (PlayerFlyingRegularSprite)
package {
import flash.display.*;
public dynamic class PlayerFlyingRegularSprite extends MovieClip {
}
}//package
Section 116
//PlayerIcbmPatchmanSprite (PlayerIcbmPatchmanSprite)
package {
import flash.display.*;
public dynamic class PlayerIcbmPatchmanSprite extends MovieClip {
}
}//package
Section 117
//PlayerIcbmRegularSprite (PlayerIcbmRegularSprite)
package {
import flash.display.*;
public dynamic class PlayerIcbmRegularSprite extends MovieClip {
}
}//package
Section 118
//PlayerRocketPatchmanSprite (PlayerRocketPatchmanSprite)
package {
import flash.display.*;
public dynamic class PlayerRocketPatchmanSprite extends MovieClip {
}
}//package
Section 119
//PlayerRocketRegularSprite (PlayerRocketRegularSprite)
package {
import flash.display.*;
public dynamic class PlayerRocketRegularSprite extends MovieClip {
}
}//package
Section 120
//PlayerSittingPatchmanSprite (PlayerSittingPatchmanSprite)
package {
import flash.display.*;
public dynamic class PlayerSittingPatchmanSprite extends MovieClip {
}
}//package
Section 121
//PlayerSittingRegularSprite (PlayerSittingRegularSprite)
package {
import flash.display.*;
public dynamic class PlayerSittingRegularSprite extends MovieClip {
}
}//package
Section 122
//PlayerStandPatchmanSprite (PlayerStandPatchmanSprite)
package {
import flash.display.*;
public dynamic class PlayerStandPatchmanSprite extends MovieClip {
}
}//package
Section 123
//PlayerStandRegularSprite (PlayerStandRegularSprite)
package {
import flash.display.*;
public dynamic class PlayerStandRegularSprite extends MovieClip {
}
}//package
Section 124
//PlayGameState (PlayGameState)
package {
import flash.display.*;
import g2d.*;
import flash.geom.*;
import flash.net.*;
public class PlayGameState extends g2dGameState {
protected var _player:Player;
protected var _aimCurve:AimCurve;
protected var _moneyText:MoneyText;
protected var _state:int;// = 0
protected var _bear:Bear;
protected var _achivementsButton:g2dSprite;
protected var _aimPower:Number;// = 1
protected var _aimPowerDirection:String;// = "up"
protected var _distanceText:DistanceText;
protected var _bird:g2dSprite;
protected var _sponsorLogo:SponsorLogo2;
protected var _endDistance:Number;// = 0
protected var _aimAngleDirection:String;// = "up"
protected var _achivementDialog:AchivementDialog;
protected var _achivementDisplay:Boolean;// = false
protected var _retryButton:g2dSprite;
protected var _tutorial:g2dSprite;
protected var _canBoost:Boolean;// = false
protected var _spaceIndicator:g2dSprite;
protected var _muteButton:g2dSprite;
protected var _background:g2dSprite;
protected var _personalBestSprite:g2dSprite;
protected var _resultsButton:g2dSprite;
protected var _achivementIcons:AchivementIcons;
protected var _angle:Number;// = -10
protected var _clouds2:g2dSprite;
protected var _clouds3:g2dSprite;
protected var _clouds1:g2dSprite;
protected var _sky:SkySprite;
protected var _nextEntity:Number;
protected var _alphaTransform;
protected var _shopButton:g2dSprite;
protected var _foreground:g2dSprite;
protected var _aimAngle:Number;// = 0
protected var _rocket:g2dSprite;
protected var _sceneEntities:Array;
protected var _catapult:Catapult;
protected var _startDistance:Number;// = 0
protected var _scoreDistanceButton:g2dSprite;
protected var _scoreDistanceText:ScoreDistanceText;
protected var _icbm:g2dSprite;
protected var _moreGamesButton:g2dSprite;
public static const POWERING:int = 1;
public static const FLYING:int = 2;
public static const CHASING:int = 3;
public static const SCORING:int = 4;
public static const AIMING:int = 0;
protected static var _launches:Number = 0;
protected static var _personalBest:Number = -1;
protected static var _scoreBackground:BitmapData = new BitmapData(700, 150, true, 3137339392);
protected static var _scene:String = "grass";
protected static var _tutorialShowing:Boolean = true;
protected static var _playingEpicMusic:Boolean = false;
public function PlayGameState(_arg1:g2dGame){
_state = AIMING;
_angle = -10;
_sky = new SkySprite();
_sceneEntities = new Array();
_aimCurve = new AimCurve();
_aimAngle = 0;
_aimAngleDirection = "up";
_aimPower = 1;
_aimPowerDirection = "up";
_startDistance = 0;
_endDistance = 0;
_distanceText = new DistanceText();
_moneyText = new MoneyText();
_canBoost = false;
_nextEntity = g2dUtility.randomRange(0, 300);
_scoreDistanceText = new ScoreDistanceText();
_achivementDisplay = false;
_achivementIcons = new AchivementIcons();
_achivementDialog = new AchivementDialog();
_alphaTransform = new ColorTransform(1, 1, 1, 0.25);
_sponsorLogo = new SponsorLogo2();
super(_arg1);
_background = new g2dSprite("Background", _scene);
_clouds1 = new g2dSprite("Clouds", "cloud1");
_clouds2 = new g2dSprite("Clouds", "cloud2");
_clouds3 = new g2dSprite("Clouds", "cloud3");
_foreground = new g2dSprite("Foreground", _scene);
_catapult = new Catapult();
_catapult.position.x = 700;
_catapult.position.y = 310;
_player = new Player();
_player.position.x = 510;
_player.position.y = 360;
_personalBestSprite = new g2dSprite("PersonalBest");
_bear = new Bear();
_bear.position.x = 220;
_bear.position.y = 390;
_bird = new g2dSprite("BirdButton");
_rocket = new g2dSprite("RocketButton");
_icbm = new g2dSprite("IcbmButton");
_spaceIndicator = new g2dSprite("SpaceIndicator");
g2dCamera.min = new g2dVector2(0, (-5000 + 433));
g2dCamera.max = new g2dVector2(int.MAX_VALUE, 0);
_aimCurve.target.gotoAndStop(1);
_aimCurve.gotoAndStop(1);
_distanceText.description.text = "0 metres";
_moneyText.description.text = "Earned $0";
_retryButton = new g2dSprite("RetryButton");
_shopButton = new g2dSprite("ShopButton");
_achivementsButton = new g2dSprite("AchivementsButton");
_resultsButton = new g2dSprite("ResultsButton");
_scoreDistanceButton = new g2dSprite("DistanceScoreButton");
_moreGamesButton = new g2dSprite("MoreGamesButton");
_tutorial = new g2dSprite("Tutorial");
_muteButton = new g2dSprite("MuteButton", "on");
}
override public function draw(_arg1:g2dCanvas):void{
var _local2:Number;
var _local3:Number;
var _local4:g2dVector2;
var _local5:Matrix;
var _local6:SceneEntity;
var _local7:Point;
_local2 = 0;
_local3 = 0;
_local4 = g2dUtility.vector;
_local5 = g2dUtility.matrix;
_local5.identity();
_local5.translate(0, (-(g2dCamera.position.y) + 433));
_arg1.bitmapData.draw(_sky, _local5);
_local3 = _clouds1.currentFrame.bitmapData.width;
_local2 = Math.floor(((g2dCamera.position.x / (_local3 / 0.08)) - 600));
while ((_local2 * (_local3 / 0.08)) < (g2dCamera.position.x + (_local3 / 0.08))) {
_local4.x = ((400 + (g2dCamera.position.x * 0.92)) + (_local2 * (_local3 + 600)));
_local4.y = -100;
_clouds1.draw(_arg1, _local4);
_local2++;
};
_local3 = _clouds2.currentFrame.bitmapData.width;
_local2 = Math.floor(((g2dCamera.position.x / (_local3 / 0.12)) - 600));
while ((_local2 * (_local3 / 0.12)) < (g2dCamera.position.x + (_local3 / 0.12))) {
_local4.x = ((g2dCamera.position.x * 0.88) + (_local2 * (_local3 + 600)));
_local4.y = -600;
_clouds2.draw(_arg1, _local4);
_local2++;
};
_local3 = _clouds3.currentFrame.bitmapData.width;
_local2 = Math.floor(((g2dCamera.position.x / (_local3 / 0.14)) - 700));
while ((_local2 * (_local3 / 0.14)) < (g2dCamera.position.x + (_local3 / 0.14))) {
_local4.x = ((g2dCamera.position.x * 0.86) + (_local2 * (_local3 + 700)));
_local4.y = -1000;
_clouds3.draw(_arg1, _local4);
_local2++;
};
_local3 = _background.currentFrame.bitmapData.width;
_local2 = Math.floor((g2dCamera.position.x / (_local3 / 0.15)));
while ((_local2 * (_local3 / 0.15)) < (g2dCamera.position.x + (_local3 / 0.15))) {
_local4.x = ((g2dCamera.position.x * 0.85) + (_local2 * (_local3 - 5)));
_local4.y = 433;
_background.draw(_arg1, _local4);
_local2++;
};
_local3 = _foreground.currentFrame.bitmapData.width;
_local2 = Math.floor((g2dCamera.position.x / _local3));
while ((_local2 * _local3) < (g2dCamera.position.x + (_local3 * 13))) {
_local4.x = (_local2 * (_local3 - 1));
_local4.y = 433;
_foreground.draw(_arg1, _local4);
_local2++;
};
for each (_local6 in _sceneEntities) {
_local6.draw(_arg1);
};
if (_personalBest > 0){
_local4.x = _personalBest;
_local4.y = (433 - 48);
_personalBestSprite.draw(_arg1, _local4);
};
_player.draw(_arg1);
_catapult.draw(_arg1);
_bear.draw(_arg1);
if ((((_state == AIMING)) || ((_state == POWERING)))){
_local5.identity();
_local5.translate(450, 200);
_arg1.bitmapData.draw(_aimCurve, _local5);
};
if (_player.position.y < (-5000 + 433)){
_local4.x = _player.position.x;
_local4.y = ((-5000 + 433) + 16);
_spaceIndicator.draw(_arg1, _local4);
Achivements.unlock("space");
};
_arg1.bitmapData.draw(_distanceText);
_local4.x = (60 + g2dCamera.position.x);
_local4.y = (128 + g2dCamera.position.y);
if (SaveData.icbm){
_icbm.draw(_arg1, _local4, 0, (_canBoost) ? 1 : 0.75);
} else {
if (SaveData.rocket){
_rocket.draw(_arg1, _local4, 0, (_canBoost) ? 1 : 0.75);
} else {
if (SaveData.duck){
_bird.draw(_arg1, _local4, 0, (_canBoost) ? 1 : 0.75);
};
};
};
if (_state == SCORING){
_local7 = g2dUtility.point;
_local7.x = 0;
_local7.y = 125;
_arg1.bitmapData.copyPixels(_scoreBackground, _scoreBackground.rect, _local7, null, null, true);
if (_achivementDisplay == false){
_arg1.bitmapData.draw(_moneyText);
} else {
_local2 = 1;
while (_local2 <= 10) {
_local5.identity();
_local5.translate((((_local2 - 1) * 64) + 40), 140);
_achivementIcons.gotoAndStop(_local2);
_arg1.bitmapData.draw(_achivementIcons, _local5, (Achivements.isUnlocked(_local2)) ? null : _alphaTransform);
if ((((((((g2dMouse.position.x >= (((_local2 - 1) * 64) + 40))) && ((g2dMouse.position.x <= ((((_local2 - 1) * 64) + 40) + 54))))) && ((g2dMouse.position.y >= 140)))) && ((g2dMouse.position.y <= 220)))){
_local5.translate(27, 0);
switch (_local2){
case 1:
_achivementDialog.description.text = "Launch yourself for the first time";
break;
case 2:
_achivementDialog.description.text = "Fly a distance of 100,000 metres";
break;
case 3:
_achivementDialog.description.text = "Launch with full power";
break;
case 4:
_achivementDialog.description.text = "Purchase a new catapult";
break;
case 5:
_achivementDialog.description.text = "Launch yourself 50 times";
break;
case 6:
_achivementDialog.description.text = "Take a spin on an ICBM";
break;
case 7:
_achivementDialog.description.text = "Make it up to space";
break;
case 8:
_achivementDialog.description.text = "???";
break;
case 9:
_achivementDialog.description.text = "Purchase the best catapult";
break;
case 10:
_achivementDialog.description.text = "???";
break;
};
_arg1.bitmapData.draw(_achivementDialog, _local5);
};
_local2++;
};
};
_local4.x = ((360 - 128) + g2dCamera.position.x);
_local4.y = (240 + g2dCamera.position.y);
_retryButton.draw(_arg1, _local4);
_local4.x = (360 + g2dCamera.position.x);
_local4.y = (240 + g2dCamera.position.y);
if (_achivementDisplay == true){
_resultsButton.draw(_arg1, _local4);
} else {
_achivementsButton.draw(_arg1, _local4);
};
_local4.x = ((360 + 128) + g2dCamera.position.x);
_local4.y = (240 + g2dCamera.position.y);
_shopButton.draw(_arg1, _local4);
if (SaveData.highscore == false){
_local4.x = ((350 - 100) + g2dCamera.position.x);
_local4.y = (370 + g2dCamera.position.y);
_scoreDistanceButton.draw(_arg1, _local4);
_local4.x = ((350 + 100) + g2dCamera.position.x);
_local4.y = (370 + g2dCamera.position.y);
_moreGamesButton.draw(_arg1, _local4);
};
_local5.identity();
_local5.translate(0, 400);
_arg1.bitmapData.draw(_scoreDistanceText, _local5);
_local5.identity();
_local5.scale(0.6, 0.6);
_local5.translate(494, 4);
_arg1.bitmapData.draw(_sponsorLogo, _local5);
};
if (_tutorialShowing){
_local4.x = ((700 / 2) + g2dCamera.position.x);
_local4.y = ((433 - 8) + g2dCamera.position.y);
_tutorial.draw(_arg1, _local4);
};
_local4.x = ((700 - 10) + g2dCamera.position.x);
_local4.y = (26 + g2dCamera.position.y);
_muteButton.draw(_arg1, _local4);
Achivements.draw(_arg1);
}
protected function spawnEntity():void{
var _local1:g2dEntity;
var _local2:Number;
_local2 = 0;
switch (_scene){
case "grass":
switch (g2dUtility.randomRange(0, 5)){
case 0:
_local1 = g2dEntity.create(Flamingo);
_local2 = 330;
break;
case 1:
_local1 = g2dEntity.create(Lawnmower);
_local2 = 368;
break;
case 2:
_local1 = g2dEntity.create(Sandbox);
_local2 = 355;
break;
case 3:
_local1 = g2dEntity.create(Spinner);
_local2 = 390;
break;
case 4:
_local1 = g2dEntity.create(Bbq);
_local2 = 325;
break;
case 5:
_local1 = g2dEntity.create(Gnome);
_local2 = 345;
break;
};
break;
case "suburbs":
switch (g2dUtility.randomRange(0, 5)){
case 0:
_local1 = g2dEntity.create(Flamingo);
_local2 = 330;
break;
case 1:
_local1 = g2dEntity.create(Lawnmower);
_local2 = 368;
break;
case 2:
_local1 = g2dEntity.create(Mailbox);
_local2 = 345;
break;
case 3:
_local1 = g2dEntity.create(Grate);
_local2 = 360;
break;
case 4:
_local1 = g2dEntity.create(Bbq);
_local2 = 325;
break;
case 5:
_local1 = g2dEntity.create(Gnome);
_local2 = 345;
break;
};
break;
case "city":
switch (g2dUtility.randomRange(0, 5)){
case 0:
_local1 = g2dEntity.create(Mailbox);
_local2 = 345;
break;
case 1:
_local1 = g2dEntity.create(Mailbox);
_local2 = 345;
break;
case 2:
_local1 = g2dEntity.create(Mailbox);
_local2 = 345;
break;
case 3:
_local1 = g2dEntity.create(Grate);
_local2 = 360;
break;
case 4:
_local1 = g2dEntity.create(Businessman);
_local2 = 320;
break;
case 5:
_local1 = g2dEntity.create(HotDogStand);
_local2 = 320;
break;
};
break;
};
_local1.position.x = (g2dCamera.position.x + g2dUtility.randomRange(800, 1500));
_local1.position.y = _local2;
_sceneEntities.push(_local1);
switch (g2dUtility.randomRange(0, 2)){
case 0:
_local1 = g2dEntity.create(Balloon);
break;
case 1:
_local1 = g2dEntity.create(LeftBird);
break;
case 2:
_local1 = g2dEntity.create(RightBird);
break;
};
_local1.position.x = ((g2dCamera.position.x + 800) + g2dUtility.randomRange(300, 600));
if (_player.position.y < -500){
_local1.position.y = (_player.position.y + g2dUtility.randomRange(-8000, 300));
} else {
_local1.position.y = g2dUtility.randomRange(-600, -200);
};
_sceneEntities.push(_local1);
_nextEntity = ((g2dCamera.position.x + 600) + g2dUtility.randomRange((_player.velocity.x / 10), (_player.velocity.x * 1.5)));
}
override public function update():void{
var _local1:SceneEntity;
var _local2:int;
var _local3:String;
var _local4:URLRequest;
if (g2dSound.muted == true){
_muteButton.setAnimation("off");
} else {
if (g2dSound.muted == false){
_muteButton.setAnimation("on");
};
};
if (((((g2dMouse.released()) && ((g2dMouse.position.x >= (700 - 40))))) && ((g2dMouse.position.y <= 40)))){
if (g2dSound.muted == true){
g2dSound.unmute();
} else {
g2dSound.mute();
};
};
_bird.setAnimation("idle");
_rocket.setAnimation("idle");
_icbm.setAnimation("idle");
_retryButton.setAnimation("idle");
_shopButton.setAnimation("idle");
_achivementsButton.setAnimation("idle");
_resultsButton.setAnimation("idle");
_scoreDistanceButton.setAnimation("idle");
_moreGamesButton.setAnimation("idle");
switch (_state){
case AIMING:
if (_aimAngleDirection == "up"){
_aimAngle = (_aimAngle - ((90 - (15 * SaveData.accuracy)) * g2dTime.deltaTime));
if (_aimAngle < 1){
_aimAngle = 1;
_aimAngleDirection = "down";
};
} else {
if (_aimAngleDirection == "down"){
_aimAngle = (_aimAngle + ((90 - (15 * SaveData.accuracy)) * g2dTime.deltaTime));
if (_aimAngle > 90){
_aimAngle = 90;
_aimAngleDirection = "up";
};
};
};
_aimCurve.gotoAndStop((90 - int(_aimAngle)));
if (((((g2dMouse.pressed()) && ((g2dMouse.position.x < (740 - 40))))) && ((g2dMouse.position.y > 40)))){
_state = POWERING;
_startDistance = _player.position.x;
_aimCurve.target.gotoAndStop(2);
};
break;
case POWERING:
if (_aimPowerDirection == "up"){
_aimPower = (_aimPower + ((1.5 - (0.3 * SaveData.accuracy)) * g2dTime.deltaTime));
if (_aimPower > 1.5){
_aimPower = 1.5;
_aimPowerDirection = "down";
};
} else {
if (_aimPowerDirection == "down"){
_aimPower = (_aimPower - ((1.5 - (0.3 * SaveData.accuracy)) * g2dTime.deltaTime));
if (_aimPower < 1){
_aimPower = 1;
_aimPowerDirection = "up";
};
};
};
_aimCurve.target.scaleX = (_aimCurve.target.scaleY = _aimPower);
if (((((g2dMouse.pressed()) && ((g2dMouse.position.x < (740 - 40))))) && ((g2dMouse.position.y > 40)))){
_tutorialShowing = false;
if (_playingEpicMusic == false){
g2dSound.stopAll();
g2dSound.play(SoundBank.flightMusic, true);
_playingEpicMusic = true;
};
_launches++;
Achivements.unlock("first");
if (_aimPower >= 1.45){
Achivements.unlock("perfect");
};
if (_launches >= 50){
Achivements.unlock("fifty");
};
g2dSound.play(SoundBank.catapult);
if (((((SaveData.duck) || (SaveData.rocket))) || (SaveData.icbm))){
_canBoost = true;
};
_state = FLYING;
_catapult.launch();
_player.launch(_catapult, _aimAngle, (_aimPower * _catapult.power));
};
break;
case FLYING:
_distanceText.description.text = (Math.floor(((_player.position.x - _startDistance) / 10)) + " metres");
if (_nextEntity < g2dCamera.position.x){
spawnEntity();
};
if ((((((((((_canBoost == true)) && ((g2dMouse.position.x >= 0)))) && ((g2dMouse.position.x <= 120)))) && ((g2dMouse.position.y >= 30)))) && ((g2dMouse.position.y <= 130)))){
_bird.setAnimation("glow");
_rocket.setAnimation("glow");
_icbm.setAnimation("glow");
if (g2dMouse.released()){
_canBoost = false;
_player.useBooster();
if (SaveData.icbm == true){
Achivements.unlock("icbm");
};
};
};
_catapult.update();
_player.update();
_bear.update();
for each (_local1 in _sceneEntities) {
_local1.update();
if (((!((_player.state == Player.STANDING))) && (!((_player.state == Player.ROCKETING))))){
_local1.checkPlayerCollision(_player);
};
};
if ((((_player.state == Player.LAUNCHED)) || ((_player.state == Player.BOUNCING)))){
_player.velocity.y = (_player.velocity.y + (1600 * g2dTime.deltaTime));
if (_player.velocity.y > 5000){
_player.velocity.y = 5000;
};
if (_player.position.y >= 370){
_player.position.y = 369;
_player.bounce();
};
};
if (_player.state == Player.STANDING){
if (_player.position.x > _personalBest){
_personalBest = _player.position.x;
_personalBestSprite.setAnimation("idle");
if (_personalBest > 100000){
Achivements.unlock("100k");
};
};
_canBoost = false;
_bear.chase();
_endDistance = _player.position.x;
_state = CHASING;
};
break;
case CHASING:
_player.update();
_bear.update();
for each (_local1 in _sceneEntities) {
_local1.update();
};
if ((_bear.position.x - 700) > g2dCamera.position.x){
if (Math.floor((_endDistance - _startDistance)) > SaveData.bestDistance){
SaveData.bestDistance = Math.floor((_endDistance - _startDistance));
};
_scoreDistanceText.description.text = (("BEST DISTANCE OF " + Math.floor((SaveData.bestDistance / 10))) + " METRES");
_state = SCORING;
SaveData.money = (SaveData.money + Math.floor(((_endDistance - _startDistance) / 100)));
_moneyText.description.text = ("Earned $" + Math.floor(((_endDistance - _startDistance) / 100)));
};
break;
case SCORING:
if ((((((((g2dMouse.position.x >= ((360 - 128) - 36))) && ((g2dMouse.position.x <= ((360 - 128) + 36))))) && ((g2dMouse.position.y >= 230)))) && ((g2dMouse.position.y <= 260)))){
_retryButton.setAnimation("glow");
if (g2dMouse.released()){
switch (_scene){
case "grass":
_scene = "suburbs";
break;
case "suburbs":
_scene = "city";
break;
case "city":
_scene = "grass";
break;
};
SaveData.highscore = false;
_game.removeGameState(this);
_game.addGameState(new PlayGameState(_game));
};
};
if ((((((((g2dMouse.position.x >= ((360 + 128) - 36))) && ((g2dMouse.position.x <= ((360 + 128) + 36))))) && ((g2dMouse.position.y >= 230)))) && ((g2dMouse.position.y <= 260)))){
_shopButton.setAnimation("glow");
if (g2dMouse.released()){
switch (_scene){
case "grass":
_scene = "suburbs";
break;
case "suburbs":
_scene = "city";
break;
case "city":
_scene = "grass";
break;
};
SaveData.highscore = false;
_game.removeGameState(this);
_game.addGameState(new ShopGameState(_game));
};
};
if ((((((((g2dMouse.position.x >= (360 - 60))) && ((g2dMouse.position.x <= (360 + 60))))) && ((g2dMouse.position.y >= 230)))) && ((g2dMouse.position.y <= 260)))){
_achivementsButton.setAnimation("glow");
_resultsButton.setAnimation("glow");
if (g2dMouse.released()){
_achivementDisplay = !(_achivementDisplay);
};
};
if ((((((((g2dMouse.position.x >= 150)) && ((g2dMouse.position.x <= 325)))) && ((g2dMouse.position.y >= 360)))) && ((g2dMouse.position.y <= 390)))){
_scoreDistanceButton.setAnimation("glow");
if (g2dMouse.released()){
SaveData.highscore = true;
};
};
if ((((((((g2dMouse.position.x >= 375)) && ((g2dMouse.position.x <= 550)))) && ((g2dMouse.position.y >= 360)))) && ((g2dMouse.position.y <= 390)))){
_moreGamesButton.setAnimation("glow");
if (g2dMouse.released()){
_local3 = "http://www.bubblebox.com/clickreg.php?type=gamestats&id=1772&subid=moregames";
_local4 = new URLRequest(_local3);
navigateToURL(_local4, "_blank");
};
};
if (((((((g2dMouse.released()) && ((g2dMouse.position.x >= 450)))) && ((g2dMouse.position.x <= 650)))) && ((g2dMouse.position.y <= 40)))){
if (g2dMouse.released()){
_local3 = "http://www.bubblebox.com/clickreg.php?type=gamestats&id=1772&subid=muteicon";
_local4 = new URLRequest(_local3);
navigateToURL(_local4, "_blank");
};
};
_player.update();
_bear.update();
for each (_local1 in _sceneEntities) {
_local1.update();
};
break;
};
if (_player.state != Player.STANDING){
g2dCamera.target.x = (_player.position.x - 350);
g2dCamera.target.y = (_player.position.y - 215);
};
_local2 = 0;
while (_local2 < _sceneEntities.length) {
if ((_sceneEntities[_local2].position.x + 200) < g2dCamera.position.x){
g2dEntity.destroy(_sceneEntities[_local2]);
_sceneEntities.splice(_local2, 1);
_local2--;
};
_local2++;
};
Achivements.update();
}
}
}//package
Section 125
//PlaygroundSound (PlaygroundSound)
package {
import flash.media.*;
public dynamic class PlaygroundSound extends Sound {
}
}//package
Section 126
//QuackSound (QuackSound)
package {
import flash.media.*;
public dynamic class QuackSound extends Sound {
}
}//package
Section 127
//ResultsButtonSprite (ResultsButtonSprite)
package {
import flash.display.*;
public dynamic class ResultsButtonSprite extends MovieClip {
}
}//package
Section 128
//RetryButtonSprite (RetryButtonSprite)
package {
import flash.display.*;
public dynamic class RetryButtonSprite extends MovieClip {
}
}//package
Section 129
//RightBird (RightBird)
package {
import g2d.*;
public class RightBird extends BoosterEntity {
public function RightBird(){
_sprite = new g2dSprite("RightBird");
_radius = 50;
_horizontalMultiplier = 1000;
_verticalMultiplier = 1000;
_explode = true;
_velocity.x = 120;
}
}
}//package
Section 130
//RightBirdSprite (RightBirdSprite)
package {
import flash.display.*;
public dynamic class RightBirdSprite extends MovieClip {
}
}//package
Section 131
//RocketButtonSprite (RocketButtonSprite)
package {
import flash.display.*;
public dynamic class RocketButtonSprite extends MovieClip {
}
}//package
Section 132
//RocketSound (RocketSound)
package {
import flash.media.*;
public dynamic class RocketSound extends Sound {
}
}//package
Section 133
//Sandbox (Sandbox)
package {
import g2d.*;
public class Sandbox extends BlockerEntity {
public function Sandbox(){
_sprite = new g2dSprite("Sandbox");
_radius = 70;
}
}
}//package
Section 134
//SandboxSprite (SandboxSprite)
package {
import flash.display.*;
public dynamic class SandboxSprite extends MovieClip {
}
}//package
Section 135
//SaveData (SaveData)
package {
public class SaveData {
public static var money:Number = 0;
public static var accuracy:Number = 0;
public static var bestDistance:Number = 0;
public static var skelepult:Boolean = false;
public static var metalpult:Boolean = false;
public static var patchpult:Boolean = false;
public static var rocket:Boolean = false;
public static var spoonpult:Boolean = false;
public static var icbm:Boolean = false;
public static var bounces:Number = 0;
public static var highscore:Boolean = false;
public static var duck:Boolean = false;
public static var explosions:Number = 0;
}
}//package
Section 136
//SceneEntity (SceneEntity)
package {
import g2d.*;
public class SceneEntity extends g2dEntity {
protected var _radius:Number;// = 200
public function SceneEntity(){
_radius = 200;
super();
_sprite = new g2dSprite("SceneObject");
}
public function checkPlayerCollision(_arg1:Player):Boolean{
if (_position.distance(_arg1.position) <= _radius){
return (true);
};
return (false);
}
}
}//package
Section 137
//SceneObjectSprite (SceneObjectSprite)
package {
import flash.display.*;
public dynamic class SceneObjectSprite extends MovieClip {
}
}//package
Section 138
//ScoreDistanceText (ScoreDistanceText)
package {
import flash.display.*;
import flash.text.*;
public dynamic class ScoreDistanceText extends MovieClip {
public var description:TextField;
}
}//package
Section 139
//ShopBackgroundSprite (ShopBackgroundSprite)
package {
import flash.display.*;
public dynamic class ShopBackgroundSprite extends MovieClip {
}
}//package
Section 140
//ShopButtonSprite (ShopButtonSprite)
package {
import flash.display.*;
public dynamic class ShopButtonSprite extends MovieClip {
}
}//package
Section 141
//ShopGameState (ShopGameState)
package {
import g2d.*;
import flash.geom.*;
public class ShopGameState extends g2dGameState {
protected var _rocket:g2dSprite;
protected var _back:g2dSprite;
protected var _accuracyCard:g2dSprite;
protected var _icbm:g2dSprite;
protected var _background:g2dSprite;
protected var _skelepult:g2dSprite;
protected var _metalpult:g2dSprite;
protected var _patchpult:g2dSprite;
protected var _accuracy:g2dSprite;
protected var _bouncesCard:g2dSprite;
protected var _explosions:g2dSprite;
protected var _funds:g2dText;
protected var _explosionsCard:g2dSprite;
protected var _spoonpult:g2dSprite;
protected var _bird:g2dSprite;
protected var _item:g2dText;
protected var _bounces:g2dSprite;
protected var _sponsorLogo:SponsorLogo;
protected var _cost:g2dText;
public function ShopGameState(_arg1:g2dGame){
_sponsorLogo = new SponsorLogo();
super(_arg1);
_background = new g2dSprite("ShopBackground");
_back = new g2dSprite("BackButton");
_metalpult = new g2dSprite("MetalpultButton");
_spoonpult = new g2dSprite("SpoonpultButton");
_skelepult = new g2dSprite("SkelepultButton");
_patchpult = new g2dSprite("PatchpultButton");
_bounces = new g2dSprite("BouncesButton");
_bouncesCard = new g2dSprite("VersionCard", "v1");
_accuracy = new g2dSprite("AccuracyButton");
_accuracyCard = new g2dSprite("VersionCard", "v1");
_explosions = new g2dSprite("ExplosionsButton");
_explosionsCard = new g2dSprite("VersionCard", "v1");
_bird = new g2dSprite("BirdButton");
_rocket = new g2dSprite("RocketButton");
_icbm = new g2dSprite("IcbmButton");
_funds = new g2dText(new Garfield16(), "Funds: $", new g2dVector2(438, 400), 16, 4294559750);
_item = new g2dText(new Garfield16(), "", new g2dVector2(500, 334), 16, 4294559750);
_cost = new g2dText(new Garfield16(), "", new g2dVector2(500, 356), 16, 4294559750);
g2dCamera.min.x = (g2dCamera.min.y = (g2dCamera.max.x = (g2dCamera.max.y = 0)));
}
override public function draw(_arg1:g2dCanvas):void{
var _local2:Number;
var _local3:Number;
var _local4:g2dVector2;
var _local5:Matrix;
_local2 = 0;
_local3 = 0;
_local4 = g2dUtility.vector;
_local5 = g2dUtility.matrix;
_local4.x = 0;
_local4.y = 0;
_background.draw(_arg1, _local4);
_local4.x = 40;
_local4.y = 400;
_back.draw(_arg1, _local4);
_local4.x = 115;
_local4.y = 105;
if (SaveData.metalpult == false){
_metalpult.draw(_arg1, _local4);
} else {
if (SaveData.spoonpult == false){
_spoonpult.draw(_arg1, _local4);
} else {
if (SaveData.skelepult == false){
_skelepult.draw(_arg1, _local4);
} else {
if (SaveData.patchpult == false){
_patchpult.draw(_arg1, _local4);
};
};
};
};
if (SaveData.bounces != 3){
_local4.x = 590;
_local4.y = 105;
_bounces.draw(_arg1, _local4);
_local4.x = 620;
_local4.y = 105;
_bouncesCard.draw(_arg1, _local4);
};
if (SaveData.accuracy != 3){
_local4.x = 115;
_local4.y = 230;
_accuracy.draw(_arg1, _local4);
_local4.x = 145;
_local4.y = 230;
_accuracyCard.draw(_arg1, _local4);
};
if (SaveData.explosions != 3){
_local4.x = 590;
_local4.y = 230;
_explosions.draw(_arg1, _local4);
_local4.x = 620;
_local4.y = 230;
_explosionsCard.draw(_arg1, _local4);
};
if (SaveData.duck == false){
_local4.x = 160;
_local4.y = 415;
_bird.draw(_arg1, _local4);
};
if (SaveData.rocket == false){
_local4.x = (160 + 100);
_local4.y = 405;
_rocket.draw(_arg1, _local4);
};
if (SaveData.icbm == false){
_local4.x = (160 + 200);
_local4.y = 415;
_icbm.draw(_arg1, _local4);
};
_funds.draw(_arg1);
_item.draw(_arg1);
_cost.draw(_arg1);
Achivements.draw(_arg1);
}
override public function update():void{
if (g2dKeyboard.released(g2dKeys.SPACE)){
trace(((g2dMouse.position.x + ",") + g2dMouse.position.y));
};
_back.setAnimation("idle");
_metalpult.setAnimation("idle");
_spoonpult.setAnimation("idle");
_skelepult.setAnimation("idle");
_patchpult.setAnimation("idle");
_bounces.setAnimation("idle");
_accuracy.setAnimation("idle");
_explosions.setAnimation("idle");
_bird.setAnimation("idle");
_rocket.setAnimation("idle");
_icbm.setAnimation("idle");
switch (SaveData.bounces){
case 0:
_bouncesCard.setAnimation("v1");
break;
case 1:
_bouncesCard.setAnimation("v2");
break;
case 2:
_bouncesCard.setAnimation("v3");
break;
};
switch (SaveData.accuracy){
case 0:
_accuracyCard.setAnimation("v1");
break;
case 1:
_accuracyCard.setAnimation("v2");
break;
case 2:
_accuracyCard.setAnimation("v3");
break;
};
switch (SaveData.explosions){
case 0:
_explosionsCard.setAnimation("v1");
break;
case 1:
_explosionsCard.setAnimation("v2");
break;
case 2:
_explosionsCard.setAnimation("v3");
break;
};
_funds.text = ("Funds: $" + SaveData.money);
_item.text = "";
_cost.text = "";
if ((((((((g2dMouse.position.x >= 0)) && ((g2dMouse.position.x <= 75)))) && ((g2dMouse.position.y >= 390)))) && ((g2dMouse.position.y <= 433)))){
_back.setAnimation("highlight");
if (g2dMouse.released()){
_game.removeGameState(this);
_game.addGameState(new PlayGameState(_game));
};
};
if ((((((((g2dMouse.position.x >= 16)) && ((g2dMouse.position.x <= 200)))) && ((g2dMouse.position.y >= 20)))) && ((g2dMouse.position.y <= 120)))){
_metalpult.setAnimation("glow");
_spoonpult.setAnimation("glow");
_skelepult.setAnimation("glow");
_patchpult.setAnimation("glow");
if (SaveData.metalpult == false){
_item.text = "Metalpult";
_cost.text = "$250";
if (((g2dMouse.released()) && ((SaveData.money >= 250)))){
SaveData.money = (SaveData.money - 250);
SaveData.metalpult = true;
g2dSound.play(SoundBank.money);
Achivements.unlock("metalpult");
};
} else {
if (SaveData.spoonpult == false){
_item.text = "Spoonpult";
_cost.text = "$1,500";
if (((g2dMouse.released()) && ((SaveData.money >= 1500)))){
SaveData.money = (SaveData.money - 1500);
SaveData.spoonpult = true;
g2dSound.play(SoundBank.money);
};
} else {
if (SaveData.skelepult == false){
_item.text = "Skelepult";
_cost.text = "$5,000";
if (((g2dMouse.released()) && ((SaveData.money >= 5000)))){
SaveData.money = (SaveData.money - 5000);
SaveData.skelepult = true;
g2dSound.play(SoundBank.money);
};
} else {
if (SaveData.patchpult == false){
_item.text = "Patchpult";
_cost.text = "$15,000";
if (((g2dMouse.released()) && ((SaveData.money >= 15000)))){
SaveData.money = (SaveData.money - 15000);
SaveData.patchpult = true;
g2dSound.play(SoundBank.money);
Achivements.unlock("patchpult");
};
};
};
};
};
};
if ((((((((g2dMouse.position.x >= 546)) && ((g2dMouse.position.x <= 636)))) && ((g2dMouse.position.y >= 0)))) && ((g2dMouse.position.y <= 120)))){
_bounces.setAnimation("glow");
if (SaveData.bounces == 0){
_item.text = "Bigger Bounces (1/3)";
_cost.text = "$50";
if (((g2dMouse.released()) && ((SaveData.money >= 50)))){
SaveData.money = (SaveData.money - 50);
SaveData.bounces = 1;
g2dSound.play(SoundBank.money);
};
} else {
if (SaveData.bounces == 1){
_item.text = "Bigger Bounces (2/3)";
_cost.text = "$750";
if (((g2dMouse.released()) && ((SaveData.money >= 750)))){
SaveData.money = (SaveData.money - 750);
SaveData.bounces = 2;
g2dSound.play(SoundBank.money);
};
} else {
if (SaveData.bounces == 2){
_item.text = "Bigger Bounces (3/3)";
_cost.text = "$2,000";
if (((g2dMouse.released()) && ((SaveData.money >= 2000)))){
SaveData.money = (SaveData.money - 2000);
SaveData.bounces = 3;
g2dSound.play(SoundBank.money);
};
};
};
};
};
if ((((((((g2dMouse.position.x >= 70)) && ((g2dMouse.position.x <= 160)))) && ((g2dMouse.position.y >= 145)))) && ((g2dMouse.position.y <= 235)))){
_accuracy.setAnimation("glow");
if (SaveData.accuracy == 0){
_item.text = "Slower Target (1/3)";
_cost.text = "$50";
if (((g2dMouse.released()) && ((SaveData.money >= 50)))){
SaveData.money = (SaveData.money - 50);
SaveData.accuracy = 1;
g2dSound.play(SoundBank.money);
};
} else {
if (SaveData.accuracy == 1){
_item.text = "Slower Target (2/3)";
_cost.text = "$750";
if (((g2dMouse.released()) && ((SaveData.money >= 750)))){
SaveData.money = (SaveData.money - 750);
SaveData.accuracy = 2;
g2dSound.play(SoundBank.money);
};
} else {
if (SaveData.accuracy == 2){
_item.text = "Slower Target (3/3)";
_cost.text = "$2,000";
if (((g2dMouse.released()) && ((SaveData.money >= 2000)))){
SaveData.money = (SaveData.money - 2000);
SaveData.accuracy = 3;
g2dSound.play(SoundBank.money);
};
};
};
};
};
if ((((((((g2dMouse.position.x >= 546)) && ((g2dMouse.position.x <= 636)))) && ((g2dMouse.position.y >= 145)))) && ((g2dMouse.position.y <= 235)))){
_explosions.setAnimation("glow");
if (SaveData.explosions == 0){
_item.text = "Bigger Booms (1/3)";
_cost.text = "$50";
if (((g2dMouse.released()) && ((SaveData.money >= 50)))){
SaveData.money = (SaveData.money - 50);
SaveData.explosions = 1;
g2dSound.play(SoundBank.money);
};
} else {
if (SaveData.explosions == 1){
_item.text = "Bigger Booms (2/3)";
_cost.text = "$750";
if (((g2dMouse.released()) && ((SaveData.money >= 750)))){
SaveData.money = (SaveData.money - 750);
SaveData.explosions = 2;
g2dSound.play(SoundBank.money);
};
} else {
if (SaveData.explosions == 2){
_item.text = "Bigger Booms (3/3)";
_cost.text = "$2,000";
if (((g2dMouse.released()) && ((SaveData.money >= 2000)))){
SaveData.money = (SaveData.money - 2000);
SaveData.explosions = 3;
g2dSound.play(SoundBank.money);
};
};
};
};
};
if ((((((((((SaveData.duck == false)) && ((g2dMouse.position.x >= 125)))) && ((g2dMouse.position.x <= 190)))) && ((g2dMouse.position.y >= 320)))) && ((g2dMouse.position.y <= 420)))){
_bird.setAnimation("glow");
_item.text = "Duck (Booster)";
_cost.text = "$500";
if (((((g2dMouse.released()) && ((SaveData.duck == false)))) && ((SaveData.money >= 500)))){
SaveData.duck = true;
SaveData.money = (SaveData.money - 500);
g2dSound.play(SoundBank.money);
};
};
if ((((((((((SaveData.rocket == false)) && ((g2dMouse.position.x >= 220)))) && ((g2dMouse.position.x <= 320)))) && ((g2dMouse.position.y >= 320)))) && ((g2dMouse.position.y <= 420)))){
_rocket.setAnimation("glow");
_item.text = "Rocket (Booster)";
_cost.text = "$2,000";
if (((((g2dMouse.released()) && ((SaveData.rocket == false)))) && ((SaveData.money >= 2000)))){
SaveData.rocket = true;
SaveData.money = (SaveData.money - 2000);
g2dSound.play(SoundBank.money);
};
};
if ((((((((((SaveData.icbm == false)) && ((g2dMouse.position.x >= 325)))) && ((g2dMouse.position.x <= 415)))) && ((g2dMouse.position.y >= 320)))) && ((g2dMouse.position.y <= 420)))){
_icbm.setAnimation("glow");
_item.text = "ICBM (Booster)";
_cost.text = "$5,000";
if (((g2dMouse.released()) && ((SaveData.money >= 5000)))){
SaveData.icbm = true;
SaveData.money = (SaveData.money - 5000);
g2dSound.play(SoundBank.money);
};
};
if ((((((((((((((((((((SaveData.accuracy == 3)) && ((SaveData.bounces == 3)))) && ((SaveData.duck == true)))) && ((SaveData.explosions == 3)))) && ((SaveData.icbm == true)))) && ((SaveData.metalpult == true)))) && ((SaveData.patchpult == true)))) && ((SaveData.rocket == true)))) && ((SaveData.skelepult == true)))) && ((SaveData.spoonpult == true)))){
Achivements.unlock("patchman");
};
Achivements.update();
}
}
}//package
Section 142
//SkelepultButtonSprite (SkelepultButtonSprite)
package {
import flash.display.*;
public dynamic class SkelepultButtonSprite extends MovieClip {
}
}//package
Section 143
//SkySprite (SkySprite)
package {
import flash.display.*;
public dynamic class SkySprite extends MovieClip {
}
}//package
Section 144
//SoundBank (SoundBank)
package {
public class SoundBank {
public static var money:MoneySound = new MoneySound();
public static var thud:ThudSound = new ThudSound();
public static var mainMusic:MainMusic = new MainMusic();
public static var quack:QuackSound = new QuackSound();
public static var icbm:IcbmSound = new IcbmSound();
public static var rocket:RocketSound = new RocketSound();
public static var explosion:ExplosionSound = new ExplosionSound();
public static var catapult:CatapultSound = new CatapultSound();
public static var playground:PlaygroundSound = new PlaygroundSound();
public static var flightMusic:FlightMusic = new FlightMusic();
public static var lawnmower:LawnmowerSound = new LawnmowerSound();
}
}//package
Section 145
//SpaceIndicatorSprite (SpaceIndicatorSprite)
package {
import flash.display.*;
public dynamic class SpaceIndicatorSprite extends MovieClip {
}
}//package
Section 146
//Spinner (Spinner)
package {
import g2d.*;
public class Spinner extends BoosterEntity {
public function Spinner(){
_sprite = new g2dSprite("Spinner");
_radius = 120;
_horizontalMultiplier = 1500;
_verticalMultiplier = 500;
_explode = false;
}
}
}//package
Section 147
//SpinnerSprite (SpinnerSprite)
package {
import flash.display.*;
public dynamic class SpinnerSprite extends MovieClip {
}
}//package
Section 148
//SponsorLogo (SponsorLogo)
package {
import flash.display.*;
public dynamic class SponsorLogo extends MovieClip {
public var logo_ro:MovieClip;
public function SponsorLogo(){
addFrameScript(0, frame1);
}
function frame1(){
}
}
}//package
Section 149
//SponsorLogo2 (SponsorLogo2)
package {
import flash.display.*;
public dynamic class SponsorLogo2 extends MovieClip {
public var logo_ro:MovieClip;
}
}//package
Section 150
//SpoonpultButtonSprite (SpoonpultButtonSprite)
package {
import flash.display.*;
public dynamic class SpoonpultButtonSprite extends MovieClip {
}
}//package
Section 151
//ThudSound (ThudSound)
package {
import flash.media.*;
public dynamic class ThudSound extends Sound {
}
}//package
Section 152
//TutorialSprite (TutorialSprite)
package {
import flash.display.*;
import flash.text.*;
public dynamic class TutorialSprite extends MovieClip {
public var description:TextField;
}
}//package
Section 153
//VersionCardSprite (VersionCardSprite)
package {
import flash.display.*;
public dynamic class VersionCardSprite extends MovieClip {
}
}//package