Section 1
//BaseFlare (anim.BaseFlare)
package anim {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class BaseFlare extends MovieClip {
protected var m_isLoop:Boolean;
protected var m_frameRate:int;
protected var m_isPaused:Boolean;
protected var m_isRemoveAfterPlay:Boolean;
private var m_startTime:int;
private var m_restartAt:int;
private var m_frameOffset:int;
private var m_startDelay:int;
private var m_firstRender:Boolean;
private var m_step:Number;
private var m_lastFrame:uint;
public function BaseFlare(){
super.stop();
m_lastFrame = 0;
m_restartAt = 0;
m_frameOffset = 0;
m_isPaused = false;
m_isRemoveAfterPlay = true;
m_firstRender = true;
m_isLoop = true;
m_startDelay = -1;
if (!m_isPaused){
start();
};
setFrameRate(30);
}
public function setStartDelay(_arg1:int):void{
m_startDelay = _arg1;
}
public function setLoopRestartFrame(_arg1:int):void{
m_restartAt = (_arg1 - 1);
}
public function start():void{
visible = true;
m_lastFrame = 0;
m_firstRender = true;
addEventListener(Event.ENTER_FRAME, enterFrame);
}
override public function stop():void{
m_firstRender = true;
removeEventListener(Event.ENTER_FRAME, enterFrame);
if (m_isRemoveAfterPlay){
parent.removeChild(this);
};
}
public function setFrameRate(_arg1:int):void{
m_frameRate = _arg1;
m_step = ((1 / m_frameRate) * 1000);
}
public function setLoop(_arg1:Boolean):void{
m_isLoop = _arg1;
}
public function setDestroyAfterPlay(_arg1:Boolean):void{
m_isRemoveAfterPlay = _arg1;
}
public function enterFrame(_arg1:Event):void{
var _local2:int = getTimer();
if (((!(m_firstRender)) && (!((m_startDelay == -1))))){
if (_local2 < m_startDelay){
return;
};
visible = true;
m_startTime = _local2;
m_startDelay = -1;
};
if (m_firstRender){
m_firstRender = false;
if (m_startDelay != -1){
m_startDelay = (m_startDelay + _local2);
return;
};
visible = true;
m_startTime = _local2;
};
var _local3:uint = (m_frameOffset + int(Math.round((((_local2 - m_startTime) / m_step) + 1))));
if (_local3 > totalFrames){
if (m_isLoop){
m_firstRender = true;
m_frameOffset = m_restartAt;
_local3 = totalFrames;
} else {
gotoAndStop(totalFrames);
stop();
return;
};
};
if (_local3 != m_lastFrame){
gotoAndStop(_local3);
m_lastFrame = _local3;
};
}
}
}//package anim
Section 2
//EaseOutQuadInterpolator (anim.EaseOutQuadInterpolator)
package anim {
public class EaseOutQuadInterpolator extends Interpolator {
public function EaseOutQuadInterpolator(_arg1:Number, _arg2:Number, _arg3:int){
super(_arg1, _arg2, _arg3);
}
override public function nextPosition():void{
var _local1:Number = m_dt;
if (_local1 > m_duration){
_local1 = m_duration;
};
var _local2:Number = (m_duration * m_duration);
var _local3:Number = (_local1 * _local1);
m_value = ((((-(m_dv) * _local3) / _local2) + (((2 * m_dv) * _local1) / m_duration)) + m_startValue);
}
}
}//package anim
Section 3
//Interpolator (anim.Interpolator)
package anim {
public class Interpolator {
protected var m_finished:Boolean;
protected var m_duration:int;
protected var m_value:Number;
protected var m_dv:Number;
protected var m_targetValue:Number;
protected var m_startValue:Number;
protected var m_dt:int;
public function Interpolator(_arg1:Number, _arg2:Number, _arg3:int){
m_startValue = _arg1;
m_targetValue = _arg2;
m_duration = _arg3;
m_dt = 0;
m_value = _arg1;
m_finished = false;
m_dv = (m_targetValue - m_startValue);
}
public function isDone():Boolean{
return (m_finished);
}
public function getValue():Number{
return (m_value);
}
public function getTargetValue():Number{
return (m_targetValue);
}
public function getElapsedPercent():Number{
if (m_duration == 0){
return (1);
};
return ((Math.max(0, (m_duration - m_dt)) / m_duration));
}
public function update():Boolean{
if (!m_finished){
m_dt++;
nextPosition();
if ((((((m_value >= m_targetValue)) && ((m_targetValue >= m_startValue)))) || ((((m_value <= m_targetValue)) && ((m_targetValue <= m_startValue)))))){
m_value = m_targetValue;
m_finished = true;
};
};
return (m_finished);
}
public function nextPosition():void{
m_value = (((m_dv * m_dt) / m_duration) + m_startValue);
}
}
}//package anim
Section 4
//PausedLoopingFlare25Fps (anim.PausedLoopingFlare25Fps)
package anim {
import flash.display.*;
public class PausedLoopingFlare25Fps extends BaseFlare {
public var inner:MovieClip;
public function PausedLoopingFlare25Fps(){
m_isPaused = true;
m_isLoop = true;
m_isRemoveAfterPlay = false;
setFrameRate(25);
stop();
}
}
}//package anim
Section 5
//PausedLoopingFlare30Fps (anim.PausedLoopingFlare30Fps)
package anim {
public class PausedLoopingFlare30Fps extends BaseFlare {
public function PausedLoopingFlare30Fps(){
m_isPaused = true;
m_isLoop = true;
m_isRemoveAfterPlay = false;
setFrameRate(30);
stop();
}
}
}//package anim
Section 6
//PausedSingleFlareDestroy25Fps (anim.PausedSingleFlareDestroy25Fps)
package anim {
public class PausedSingleFlareDestroy25Fps extends BaseFlare {
public function PausedSingleFlareDestroy25Fps(){
m_isPaused = false;
m_isLoop = false;
m_isRemoveAfterPlay = true;
setFrameRate(25);
}
}
}//package anim
Section 7
//AimCursor (game.AimCursor)
package game {
import flash.display.*;
import timing.*;
import math.*;
public class AimCursor extends MovieClip {
public var aim0:MovieClip;
public var aim1:MovieClip;
public var aim2:MovieClip;
public var aim3:MovieClip;
public var aim4:MovieClip;
public var aim5:MovieClip;
public var aim6:MovieClip;
public var aim7:MovieClip;
public var aim8:MovieClip;
private var m_mx:int;
private var m_my:int;
private var m_ax:int;
private var m_ay:int;
private var m_dx:int;
private var m_dy:int;
private var m_vx1:int;
private var m_vx2:int;
private var m_vy1:int;
private var m_vy2:int;
private var m_fr:IFloat;
private var m_dist:Number;
private var m_lastRad:Number;
private var m_lengthOffset:Number;
private var m_r:Number;
private var m_limit1:Number;
private var m_limit2:Number;
public function AimCursor(){
m_fr = new IFloat(0);
m_limit1 = (-3.1414 + Math.PI);
m_limit2 = (0.0001 + Math.PI);
m_lengthOffset = 87;
m_lastRad = 0.1234;
stop();
}
public function setColor(_arg1:int):void{
var _local3:*;
var _local2:* = 0;
while (_local2 < 9) {
_local3 = getChildByName(("aim" + _local2));
_local3.gotoAndStop(_arg1);
_local2++;
};
}
public function setArrowLength(_arg1:int):void{
m_lengthOffset = _arg1;
}
public function setRadLimits(_arg1:Number, _arg2:Number):void{
m_limit1 = (_arg1 + Math.PI);
m_limit2 = (_arg2 + Math.PI);
}
public function setVisibleLimit(_arg1:int, _arg2:int, _arg3:int, _arg4:int):void{
m_vx1 = _arg1;
m_vx2 = _arg3;
m_vy1 = _arg2;
m_vy2 = _arg4;
}
public function setAncorPosition(_arg1:int, _arg2:int):void{
m_ax = _arg1;
m_ay = _arg2;
}
public function tick(_arg1:int, _arg2:int):void{
m_mx = _arg1;
m_my = _arg2;
m_dx = (m_ax - m_mx);
m_dy = (m_ay - Math.min((m_ay - 30), m_my));
m_r = XPMath.atan2(m_dy, m_dx);
if (m_r < m_limit1){
m_r = m_limit1;
};
if (m_r > m_limit2){
m_r = m_limit2;
};
m_fr.set(m_r);
m_dist = (Math.max(0, (Math.sqrt(((m_dx * m_dx) + (m_dy * m_dy))) - m_lengthOffset)) / 8);
}
public function update(_arg1:int, _arg2:Number):void{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:*;
var _local11:*;
var _local3:Number = m_fr.value;
if (_local3 != m_lastRad){
x = m_ax;
y = m_ay;
m_lastRad = _local3;
_local4 = XPMath.cos(_local3);
_local5 = (-(_local4) * m_lengthOffset);
_local6 = (m_dist * _local4);
_local7 = XPMath.sin(_local3);
_local8 = (-(_local7) * m_lengthOffset);
_local9 = (m_dist * _local7);
_local10 = 0;
while (_local10 < 9) {
_local11 = getChildByName(("aim" + _local10));
_local11.x = _local5;
_local11.y = _local8;
_local5 = (_local5 - _local6);
_local8 = (_local8 - _local9);
_local10++;
};
};
}
}
}//package game
Section 8
//BigPopper (game.BigPopper)
package game {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
public class BigPopper extends MovieClip {
public var text1:TextField;
public var text2:TextField;
private var bspline:Bspline;
private var pos:Number;// = 0
private var ln:int;
private var speed:Number;
private var multiplier:int;
private var startTime:int;
public function BigPopper(_arg1:int, _arg2:int, _arg3:int=1){
multiplier = _arg3;
gotoAndStop(_arg3);
visible = false;
bspline = new Bspline();
bspline.addPoint(_arg1, _arg2);
bspline.addPoint((588 + (Math.random() * 50)), (-40 + (Math.random() * 20)));
bspline.addPoint(((182 + (Math.random() * 200)) - 100), (95 + (Math.random() * 50)));
bspline.addPoint(0xFF, 0xFF);
ln = bspline.length();
speed = 30;
startTime = -1;
addEventListener(Event.ENTER_FRAME, enterFrame);
}
public function enterFrame(_arg1:Event):void{
var _local2:int = getTimer();
if (startTime < 0){
startTime = _local2;
if (currentFrame == 1){
text1.text = ("+" + multiplier);
} else {
if (currentFrame == 2){
text2.text = ("+" + multiplier);
};
};
visible = true;
};
var _local3:* = bspline.lerp(pos);
if (pos < 0.6){
alpha = (pos / 0.6);
};
if (pos > (ln - 1.45)){
alpha = Math.max(0, (1 - ((pos - (ln - 1.45)) / 0.45)));
};
x = int(_local3[0]);
y = int(_local3[1]);
pos = (((_local2 - startTime) / ((1 / speed) * 1000)) / 10);
speed = (30 - ((_local2 - startTime) / 166));
if (pos > (ln - 0.5)){
removeEventListener(Event.ENTER_FRAME, enterFrame);
parent.removeChild(this);
};
}
}
}//package game
Section 9
//Bspline (game.Bspline)
package game {
public class Bspline {
private var points:Array;
public function Bspline(){
points = [];
super();
}
public function addPoint(_arg1:Number, _arg2:Number):void{
points.push([_arg1, _arg2]);
}
public function lerp(_arg1:Number):Array{
var _local2:int = int(_arg1);
var _local3:* = bernsteinWeight(((_arg1 - _local2) + 2));
var _local4:* = bernsteinWeight(((_arg1 - _local2) + 1));
var _local5:* = bernsteinWeight((_arg1 - _local2));
var _local6:* = bernsteinWeight(((_arg1 - _local2) - 1));
var _local7:* = bernsteinWeight(((_arg1 - _local2) - 2));
var _local8:* = [0, 0];
var _local9:int = (_local2 - 3);
++_local9;
updatePoint(_local9, _local3, _local8);
++_local9;
updatePoint(_local9, _local4, _local8);
++_local9;
updatePoint(_local9, _local5, _local8);
++_local9;
updatePoint(_local9, _local6, _local8);
++_local9;
updatePoint(_local9, _local7, _local8);
return (_local8);
}
public function length():int{
return (points.length);
}
public function clear():void{
points = [];
}
private function bernsteinWeight(_arg1:Number):Number{
var _local2:* = 0;
if (_arg1 <= -1){
_local2 = (2 + _arg1);
return (((1 / 6) * ((_local2 * _local2) * _local2)));
};
if (_arg1 <= 0){
return (((1 / 6) * ((4 - ((6 * _arg1) * _arg1)) - (((3 * _arg1) * _arg1) * _arg1))));
};
if (_arg1 <= 1){
return (((1 / 6) * ((4 - ((6 * _arg1) * _arg1)) + (((3 * _arg1) * _arg1) * _arg1))));
};
if (_arg1 <= 2){
_local2 = (2 - _arg1);
return (((1 / 6) * ((_local2 * _local2) * _local2)));
};
return (0);
}
private function updatePoint(_arg1:int, _arg2:Number, _arg3:Array):void{
if (_arg2 <= 0){
return;
};
var _local4:Array = [0, 0];
var _local5:* = points.length;
if (_local5 <= 1){
return;
};
if ((((_arg1 >= 0)) && ((_arg1 < _local5)))){
_local4 = points[_arg1];
} else {
if (_arg1 < 0){
_local4 = [(points[0][0] - (points[1][0] - points[0][0])), (points[0][1] - (points[1][1] - points[0][1]))];
} else {
_local5--;
_local4 = [(points[_local5][0] - (points[(_local5 - 1)][0] - points[_local5][0])), (points[_local5][1] - (points[(_local5 - 1)][1] - points[_local5][1]))];
};
};
_arg3[0] = (_arg3[0] + (_local4[0] * _arg2));
_arg3[1] = (_arg3[1] + (_local4[1] * _arg2));
}
}
}//package game
Section 10
//Bubble (game.Bubble)
package game {
import flash.display.*;
import timing.*;
import geom.*;
import flash.geom.*;
import math.*;
public class Bubble extends TickObject {
public var bubble:BubbleClip;
private var bubbleParent:DisplayObjectContainer;
public var attachDelay:int;
public var isLineBlast:Boolean;
public var isBonus:Boolean;
public var isStuck:Boolean;
public var arrayX:int;
public var arrayY:int;
public var suggestX:Number;
public var suggestY:Number;
public var isMultiplier:Boolean;
private var m_movement:Vec2D;
private var m_position:Vec2D;
private var m_speed:Number;
private var m_color:int;
private var m_fx:IFloat;
private var m_fy:IFloat;
private var m_oldMovement:Vec2D;
private var m_oldPosition:Vec2D;
private var m_oldSpeed:Number;
private var m_oldColor:int;
private var m_oldFx:IFloat;
private var m_oldFy:IFloat;
private var m_collidableList:Array;
private static const SPEED:int = 15;
public function Bubble(){
m_position = new Vec2D();
isMultiplier = false;
isLineBlast = false;
m_speed = (SPEED * 1.25);
suggestX = -1;
suggestY = -1;
}
public function setCollidableList(_arg1:Array){
m_collidableList = _arg1;
}
public function setBubbleParent(_arg1:DisplayObjectContainer):void{
bubbleParent = _arg1;
}
public function assureFull():void{
if (bubble == null){
bubble = new BubbleClip(this);
bubble.ball.gotoAndStop(m_color);
if (isMultiplier){
bubble.marker_multiply.visible = true;
bubble.marker_multiply.start();
};
if (isLineBlast){
bubble.marker_lineblast.visible = true;
bubble.marker_lineblast.start();
};
};
}
public function getX():int{
return (m_position.x);
}
public function getY():int{
return (m_position.y);
}
public function stick(_arg1:int, _arg2:int):void{
m_movement = null;
setPosition(_arg1, _arg2);
isStuck = true;
isRemoving = true;
}
public function bounceOff():void{
isStuck = false;
isRemoving = true;
m_movement = null;
if (((!((bubble == null))) && (!((bubble.parent == null))))){
bubble.startDrop(0, 0, false, false);
};
}
public function explode():void{
isStuck = false;
if (bubble != null){
if (bubble.parent != null){
if (isLineBlast){
bubble.startLineBlast();
} else {
bubble.startExplosion();
};
};
};
}
public function drop(_arg1:Number, _arg2:Number, _arg3:Boolean, _arg4:Boolean):void{
isStuck = false;
if (bubble != null){
if (bubble.parent != null){
bubble.startDrop(_arg1, _arg2, _arg3, _arg4);
};
};
}
public function remove():void{
isStuck = false;
isRemoving = true;
if (bubble != null){
bubble.stopAnim();
if (bubble.parent != null){
bubble.scaleX = 1;
bubble.scaleY = 1;
bubble.parent.removeChild(bubble);
};
};
bubble = null;
}
public function disableBubble():void{
if (bubble != null){
if (bubble.parent != null){
bubble.marker_multiply.stop();
bubble.marker_multiply.visible = false;
bubble.marker_lineblast.stop();
bubble.marker_lineblast.visible = false;
bubble.scaleX = 1;
bubble.scaleY = 1;
setColorIndex(7);
};
};
}
public function disableBonusMode():void{
if (isBonus){
isBonus = false;
bubble.scaleX = 1;
bubble.scaleY = 1;
setColorIndex(m_color);
};
}
private function interpolateColor(_arg1:ColorTransform, _arg2:ColorTransform, _arg3:Number):ColorTransform{
var _local4:ColorTransform = new ColorTransform();
_local4.redMultiplier = (_arg1.redMultiplier + ((_arg2.redMultiplier - _arg1.redMultiplier) * _arg3));
_local4.greenMultiplier = (_arg1.greenMultiplier + ((_arg2.greenMultiplier - _arg1.greenMultiplier) * _arg3));
_local4.blueMultiplier = (_arg1.blueMultiplier + ((_arg2.blueMultiplier - _arg1.blueMultiplier) * _arg3));
_local4.alphaMultiplier = (_arg1.alphaMultiplier + ((_arg2.alphaMultiplier - _arg1.alphaMultiplier) * _arg3));
_local4.redOffset = (_arg1.redOffset + ((_arg2.redOffset - _arg1.redOffset) * _arg3));
_local4.greenOffset = (_arg1.greenOffset + ((_arg2.greenOffset - _arg1.greenOffset) * _arg3));
_local4.blueOffset = (_arg1.blueOffset + ((_arg2.blueOffset - _arg1.blueOffset) * _arg3));
_local4.alphaOffset = (_arg1.alphaOffset + ((_arg2.alphaOffset - _arg1.alphaOffset) * _arg3));
return (_local4);
}
public function pushState():void{
if (m_movement != null){
m_oldMovement = new Vec2D();
m_oldMovement.copyFrom(m_movement);
};
m_oldFx = new IFloat(0);
m_oldFx.copyFrom(m_fx);
m_oldFy = new IFloat(0);
m_oldFy.copyFrom(m_fy);
m_oldPosition = new Vec2D();
m_oldPosition.copyFrom(m_position);
m_oldSpeed = m_speed;
}
public function popState():void{
if (m_movement != null){
m_movement.copyFrom(m_oldMovement);
};
m_fx.copyFrom(m_oldFx);
m_fy.copyFrom(m_oldFy);
m_position.copyFrom(m_oldPosition);
m_speed = m_oldSpeed;
}
override public function tick(_arg1:int):void{
var _local2:*;
var _local3:*;
var _local4:Line;
var _local5:Boolean;
var _local6:int;
var _local7:Pt;
var _local8:Line;
var _local9:Number;
var _local10:Line;
var _local11:Number;
if (isStuck){
isRemoving = true;
};
if (m_movement){
_local2 = (m_position.x + (m_movement.x * m_speed));
_local3 = (m_position.y + (m_movement.y * m_speed));
_local4 = new Line(m_position.x, m_position.y, _local2, _local3);
_local5 = false;
_local6 = 0;
while (((!(_local5)) && ((_local6 < m_collidableList.length)))) {
_local7 = _local4.intersectionPoint(m_collidableList[_local6]);
if (_local7 != null){
_local8 = new Line(m_position.x, m_position.y, _local7.x, _local7.y);
_local9 = _local8.length();
m_position.x = (m_position.x + (m_movement.x * _local9));
m_position.y = (m_position.y + (m_movement.y * _local9));
_local10 = new Line(_local7.x, _local7.y, _local2, _local3);
_local11 = _local10.length();
m_movement.x = -(m_movement.x);
m_position.x = (m_position.x + (m_movement.x * _local11));
m_position.y = (m_position.y + (m_movement.y * _local11));
_local5 = true;
};
_local6++;
};
if (!_local5){
m_position.x = (m_position.x + (m_movement.x * m_speed));
m_position.y = (m_position.y + (m_movement.y * m_speed));
};
m_speed = Math.max((m_speed = (m_speed * 0.985)), SPEED);
};
m_fx.set(m_position.x);
m_fy.set(m_position.y);
}
override public function render(_arg1:int, _arg2:Number):void{
bubble.x = int(m_fx.value);
bubble.y = int(m_fy.value);
}
public function moving():Boolean{
return (!((m_movement == null)));
}
public function setColorIndex(_arg1:int):void{
m_color = _arg1;
if (bubble){
bubble.ball.gotoAndStop(_arg1);
};
}
public function getColorIndex():int{
return (m_color);
}
public function gotoAimPosition():void{
setPosition((458 + 8), 334);
}
public function gotoPreviewPosition():void{
setPosition(396, 405);
}
public function stopMovement():void{
m_movement = null;
}
public function setTickedPosition(_arg1:Number, _arg2:Number):void{
m_position.x = int(_arg1);
m_position.y = int(_arg2);
m_fx.set(_arg1);
m_fy.set(_arg2);
}
public function setPositionLimited(_arg1:int, _arg2:int):void{
m_position.x = _arg1;
m_position.y = _arg2;
}
public function setPosition(_arg1:int, _arg2:int):void{
m_position.x = _arg1;
m_fx = new IFloat(_arg1);
m_position.y = _arg2;
m_fy = new IFloat(_arg2);
bubble.x = _arg1;
bubble.y = _arg2;
}
public function fire(_arg1:Number):void{
bubbleParent.addChild(bubble);
setPosition(((458 - 322) + 8), 334);
m_movement = new Vec2D(XPMath.cos(_arg1), XPMath.sin(_arg1));
}
}
}//package game
Section 11
//BubbleBox (game.BubbleBox)
package game {
import sfx.*;
import flash.display.*;
import timing.*;
import geom.*;
import anim.*;
import math.*;
import flash.utils.*;
public class BubbleBox extends MovieClip {
private var m_dropLayer:DisplayObjectContainer;
private var m_listener:Object;
private var m_bonusLevelStartDelay:int;
private var m_bottomOffset:int;
private var m_earlyExitAtRow:int;
private var m_maxHeight:int;
private var m_numBubble:int;
private var m_listenerId:int;
private var m_combo:int;
private var m_scrollStartDelay:int;
private var m_numBubblesDestroyed:int;
private var m_numRows;
private var m_liveBubble:Array;
private var m_delayedBubble:Array;
private var m_bubbles:Array;
private var m_offsetX:int;
private var m_offsetY:int;
private var m_height:int;
private var m_bonusBubbleRng:MtRandom;
private var m_bubbleRng:MtRandom;
private var m_viewOffset:Number;
private var m_viewBottom:Number;// = 174
private var m_scroller:Interpolator;
private var m_viewTop:int;
private var m_viewOffsetIp:IFloat;
private var m_viewOffsetLast:Number;
private var m_numBonusBubbleSpawn:int;
private var m_sharedData:SharedData;
private var m_consecutiveBursts:int;
private var m_numVisibleBubble:int;
private var m_isAllowedBottomRow:Boolean;
private var m_spawnBonusEnable:Boolean;
private var m_isInBonusLevel:Boolean;
private var m_isScoreEnable:Boolean;
private var m_useScrollDelay:Boolean;
private var m_hasBonusBubble:Boolean;
private var m_useManualScrolling:Boolean;
private var m_disabled:Boolean;
private var m_game:Game;
private var m_disableRowCount:int;
private var m_multiplier:Number;
private var m_tick:int;
public static const radiusX:int = 30;
public static const radiusY:int = 24;
private static const m_offsetEven:Array = [[-1, -1], [0, -1], [1, 0], [0, 1], [-1, 1], [-1, 0]];
private static const m_offsetOdd:Array = [[0, -1], [1, -1], [1, 0], [1, 1], [0, 1], [-1, 0]];
public function BubbleBox(_arg1:Game, _arg2:SharedData, _arg3:int, _arg4:int, _arg5:Array, _arg6:int=1, _arg7:int=1){
var _local10:int;
var _local12:Boolean;
var _local13:int;
var _local14:int;
var _local15:Bubble;
var _local16:*;
var _local17:*;
super();
var _local8:* = getTimer();
m_game = _arg1;
m_multiplier = _arg7;
m_disabled = false;
m_disableRowCount = -1;
m_earlyExitAtRow = -1;
m_maxHeight = _arg4;
m_numVisibleBubble = 0;
m_useScrollDelay = true;
m_isInBonusLevel = false;
m_spawnBonusEnable = false;
m_isAllowedBottomRow = false;
m_useManualScrolling = false;
m_hasBonusBubble = false;
m_sharedData = _arg2;
mouseChildren = false;
m_bottomOffset = 1;
m_scrollStartDelay = -1;
m_bonusLevelStartDelay = -1;
m_viewTop = 0;
m_height = (_arg4 + _arg6);
m_listenerId = 0;
m_listener = {};
m_liveBubble = new Array();
m_delayedBubble = new Array();
m_bubbles = new Array((_arg4 + _arg6));
m_viewOffsetLast = -1;
m_numBubblesDestroyed = 0;
m_numBonusBubbleSpawn = 0;
m_isScoreEnable = true;
m_numBubble = 0;
m_bubbleRng = new MtRandom(_arg3);
var _local9:* = 0;
m_consecutiveBursts = 0;
m_bonusBubbleRng = new MtRandom(m_bubbleRng.nextInt(2147483647));
_local10 = 0;
while (_local10 < m_bubbles.length) {
_local12 = ((_local10 & 1) == 0);
_local13 = (_local12) ? 7 : 8;
m_bubbles[_local10] = new Array(_local13);
if (_local10 < (_arg4 - 2)){
_local14 = 0;
while (_local14 < _local13) {
_local15 = new Bubble();
_local15.arrayX = _local14;
_local15.arrayY = _local10;
_local15.isStuck = true;
_local16 = ((_local12) ? (radiusX / 2) : 0 + (_local14 * radiusX));
_local17 = (_local10 * radiusY);
_local15.setPositionLimited(_local16, _local17);
_local15.setColorIndex(_arg5[m_bubbleRng.nextInt(_arg5.length)]);
if (((m_sharedData.isSpeedMode) && ((m_bubbleRng.nextDouble() < (1 / 30))))){
_local15.isMultiplier = true;
};
if (((((!(_local15.isMultiplier)) && (m_sharedData.isSpeedMode))) && ((m_bubbleRng.nextDouble() < (1 / 20))))){
_local15.isLineBlast = true;
};
m_bubbles[_local10][_local14] = _local15;
_local9++;
_local14++;
};
};
_local10++;
};
m_numRows = m_bubbles.length;
m_viewOffset = -(bubbleHeight());
y = m_viewOffset;
m_offsetX = ((16 + 16) + 8);
m_offsetY = 28;
x = m_offsetX;
m_viewOffsetLast = m_viewOffset;
m_viewOffsetIp = new IFloat(m_viewOffset);
var _local11:* = getTimer();
}
public function destroy():void{
var _local2:int;
var _local3:Bubble;
m_listener = {};
var _local1:int;
while (_local1 < m_liveBubble.length) {
m_liveBubble[_local1].remove();
_local1++;
};
m_liveBubble = null;
_local1 = m_bubbles.length;
while (_local1--) {
_local2 = m_bubbles[_local1].length;
while (_local2--) {
_local3 = m_bubbles[_local1][_local2];
if (_local3 != null){
_local3.remove();
};
m_bubbles[_local1][_local2] = null;
};
m_bubbles[_local1] = null;
};
m_bubbles = null;
}
public function getNumLiveBubbles():int{
return (m_liveBubble.length);
}
public function addLiveBubble(_arg1:Bubble):void{
m_liveBubble.push(_arg1);
}
public function setPreferredBottomPos(_arg1:int):void{
m_bottomOffset = _arg1;
}
public function disableBubbles():void{
m_disableRowCount = getFirstRowWithBubbles();
m_disabled = true;
}
public function addListener(_arg1:BubbleListener):String{
var _local2:String = ("@" + ++m_listenerId);
m_listener[_local2] = _arg1;
return (_local2);
}
public function getDeepestHole():int{
var _local2:Boolean;
var _local3:int;
var _local1:int = m_bubbles.length;
while (_local1--) {
_local2 = false;
_local3 = m_bubbles[_local1].length;
while (_local3--) {
if (m_bubbles[_local1][_local3] == null){
_local2 = true;
break;
};
};
if (!_local2){
return ((_local1 + 1));
};
};
return (0);
}
public function getFirstRowWithBubbles():int{
var _local2:int;
var _local1:int = m_bubbles.length;
while (_local1--) {
_local2 = m_bubbles[_local1].length;
while (_local2--) {
if (m_bubbles[_local1][_local2] != null){
return (_local1);
};
};
};
return (0);
}
public function bubbleHeight():int{
var _local2:int;
var _local1:int = m_bubbles.length;
while (_local1--) {
_local2 = m_bubbles[_local1].length;
while (_local2--) {
if (m_bubbles[_local1][_local2] != null){
return (((_local1 + 1) * radiusY));
};
};
};
return (0);
}
public function testForDrop():Boolean{
var _local1:int;
var _local2:int;
var _local12:BubbleListener;
var _local13:Bubble;
var _local14:Bubble;
var _local15:Bubble;
var _local16:int;
var _local17:int;
var _local18:Array;
var _local19:int;
var _local20:int;
var _local21:uint;
var _local22:*;
var _local23:*;
var _local24:Pt;
var _local25:*;
var _local3:Array = new Array();
var _local4:int = getTimer();
_local2 = m_bubbles[0].length;
while (_local2--) {
if (m_bubbles[0][_local2] != null){
_local3.push(m_bubbles[0][_local2]);
};
};
var _local5:* = {};
var _local6:* = {};
_local1 = m_bubbles.length;
while (_local1--) {
_local2 = m_bubbles[_local1].length;
while (_local2--) {
_local14 = m_bubbles[_local1][_local2];
if (_local14 != null){
_local6[((_local1 << 8) | _local2)] = _local14;
};
};
};
var _local7:int = m_bubbles.length;
while (_local3.length > 0) {
_local15 = _local3.pop();
_local16 = _local15.arrayX;
_local17 = _local15.arrayY;
_local18 = ((_local17 & !((1 == 0)))) ? m_offsetEven : m_offsetOdd;
_local1 = 6;
while (_local1--) {
_local19 = (_local16 + _local18[_local1][0]);
_local20 = (_local17 + _local18[_local1][1]);
_local21 = ((_local20 << 8) | _local19);
if (!_local5[_local21]){
_local5[_local21] = 1;
if ((((((((_local19 < 0)) || ((_local20 < 0)))) || ((_local20 >= _local7)))) || ((_local19 >= m_bubbles[_local20].length)))){
} else {
if (m_bubbles[_local20][_local19]){
_local3.push(m_bubbles[_local20][_local19]);
delete _local6[_local21];
};
};
};
};
};
var _local8:Array = [0, 5, 10, 15, 20, 30, 40, 50, 65, 80, 95, 110, 130, 150, 170, 200];
var _local9:Boolean;
var _local10 = 1;
var _local11:int;
for each (_local13 in _local6) {
if (_local13.arrayY > 0){
m_bubbles[_local13.arrayY][_local13.arrayX] = null;
if (_local13.bubble == null){
_local22 = (((_local13.arrayY)!=0) ? (radiusX / 2) : 0 + (_local13.arrayX * radiusX));
_local23 = (_local13.arrayY * radiusY);
_local13.assureFull();
_local13.setPosition(_local22, _local23);
if (m_dropLayer){
m_dropLayer.addChild(_local13.bubble);
} else {
addChild(_local13.bubble);
};
} else {
if (m_dropLayer){
m_dropLayer.addChild(_local13.bubble);
};
};
if (_local13.isMultiplier){
m_multiplier = (m_multiplier + 2);
_local24 = matrixToScreen(_local13.arrayX, _local13.arrayY);
for each (_local12 in m_listener) {
_local12.onMultiplierChanged((_local24.x + parent.x), _local24.y, m_multiplier, 2);
};
};
if (_local13.isBonus){
_local10 = _local13.getColorIndex();
_local9 = true;
};
m_numBubblesDestroyed++;
_local11++;
_local13.drop(0, 0, true, _local13.isBonus);
};
};
if (_local11 != 0){
for each (_local12 in m_listener) {
_local12.onBubbleRemove(_local11);
};
};
if (m_isScoreEnable){
_local25 = _local8[Math.min((_local8.length - 1), _local11)];
if (m_sharedData.isSpeedMode){
_local25 = (_local25 * 10);
};
m_sharedData.score = (m_sharedData.score + (_local25 * m_multiplier));
};
if (_local9){
m_bonusLevelStartDelay = 25;
};
return ((_local11 > 0));
}
public function canFire():Boolean{
return ((m_bonusLevelStartDelay == -1));
}
public function testForExpansion(_arg1:int, _arg2:int):Boolean{
var _local8:Bubble;
var _local9:Array;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:uint;
var _local15:Bubble;
var _local16:BubbleListener;
var _local17:Boolean;
var _local18:*;
var _local19:Bubble;
var _local20:Pt;
var _local21:*;
var _local22:int;
var _local23:int;
var _local24:Array;
var _local3:Bubble = m_bubbles[_arg2][_arg1];
if (!_local3){
return (false);
};
var _local4:* = {};
var _local5:int = _local3.getColorIndex();
var _local6:Array = new Array();
var _local7:Array = new Array();
_local7.push(_local3);
while (_local7.length > 0) {
_local8 = _local7.shift();
_local9 = ((_local8.arrayY & !((1 == 0)))) ? m_offsetEven : m_offsetOdd;
_local10 = 0;
_local11 = _local9.length;
while (_local10 < _local11) {
_local12 = (_local8.arrayX + _local9[_local10][0]);
_local13 = (_local8.arrayY + _local9[_local10][1]);
_local14 = ((_local13 << 8) | _local12);
if (!_local4[_local14]){
_local4[_local14] = 1;
if (getColor(_local12, _local13) == _local5){
_local15 = getBubble(_local12, _local13);
_local6.push(_local15);
_local7.push(_local15);
};
};
_local10++;
};
};
if (_local6.length >= 3){
_local17 = false;
_local18 = 0;
for each (_local19 in _local6) {
if (_local19.isBonus){
_local17 = true;
};
if (_local19.isMultiplier){
m_multiplier++;
_local20 = matrixToScreen(_local19.arrayX, _local19.arrayY);
for each (_local16 in m_listener) {
_local16.onMultiplierChanged((_local20.x + parent.x), _local20.y, m_multiplier, 1);
};
};
if (_local19.isLineBlast){
_local10 = 0;
while (_local10 < m_bubbles[_local19.arrayY].length) {
_local21 = m_bubbles[_local19.arrayY][_local10];
if (_local21){
_local21.explode();
m_bubbles[_local19.arrayY][_local10] = null;
};
_local10++;
};
if (!m_game.getSoundManager().get("line_blast3").isPlaying()){
m_game.getSoundManager().get("line_blast3").play();
};
};
m_bubbles[_local19.arrayY][_local19.arrayX] = null;
_local19.explode();
m_numBubblesDestroyed++;
_local18++;
};
for each (_local16 in m_listener) {
_local16.onBubbleRemove(_local18);
};
if (m_isScoreEnable){
_local22 = 10;
if (m_sharedData.isSpeedMode){
_local22 = 10;
};
_local24 = [0, 3, 5, 7, 10, 15];
if ((((m_consecutiveBursts >= 0)) && ((m_consecutiveBursts < 6)))){
_local23 = ((_local24[m_consecutiveBursts] + _local22) * m_multiplier);
m_sharedData.score = (m_sharedData.score + _local23);
} else {
if (m_consecutiveBursts >= 6){
_local23 = (((15 + (10 * (m_consecutiveBursts - 5))) + _local22) * m_multiplier);
m_sharedData.score = (m_sharedData.score + _local23);
};
};
};
m_consecutiveBursts++;
if (m_consecutiveBursts > 15){
m_consecutiveBursts = 15;
};
} else {
m_consecutiveBursts = 0;
};
return ((_local18 > 0));
}
public function getNumRows():int{
return (m_numRows);
}
public function getMultiplier():int{
return (m_multiplier);
}
public function getCombo():int{
return (m_combo);
}
public function getUniqueColors():Array{
var _local3:int;
var _local4:int;
var _local5:Boolean;
var _local6:int;
var _local1:* = new Array();
var _local2:int;
while (_local2 < m_bubbles.length) {
_local3 = m_bubbles[_local2].length;
while (_local3--) {
if (m_bubbles[_local2][_local3] != null){
_local4 = m_bubbles[_local2][_local3].getColorIndex();
_local5 = false;
_local6 = 0;
while (((!(_local5)) && ((_local6 < _local1.length)))) {
if (_local1[_local6] == _local4){
_local5 = true;
};
_local6++;
};
if (!_local5){
_local1.push(_local4);
};
if (_local1.length == 5){
return (_local1);
};
};
};
_local2++;
};
if (_local1.length == 0){
_local1.push(7);
};
return (_local1);
}
public function tick(_arg1:int):void{
var _local2:int;
var _local3:int;
var _local5:Bubble;
var _local10:Boolean;
var _local11:BubbleListener;
var _local12:Boolean;
var _local13:int;
var _local14:int;
var _local15:Number;
var _local16:*;
var _local17:*;
var _local18:*;
var _local19:Array;
var _local20:Boolean;
var _local21:Bubble;
var _local22:int;
var _local23:*;
m_tick = _arg1;
if (m_disabled){
if (m_disableRowCount >= 0){
if (m_disableRowCount == (m_bubbles.length - 1)){
_local2 = 0;
while (_local2 < m_liveBubble.length) {
m_liveBubble[_local2].disableBubble();
_local2++;
};
};
_local3 = m_bubbles[m_disableRowCount].length;
while (_local3--) {
if (m_bubbles[m_disableRowCount][_local3] != null){
m_bubbles[m_disableRowCount][_local3].disableBubble();
};
};
m_disableRowCount--;
};
};
if (((!((m_earlyExitAtRow == -1))) && ((((m_maxHeight - getDeepestHole()) - 2) >= m_earlyExitAtRow)))){
_local11 = null;
for each (_local11 in m_listener) {
_local11.onEarlyExit();
};
};
var _local4:int;
_local2 = 0;
while (_local2 < m_delayedBubble.length) {
_local5 = m_delayedBubble[_local2];
if (--_local5.attachDelay == 0){
m_delayedBubble.splice(_local2, 1);
processBubble(_local5);
_local4++;
} else {
_local2++;
};
};
_local2 = 0;
while (_local2 < m_liveBubble.length) {
_local12 = false;
_local5 = m_liveBubble[_local2];
_local5.pushState();
_local5.tick((_arg1 + 1));
_local5.tick((_arg1 + 2));
_local13 = _local5.getX();
_local14 = _local5.getY();
_local5.popState();
_local15 = 0;
while (_local15 < 1) {
_local16 = ((_local5.getX() * (1 - _local15)) + (_local13 * _local15));
_local17 = ((_local5.getY() * (1 - _local15)) + (_local14 * _local15));
_local18 = screenToMatrix(_local16, _local17);
if (isClear(_local18.x, _local18.y)){
_local5.suggestX = _local18.x;
_local5.suggestY = _local18.y;
};
if ((((((_local17 - m_viewOffset) + 9) < 0)) || (testPoint(_local18)))){
if (attachBubble(_local5)){
m_delayedBubble.push(_local5);
};
m_liveBubble.splice(_local2, 1);
_local12 = true;
break;
};
_local15 = (_local15 + 0.3334);
};
if (!_local12){
_local2++;
};
};
m_numRows = 0;
m_numBubble = 0;
m_numVisibleBubble = 0;
var _local6 = -1;
var _local7:int = ((-(radiusY) * 2) + m_viewTop);
var _local8:int = ((m_height - 2) * radiusY);
var _local9:int = (m_bubbles.length * radiusY);
_local2 = m_bubbles.length;
while (_local2--) {
_local9 = (_local9 - radiusY);
_local10 = true;
_local19 = m_bubbles[_local2];
_local20 = ((m_viewOffset + _local9) > _local7);
_local3 = _local19.length;
while (_local3--) {
_local21 = _local19[_local3];
if (_local21 == null){
} else {
if (_local10){
_local10 = false;
_local22 = (_local9 + radiusY);
if (_local22 < _local6){
_local22 = _local6;
};
if (_local22 > _local8){
_local22 = _local8;
};
_local6 = _local22;
m_numRows++;
};
m_numBubble++;
if (_local21.isLineBlast){
} else {
if (_local20){
if (((((_local21.isStuck) && ((_local21.bubble == null)))) || ((_local21.bubble.parent == null)))){
bubbleInView(_local21);
};
m_numVisibleBubble++;
};
};
};
};
_local3 = _local19.length;
while (_local3--) {
_local21 = _local19[_local3];
if ((((_local21 == null)) || (!(_local21.isLineBlast)))){
} else {
if (_local20){
if (((((_local21.isStuck) && ((_local21.bubble == null)))) || ((_local21.bubble.parent == null)))){
bubbleInView(_local21);
};
m_numVisibleBubble++;
};
};
};
};
if (((((!(m_isInBonusLevel)) && ((m_numBubble == 0)))) && ((m_bonusLevelStartDelay == -1)))){
m_sharedData.isNoMoreBubbles = true;
};
if (m_bonusLevelStartDelay != -1){
if (--m_bonusLevelStartDelay == 0){
m_bonusLevelStartDelay = -1;
};
};
if (!m_useManualScrolling){
if (m_scroller == null){
if ((((_local4 == 0)) && ((m_delayedBubble.length == 0)))){
_local23 = Math.min((radiusY / 2), ((m_viewBottom - _local6) + (m_bottomOffset * radiusY)));
if (_local23 != m_viewOffset){
if (((m_useScrollDelay) && ((_local23 > m_viewOffset)))){
m_scrollStartDelay = 10;
};
m_scroller = new EaseOutQuadInterpolator(m_viewOffset, _local23, 15);
};
};
};
if (m_scroller != null){
if (m_scrollStartDelay < 0){
m_scroller.update();
m_viewOffset = m_scroller.getValue();
if (m_scroller.isDone()){
m_scroller = null;
};
} else {
m_scrollStartDelay--;
};
};
};
m_viewOffsetIp.set(m_viewOffset);
}
function bubbleInView(_arg1:Bubble):void{
var _local2:* = ((((_arg1.arrayY & 1) == 0)) ? (radiusX / 2) : 0 + (_arg1.arrayX * radiusX));
var _local3:* = (_arg1.arrayY * radiusY);
_arg1.assureFull();
_arg1.setPosition(_local2, _local3);
addChild(_arg1.bubble);
if (m_disabled){
_arg1.disableBubble();
};
}
function hasBonusBubble():Boolean{
var _local2:int;
var _local3:Bubble;
var _local1:int = m_bubbles.length;
while (_local1--) {
_local2 = m_bubbles[_local1].length;
while (_local2--) {
_local3 = m_bubbles[_local1][_local2];
if ((((_local3 == null)) || ((_local3.bubble == null)))){
} else {
if (_local3.isBonus){
return (true);
};
};
};
};
return (false);
}
function getRandomBottomBubble(_arg1:int):Bubble{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Bubble;
var _local6:Array = new Array();
_local4 = getFirstRowWithBubbles();
_local2 = _local4;
_arg1 = Math.min(_local4, _arg1);
while (_local2 > (_local4 - _arg1)) {
_local3 = m_bubbles[_local2].length;
while (_local3--) {
_local5 = m_bubbles[_local2][_local3];
if (((((!((_local5 == null))) && ((_local5.arrayY > 0)))) && (!(_local5.isBonus)))){
_local6.push(_local5);
};
};
_local2--;
};
if (_local6.length == 0){
return (null);
};
var _local7:int = (m_bonusBubbleRng.nextInt(0xA000) % _local6.length);
return (Bubble(_local6[_local7]));
}
function getRandomVisibleBubble():Bubble{
var _local4:int;
var _local5:Bubble;
var _local6:Pt;
var _local1:Array = new Array();
var _local2:int = m_bubbles.length;
while (_local2--) {
_local4 = m_bubbles[_local2].length;
while (_local4--) {
_local5 = m_bubbles[_local2][_local4];
if ((((_local5 == null)) || ((_local5.bubble == null)))){
} else {
if ((((_local5.arrayY == 0)) || (_local5.isBonus))){
} else {
_local6 = matrixToScreen(_local5.arrayX, _local5.arrayY);
if (_local6.y < radiusY){
} else {
_local1.push(_local5);
};
};
};
};
};
if (_local1.length == 0){
return (null);
};
var _local3:int = (m_bonusBubbleRng.nextInt(0xA000) % _local1.length);
return (Bubble(_local1[_local3]));
}
public function getBonusBubbleProximityFactor():Number{
if (m_numBonusBubbleSpawn == 5){
return (0);
};
if (m_hasBonusBubble){
return (1);
};
return ((Math.min(20, m_numBubblesDestroyed) / 20));
}
function testPoint(_arg1:Pt):Boolean{
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:Array;
var _local8:*;
var _local9:*;
var _local2:* = ((((_arg1.y & 1) == 0)) ? (radiusX / 2) : 0 + (_arg1.x * radiusX));
var _local3:* = (_arg1.y * radiusY);
_local4 = Math.min((m_bubbles.length - 1), (_arg1.y + 1));
_local6 = Math.max(0, (_arg1.y - 2));
while (_local4 >= _local6) {
_local7 = m_bubbles[_local4];
_local5 = _local7.length;
while (_local5--) {
if (_local7[_local5] == null){
} else {
_local8 = (_local2 - _local7[_local5].getX());
_local9 = (_local3 - _local7[_local5].getY());
if (((_local8 * _local8) + (_local9 * _local9)) < (1 * 1)){
return (true);
};
};
};
_local4--;
};
return (false);
}
private function reraisePowerups(_arg1:MovieClip, _arg2:int):void{
var _local5:Bubble;
var _local3:* = m_bubbles[_arg2];
var _local4:int = _local3.length;
while (_local4--) {
_local5 = _local3[_local4];
if ((((_local5 == null)) || (((!(_local5.isMultiplier)) && (!(_local5.isLineBlast)))))){
} else {
if (((!((_local5.bubble == null))) && (!((_local5.bubble.parent == null))))){
setChildIndex(_local5.bubble, getChildIndex(_arg1));
};
};
};
}
private function processBubble(_arg1:Bubble):void{
var _local9:*;
var _local10:*;
var _local11:int;
var _local12:Pt;
var _local13:*;
var _local2:Boolean;
var _local3:Boolean;
var _local4:int = m_sharedData.score;
var _local5:int = m_numBubblesDestroyed;
if (!m_disabled){
_local2 = testForExpansion(_arg1.suggestX, _arg1.suggestY);
_local3 = testForDrop();
};
var _local6:int = (m_numBubblesDestroyed - _local5);
m_combo = Math.max(m_combo, _local6);
var _local7:int = m_sharedData.score;
if (_local6 > 9){
_local9 = new BurstPop(_local6);
_local9.x = 200;
_local9.y = 286;
parent.parent.addChild(_local9);
};
if (_local2){
_local11 = (_local7 - _local4);
_local12 = matrixToScreen(_arg1.arrayX, _arg1.arrayY);
matrixToScreen(_arg1.arrayX, _arg1.arrayY).x = (_local12.x + 338);
if (((((m_sharedData.isSpeedMode) && ((_local11 < 1000)))) || (((!(m_sharedData.isSpeedMode)) && ((_local11 < 100)))))){
_local10 = new ScorePop(_local11);
_local10.x = _local12.x;
_local10.y = _local12.y;
parent.parent.addChild(_local10);
} else {
if (_local12.x < 370){
_local12.x = 370;
};
if (_local12.x > 510){
_local12.x = 510;
};
if (_local12.y < 60){
_local12.y = 60;
};
_local10 = new ScorePopHigh(_local11);
_local10.x = _local12.x;
_local10.y = _local12.y;
parent.parent.addChild(_local10);
};
};
var _local8:SoundManager = m_game.getSoundManager();
if (_local2){
_local13 = (("score_pop" + Math.max(1, Math.min(4, m_consecutiveBursts))) + ".2");
if (!_local8.get(_local13).isPlaying()){
_local8.get(_local13).play();
};
};
if (_local3){
if (!_local8.get("balls_dropped21").isPlaying()){
_local8.get("balls_dropped21").play();
};
};
}
public function setEarlyGameEnd(_arg1:int):void{
m_earlyExitAtRow = _arg1;
}
private function attachBubble(_arg1:Bubble):Boolean{
if (_arg1 == null){
return (false);
};
var _local2:* = 0;
if ((_arg1.suggestY & 1) == 0){
_local2 = (radiusX / 2);
};
var _local3:* = (_local2 + (_arg1.suggestX * radiusX));
var _local4:* = (_arg1.suggestY * radiusY);
if ((((_arg1.suggestY < 0)) || (((!(m_isAllowedBottomRow)) && ((_arg1.suggestY == (m_bubbles.length - 2))))))){
_arg1.bounceOff();
_arg1 = null;
return (false);
};
_arg1.attachDelay = 3;
_arg1.arrayX = _arg1.suggestX;
_arg1.arrayY = _arg1.suggestY;
m_game.sendData((((((("1001," + m_tick) + ",") + _arg1.arrayX) + ",") + _arg1.arrayY) + ",0=0"));
_arg1.stick(_local3, _local4);
m_bubbles[_arg1.suggestY][_arg1.suggestX] = _arg1;
if (!m_game.getSoundManager().get("ball_sticks2").isPlaying()){
m_game.getSoundManager().get("ball_sticks2").play(0.7);
};
bubbleInView(_arg1);
reraisePowerups(_arg1.bubble, _arg1.suggestY);
var _local5:* = false;
var _local6:int = m_bubbles[(m_height - 1)].length;
while (_local6--) {
if (m_bubbles[(m_height - 1)][_local6] != null){
_local5 = true;
break;
};
};
return (true);
}
function screenToMatrix(_arg1:int, _arg2:int):Pt{
var _local3:Pt = new Pt(((_arg1 - m_offsetX) + 15), (((_arg2 - m_offsetY) - m_viewOffset) + 15));
_local3.y = int((_local3.y / radiusY));
if ((_local3.y & 1) == 0){
_local3.x = int(((_local3.x - (radiusX / 2)) / radiusX));
if (_local3.x > 6){
_local3.x = 6;
};
} else {
_local3.x = int((_local3.x / radiusX));
if (_local3.x > 7){
_local3.x = 7;
};
};
if (_local3.x < 0){
_local3.x = 0;
};
return (_local3);
}
function matrixToScreen(_arg1:int, _arg2:int):Pt{
var _local3:int;
if ((_arg2 & 1) == 0){
_local3 = (radiusX / 2);
};
return (new Pt(((m_offsetX + _local3) + (_arg1 * radiusX)), ((m_offsetY + m_viewOffset) + (_arg2 * radiusY))));
}
function isClear(_arg1:int, _arg2:int):Boolean{
if ((((((((_arg1 < 0)) || ((_arg2 < 0)))) || ((_arg2 >= m_bubbles.length)))) || ((_arg1 >= m_bubbles[_arg2].length)))){
return (false);
};
if (m_bubbles[_arg2][_arg1] == null){
return (true);
};
return (false);
}
function getBubble(_arg1:int, _arg2:int):Bubble{
if ((((((((_arg1 < 0)) || ((_arg2 < 0)))) || ((_arg2 >= m_bubbles.length)))) || ((_arg1 >= m_bubbles[_arg2].length)))){
return (null);
};
if (m_bubbles[_arg2][_arg1] != null){
return (m_bubbles[_arg2][_arg1]);
};
return (null);
}
public function getNumBubbles():int{
return (m_numBubble);
}
public function setScoringEnabled(_arg1:Boolean):void{
m_isScoreEnable = _arg1;
}
public function setCanSpawnBonus(_arg1:Boolean):void{
m_spawnBonusEnable = _arg1;
}
public function setUseScrollDelay(_arg1:Boolean):void{
if (!_arg1){
m_scrollStartDelay = -1;
};
m_useScrollDelay = _arg1;
}
public function setAllowedBottomRow(_arg1:Boolean):void{
m_isAllowedBottomRow = _arg1;
}
public function setUseManualScrolling(_arg1:Boolean):void{
m_useManualScrolling = _arg1;
}
public function setScrollOffset(_arg1:int):void{
if (m_useManualScrolling){
m_viewOffset = _arg1;
};
}
public function setViewTop(_arg1:int):void{
m_viewTop = _arg1;
}
public function popLiveBubbles():void{
var _local2:Bubble;
var _local1:int;
while (_local1 < m_liveBubble.length) {
_local2 = m_liveBubble[_local1];
_local2.explode();
_local2.isRemoving = true;
_local1++;
};
}
public function getNumVisibleBubble():int{
return (m_numVisibleBubble);
}
function getColor(_arg1:int, _arg2:int):int{
if ((((((((_arg1 < 0)) || ((_arg2 < 0)))) || ((_arg2 >= m_bubbles.length)))) || ((_arg1 >= m_bubbles[_arg2].length)))){
return (0);
};
if (m_bubbles[_arg2][_arg1] != null){
return (m_bubbles[_arg2][_arg1].getColorIndex());
};
return (-1);
}
public function setDropBubbleContainer(_arg1:DisplayObjectContainer):void{
m_dropLayer = _arg1;
}
public function render(_arg1:int, _arg2:Number):void{
var _local3:* = m_viewOffsetIp.value;
if (m_viewOffsetLast != _local3){
m_viewOffsetLast = _local3;
y = _local3;
if (m_dropLayer){
m_dropLayer.x = x;
m_dropLayer.y = y;
};
};
}
}
}//package game
Section 12
//BubbleClip (game.BubbleClip)
package game {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
public class BubbleClip extends MovieClip {
public var burst:MovieClip;
public var marker_lineblast:LineExplosionMarker;
public var lineblast:MovieClip;
public var ball:MovieClip;
public var marker_multiply:MultiplyMarker;
private var m_bubble:Bubble;
private var m_isZoom:Boolean;
private var m_offsetY:int;
private var m_startDelay:int;
private var m_startTime:int;
private var m_lastFrame:uint;
private var m_dx:Number;
private var m_dy:Number;
private var m_dcos:Number;
private var m_dsin:Number;
private var m_startY;
private var m_startX;
private var m_projectile0:MovieClip;
private var m_projectile1:MovieClip;
public function BubbleClip(_arg1:Bubble){
m_dx = 0;
m_dy = 0;
m_bubble = _arg1;
mouseChildren = false;
stop();
ball.stop();
marker_lineblast.visible = false;
marker_lineblast.stop();
marker_multiply.visible = false;
marker_multiply.stop();
burst.stop();
burst.visible = false;
lineblast.stop();
lineblast.visible = false;
m_offsetY = 480;
}
public function setDropOffset(_arg1:int){
m_offsetY = _arg1;
}
public function startExplosion():void{
if (!lineblast.visible){
m_startTime = -1;
m_startX = x;
m_startY = y;
marker_multiply.stop();
marker_multiply.visible = false;
marker_lineblast.stop();
marker_lineblast.visible = false;
burst.visible = true;
ball.visible = false;
m_startDelay = (getTimer() + int(((Math.random() * 100) + 1)));
addEventListener(Event.ENTER_FRAME, animateExplosion);
};
}
public function startLineBlast():void{
if (((!(burst.visible)) && (!(lineblast.visible)))){
m_projectile0 = new LineBlastProjectile();
m_projectile1 = new LineBlastProjectile();
addChild(m_projectile0);
addChild(m_projectile1);
m_startTime = -1;
m_startX = x;
m_startY = y;
lineblast.visible = true;
addEventListener(Event.ENTER_FRAME, animateExplosion);
};
}
public function startDrop(_arg1:Number, _arg2:Number, _arg3:Boolean, _arg4:Boolean):void{
m_startTime = -1;
var _local5:* = (Math.random() * Math.PI);
m_dcos = Math.cos(_local5);
m_dsin = Math.sin(_local5);
m_dx = _arg1;
m_dy = _arg2;
m_isZoom = _arg4;
transform.colorTransform = new ColorTransform();
m_startDelay = (_arg3) ? (getTimer() + 150) : 0;
addEventListener(Event.ENTER_FRAME, animateDrop);
}
public function stopAnim():void{
removeEventListener(Event.ENTER_FRAME, animateDrop);
removeEventListener(Event.ENTER_FRAME, animateExplosion);
}
public function animateDrop(_arg1:Event):void{
var _local2:int = getTimer();
if (_local2 < m_startDelay){
return;
};
if (m_startTime < 0){
m_startTime = _local2;
m_startX = x;
m_startY = y;
};
var _local3:Number = (_local2 - m_startTime);
var _local4:Number = (_local3 / 110);
var _local5:Number = (_local4 * 15);
x = ((((m_dx * _local3) / 30) + m_startX) + (_local5 * m_dcos));
y = ((((m_dy * _local3) / 30) + m_startY) - ((_local5 * m_dsin) - ((9 * _local4) * _local4)));
if (m_isZoom){
scaleX = (1 + (_local4 / 8));
scaleY = (1 + (_local4 / 8));
};
if (y > (m_offsetY - parent.y)){
removeEventListener(Event.ENTER_FRAME, animateDrop);
marker_multiply.stop();
marker_lineblast.stop();
m_bubble.remove();
};
}
public function animateExplosion(_arg1:Event):void{
var _local5:int;
var _local6:*;
var _local2:int = getTimer();
if (_local2 < m_startDelay){
return;
};
if (m_startTime < 0){
m_startTime = _local2;
};
var _local3:Number = (((_local2 - m_startTime) / ((1 / 25) * 1000)) + 1);
var _local4:uint = int(Math.round(_local3));
if (burst.visible){
burst.gotoAndStop(_local4);
if (_local4 > burst.totalFrames){
removeEventListener(Event.ENTER_FRAME, animateExplosion);
marker_multiply.stop();
marker_lineblast.stop();
m_bubble.remove();
};
} else {
if (lineblast.visible){
lineblast.gotoAndStop(_local4);
_local5 = lineblast.totalFrames;
_local6 = 1;
if (_local3 > (_local5 - 7)){
_local6 = (1 - Math.min(1, ((_local3 - 7) / (_local5 - 7))));
};
ball.alpha = _local6;
m_projectile0.alpha = _local6;
m_projectile0.x = (_local3 * 14);
m_projectile1.alpha = _local6;
m_projectile1.x = (-(_local3) * 14);
if (_local4 > _local5){
removeChild(m_projectile0);
removeChild(m_projectile1);
removeEventListener(Event.ENTER_FRAME, animateExplosion);
marker_multiply.stop();
marker_lineblast.stop();
m_bubble.remove();
};
};
};
}
}
}//package game
Section 13
//BubbleLauncher (game.BubbleLauncher)
package game {
import flash.display.*;
import timing.*;
import math.*;
public class BubbleLauncher extends MovieClip {
private var m_bubble:Bubble;
private var m_fr:IFloat;
private var m_r:Number;
private var m_limit1:Number;
private var m_limit2:Number;
private var m_x:int;
private var m_y:int;
private var m_xoffset:int;
private var m_yoffset:int;
private var m_lastDeg:int;
private var m_reload:int;
private var m_reloadTime:int;
private var m_mouseX:int;
private var m_mouseY:int;
private var m_aimFn:Function;
public function BubbleLauncher(){
m_fr = new IFloat(0);
m_r = 0;
m_lastDeg = -1;
m_xoffset = 0;
m_yoffset = 0;
m_mouseX = 0;
m_mouseY = 0;
m_reloadTime = 15;
m_reload = m_reloadTime;
m_limit1 = -3.1414;
m_limit2 = 0.0001;
gotoAndStop(2);
}
public function setRadLimits(_arg1:Number, _arg2:Number):void{
m_limit1 = _arg1;
m_limit2 = _arg2;
}
public function setReloadTime(_arg1:int):void{
m_reloadTime = _arg1;
m_reload = 0;
}
public function setAimChangeCallback(_arg1:Function):void{
m_aimFn = _arg1;
}
public function setPosition(_arg1:int, _arg2:int):void{
this.x = _arg1;
this.y = _arg2;
m_x = _arg1;
m_y = _arg2;
}
public function setBubble(_arg1:Bubble):void{
m_bubble = _arg1;
}
public function fire():Bubble{
if ((((m_reload <= 0)) && (!((m_bubble == null))))){
m_bubble.fire(m_r);
m_reload = m_reloadTime;
return (m_bubble);
};
return (null);
}
public function tick(_arg1:int, _arg2:int, _arg3:int):void{
m_reload--;
m_mouseX = (_arg2 + m_xoffset);
m_mouseY = (_arg3 + m_yoffset);
var _local4:* = m_r;
m_r = XPMath.atan2((Math.min((m_y - 30), m_mouseY) - m_y), (m_mouseX - m_x));
if (m_r < m_limit1){
m_r = m_limit1;
};
if (m_r > m_limit2){
m_r = m_limit2;
};
if (((!((m_aimFn == null))) && (!(((m_r - _local4) == 0))))){
m_aimFn(m_r, _local4);
};
m_fr.set(m_r);
}
public function getRad():Number{
return (m_r);
}
public function render(_arg1:int, _arg2:Number):void{
var _local3:int = int(((m_fr.value * (180 / Math.PI)) + 90));
if (_local3 != m_lastDeg){
rotation = _local3;
};
}
}
}//package game
Section 14
//BubbleListener (game.BubbleListener)
package game {
public interface BubbleListener {
function onBubbleRemove(_arg1:int):void;
function onNoMoreBubbles():void;
function onEarlyExit():void;
function onMultiplierChanged(_arg1:int, _arg2:int, _arg3:int, _arg4:int):void;
}
}//package game
Section 15
//BurstPop (game.BurstPop)
package game {
import flash.display.*;
import flash.events.*;
import localization.*;
import flash.utils.*;
public class BurstPop extends MovieClip {
public var textclip:MovieClip;
public var number0:MovieClip;
public var number1:MovieClip;
private var m_startTime:int;
public function BurstPop(_arg1:int){
if (_arg1 > 99){
_arg1 = 99;
};
var _local2:int = ((_arg1 % 10) + 1);
number0.gotoAndStop(_local2);
_local2 = ((int((_arg1 / 10)) % 10) + 1);
number1.gotoAndStop(_local2);
textclip.text.text = I18n.getString("end_speed_burst_pop");
gotoAndStop(1);
m_startTime = -1;
visible = false;
addEventListener(Event.ENTER_FRAME, enterFrame);
}
public function enterFrame(_arg1:Event):void{
var _local2:int = getTimer();
if (m_startTime < 0){
m_startTime = _local2;
visible = true;
};
var _local3:* = ((1 / 25) * 1000);
var _local4:uint = int(Math.round((((_local2 - m_startTime) / _local3) + 1)));
if (_local4 > totalFrames){
removeEventListener(Event.ENTER_FRAME, enterFrame);
parent.removeChild(this);
return;
};
if (_local4 != currentFrame){
gotoAndStop(_local4);
};
}
}
}//package game
Section 16
//Game (game.Game)
package game {
import sfx.*;
import flash.display.*;
public interface Game {
function getSharedData():SharedData;
function leaveState():void;
function isLowPerformanceMode():Boolean;
function hideBack():void;
function leaveGame():void;
function sendData(_arg1:String):void;
function getSoundManager():SoundManager;
function getMusicManager():SoundManager;
function finalScore(_arg1:int):void;
function destroy():void;
function flush():void;
function toggleSound():void;
function getDisplayObjectContainer():DisplayObjectContainer;
}
}//package game
Section 17
//GameBase (game.GameBase)
package game {
import sfx.*;
import flash.display.*;
import timing.*;
import flash.events.*;
import flash.geom.*;
import localization.*;
import util.*;
import flash.system.*;
import flash.external.*;
public class GameBase extends MovieClip implements Game, Timeable {
private var m_lastKeys:Array;
private var m_fpsNextAt:int;
private var m_fpsText:String;
private var m_prevQuality:String;
private var m_hasDecreasedQuality:Boolean;
private var m_stats:Stats;
private var m_soundMgr:SoundManager;
private var m_musicMgr:SoundManager;
private var m_states:Array;
private var m_stateIdx:int;
private var m_nextStateIdx:int;
private var m_timer:Timer;
private var m_gameCtrl:MovieClip;
private var m_base:MovieClip;
private var m_sharedData:SharedData;
private var m_stateLocalTick:int;
private var m_mouseX:int;
private var m_mouseY:int;
private var m_isFirstEnterFrame:Boolean;
private var m_hasCalledQuit:Boolean;
private var m_hasCalledEnd:Boolean;
private var m_isSoundEnabled:Boolean;
private var m_isMusicEnabled:Boolean;
private var m_frameBuf:Bitmap;
private var m_performance:Performance;
private static const AUTO_VERSION:String = "BUILD_[1]_0";
public static const TICK_RATE:int = 30;
public static const WIDTH:int = 755;
public static const HEIGHT:int = 440;
public static const PROTOCOL_VERSION:String = "1";
public static const DEBUG_MODE:Boolean = false;
public function GameBase(){
m_mouseX = 0;
m_mouseY = 0;
m_lastKeys = new Array(10);
m_isFirstEnterFrame = true;
addEventListener(Event.ENTER_FRAME, enterFrame);
}
public function mouseMove(_arg1:MouseEvent):void{
m_mouseX = _arg1.stageX;
m_mouseY = _arg1.stageY;
}
public function mouseDown(_arg1:MouseEvent):void{
if (m_mouseY < 530){
m_states[m_stateIdx].onMouseDown();
};
}
public function mouseUp(_arg1:MouseEvent):void{
if (m_mouseY < 530){
m_states[m_stateIdx].onMouseUp();
};
}
private function init():Boolean{
var data:Object;
var prop:XML;
var gd:String;
m_hasCalledEnd = false;
m_hasCalledQuit = false;
m_isSoundEnabled = true;
m_isMusicEnabled = true;
m_performance = new Performance(40);
m_performance.addQualityFeedbackListener(onPoorFrameRate);
m_stateLocalTick = 0;
m_stateIdx = -1;
m_nextStateIdx = 0;
stage.frameRate = 90;
var i:* = 0;
i = (i + 1);
i = (i + 1);
i = (i + 1);
m_states = [new StateIntro(this, i), new StateGame(this, i), new StateEnd(this, i)];
m_sharedData = new SharedData();
m_timer = new Timer(this, TICK_RATE);
if (DEBUG_MODE){
gd = "";
gd = (((((((((((((((((((((((((((((((((((((((((((((((((((((("<gamedata gametype=\"speed\" timelimit=\"60\" colors=\"2\" rows=\"200\" shotbonus=\"0\" randomseed=\"651156\">" + "<persistent>") + "<bestscore value=\"0\" />") + "<bestmultiplier value=\"0\" />") + "<bestcombo value=\"0\" />") + "<played value=\"0\" />") + "<trophy value=\"\" />") + "<sound value=\"0\" />") + "<music value=\"0\" />") + "</persistent>") + "<text id=\"time\">TIME LEFT</text>") + "<text id=\"score\">BASE SCORE</text>") + "<text id=\"bonus\">BONUS</text>") + "<text id=\"multiplier\">MULTIPLIER</text>") + "<text id=\"end\">END GAME</text>") + "<text id=\"end_opengame\">Register now to play the full game.</text>") + "<text id=\"end_speed_gameover\">Game Over</text>") + "<text id=\"end_speed_total_score\">Total score</text>") + "<text id=\"end_speed_best_score\">Best ever</text>") + "<text id=\"end_speed_this_game\">This game</text>") + "<text id=\"end_speed_personal_best\">Personal best</text>") + "<text id=\"end_speed_multiplier\">Multiplier</text>") + "<text id=\"end_speed_best_combo\">Best combo</text>") + "<text id=\"end_speed_bubbles\">{0} bubbles</text>") + "<text id=\"end_speed_trophy1\">100.000 points</text>") + "<text id=\"end_speed_trophy2\">10 x multiplier</text>") + "<text id=\"end_speed_trophy3\">100 games played</text>") + "<text id=\"end_speed_countdown\">Time to exit {0}</text>") + "<text id=\"end_speed_new_record\">New record!</text>") + "<text id=\"end_speed_burst_pop\">Bubbles burst!</text>") + "<text id=\"end_normal_gameover\">Game Over</text>") + "<text id=\"end_normal_combo_bonus\">Best combo</text>") + "<text id=\"end_normal_combo_bonus_val\">{0} bubbles</text>") + "<text id=\"end_normal_time_bonus\">Time bonus</text>") + "<text id=\"end_normal_move_bonus\">Move bonus</text>") + "<text id=\"end_normal_total_score\">Total score</text>") + "<text id=\"end_normal_best_score\">Best ever</text>") + "<text id=\"end_normal_new_record\">New record!</text>") + "<text id=\"end_normal_trophy1\">20.000 points</text>") + "<text id=\"end_normal_trophy2\">30 bubbles burst</text>") + "<text id=\"end_normal_trophy3\">Finish game under 2 minutes.</text>") + "<text id=\"end_normal_countdown\">Time to exit {0}</text>") + "<text id=\"intro_speed_title\">Instructions</text>") + "<text id=\"intro_speed_text1\">Shoot three or more bubbles of the same colour to remove them.</text>") + "<text id=\"intro_speed_text2\">Burst this bubble to remove everything under it.</text>") + "<text id=\"intro_speed_text3\">Make this bubble drop to increase the score multiplier.</text>") + "<text id=\"intro_speed_countdown\">Time to start {0}</text>") + "<text id=\"intro_normal_title\">Instructions</text>") + "<text id=\"intro_normal_text\">Lorem Ipsum is simply dummy text of the printing and typesetting industry.</text>") + "<text id=\"intro_normal_countdown\">Time to start {0}</text>") + "<boosters>") + "<a value=\"0\" />") + "<b value=\"0\" />") + "</boosters>") + "</gamedata>");
data = {message:gd, success:true};
} else {
if (!ExternalInterface.available){
return (false);
};
data = ExternalInterface.call("getGameData");
};
if ((((data == null)) || (!(data.success)))){
return (false);
};
var x:XML = new XML(data.message);
var build:* = AUTO_VERSION.split("_")[1];
var buildDateHex:* = AUTO_VERSION.split("_")[2];
var d:* = parseInt(buildDateHex, 16);
m_sharedData.isSpeedMode = ((x.@gametype)=="speed") ? true : false;
m_sharedData.isShortMode = (((!(m_sharedData.isSpeedMode)) && ((x.@short == "true")))) ? true : false;
m_sharedData.bestScore = x.persistent.bestscore.@value;
m_sharedData.trophies = x.persistent.trophy.@value;
m_isMusicEnabled = (x.persistent.music.@value == "0");
m_isSoundEnabled = (x.persistent.sound.@value == "0");
if (m_sharedData.isSpeedMode){
m_sharedData.bestMultiplier = x.persistent.bestmultiplier.@value;
m_sharedData.bestCombo = x.persistent.bestcombo.@value;
m_sharedData.numPlayed = x.persistent.played.@value;
};
m_sharedData.build = parseInt(build.substring(1, (build.length - 1)));
m_sharedData.buildDate = new Date();
m_sharedData.buildDate.setTime(d);
var extraTime:int;
var startMultiplier = 1;
if (x.boosters != null){
extraTime = ((int(x.boosters.a.@value) == 0)) ? 0 : 5;
startMultiplier = ((int(x.boosters.b.@value) == 0)) ? 1 : 3;
};
m_sharedData.setGameTime((int(x.@timelimit) + extraTime));
m_sharedData.startMultiplier = startMultiplier;
m_sharedData.shotBonusMax = int(x.@shotbonus);
m_sharedData.rows = Math.max(3, int(x.@rows));
m_sharedData.colors = Math.min(6, Math.max(2, int(x.@colors)));
m_sharedData.globalSeed = int(x.@randomseed);
if (DEBUG_MODE){
m_sharedData.globalSeed = int((Math.random() * 2147483647));
};
var loc:Object = new Object();
for each (prop in x.children()) {
loc[prop.@id] = prop.text();
};
I18n.init(loc);
m_gameCtrl = new GameControl();
m_gameCtrl.exit_btn.stop();
m_gameCtrl.exit_hit.addEventListener(MouseEvent.CLICK, onClickExit);
m_gameCtrl.exit_hit.addEventListener(MouseEvent.ROLL_OVER, function (_arg1:MouseEvent){
m_gameCtrl.exit_btn.gotoAndStop(2);
});
m_gameCtrl.exit_hit.addEventListener(MouseEvent.ROLL_OUT, function (_arg1:MouseEvent){
m_gameCtrl.exit_btn.gotoAndStop(1);
});
m_gameCtrl.exit_hit.buttonMode = true;
m_gameCtrl.exit_hit.useHandCursor = true;
m_gameCtrl.sfx_btn.stop();
m_gameCtrl.sfx_hit.addEventListener(MouseEvent.CLICK, onClickToggleSound);
m_gameCtrl.sfx_hit.addEventListener(MouseEvent.ROLL_OVER, function (_arg1:MouseEvent){
m_gameCtrl.sfx_btn.gotoAndStop((m_isSoundEnabled) ? 2 : 4);
});
m_gameCtrl.sfx_hit.addEventListener(MouseEvent.ROLL_OUT, function (_arg1:MouseEvent){
m_gameCtrl.sfx_btn.gotoAndStop((m_isSoundEnabled) ? 1 : 3);
});
m_gameCtrl.sfx_btn.gotoAndStop((m_isSoundEnabled) ? 1 : 3);
m_gameCtrl.sfx_hit.buttonMode = true;
m_gameCtrl.sfx_hit.useHandCursor = true;
m_gameCtrl.music_btn.stop();
m_gameCtrl.music_hit.addEventListener(MouseEvent.CLICK, onClickToggleMusic);
m_gameCtrl.music_hit.addEventListener(MouseEvent.ROLL_OVER, function (_arg1:MouseEvent){
m_gameCtrl.music_btn.gotoAndStop((m_isMusicEnabled) ? 2 : 4);
});
m_gameCtrl.music_hit.addEventListener(MouseEvent.ROLL_OUT, function (_arg1:MouseEvent){
m_gameCtrl.music_btn.gotoAndStop((m_isMusicEnabled) ? 1 : 3);
});
m_gameCtrl.music_btn.gotoAndStop((m_isMusicEnabled) ? 1 : 3);
m_gameCtrl.music_hit.buttonMode = true;
m_gameCtrl.music_hit.useHandCursor = true;
m_gameCtrl.visible = true;
m_frameBuf = new Bitmap(new BitmapData(WIDTH, HEIGHT, false, 0));
addChild(m_frameBuf);
m_base = new Assembly();
m_base.scrollRect = new Rectangle(0, 0, WIDTH, HEIGHT);
m_base.mouseChildren = false;
m_base.gotoAndStop((m_sharedData.isSpeedMode) ? 1 : 2);
addChild(m_base);
addChild(m_gameCtrl);
m_fpsNextAt = -1;
if (DEBUG_MODE){
m_stats = new Stats();
m_gameCtrl.addChild(m_stats);
};
m_soundMgr = new SoundManager();
m_musicMgr = new SoundManager();
m_soundMgr.setVolume((m_isSoundEnabled) ? 1 : 0);
m_musicMgr.setVolume((m_isMusicEnabled) ? 1 : 0);
return (true);
}
public function enterFrame(_arg1:Event):void{
var _local2:MovieClip;
var _local3:int;
if (m_isFirstEnterFrame){
if (init()){
m_isFirstEnterFrame = false;
} else {
_local2 = new ErrorSymbol();
_local2.x = (755 / 2);
_local2.y = (440 / 2);
addChild(_local2);
removeEventListener(Event.ENTER_FRAME, enterFrame);
};
return;
};
if (m_nextStateIdx != m_stateIdx){
_local3 = m_stateIdx;
m_frameBuf.bitmapData.draw(getDisplayObjectContainer());
m_frameBuf.visible = true;
if (m_stateIdx != -1){
m_states[m_stateIdx].disengage();
};
m_stateLocalTick = 0;
m_stateIdx = m_nextStateIdx;
m_states[m_stateIdx].engage();
stage.focus = this;
if (m_hasDecreasedQuality){
m_states[m_stateIdx].onPoorFrameRate();
};
m_gameCtrl.sfx_btn.visible = false;
m_gameCtrl.sfx_hit.visible = false;
m_gameCtrl.music_btn.visible = false;
m_gameCtrl.music_hit.visible = false;
if (m_states[m_stateIdx].hasSoundButton()){
m_gameCtrl.sfx_btn.visible = true;
m_gameCtrl.sfx_hit.visible = true;
m_gameCtrl.music_btn.visible = true;
m_gameCtrl.music_hit.visible = true;
};
m_gameCtrl.exit_btn.visible = false;
m_gameCtrl.exit_hit.visible = false;
if (m_states[m_stateIdx].hasExitButton()){
m_gameCtrl.exit_btn.visible = true;
m_gameCtrl.exit_hit.visible = true;
};
if ((((_local3 == -1)) && (!((m_stateIdx == -1))))){
addEventListener(MouseEvent.MOUSE_MOVE, mouseMove);
addEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
addEventListener(MouseEvent.MOUSE_UP, mouseUp);
};
};
if (m_stateIdx != -1){
m_states[m_stateIdx].onMouseMove(m_mouseX, m_mouseY);
};
m_timer.advanceTime();
m_soundMgr.update();
m_musicMgr.update();
m_performance.frameUpdated();
}
public function hideBack():void{
m_frameBuf.visible = false;
}
public function tick(_arg1:int):void{
m_sharedData.globalTick = _arg1;
if (m_stateIdx != -1){
m_states[m_stateIdx].tick(m_stateLocalTick++);
};
}
public function render(_arg1:int, _arg2:Number):void{
if (m_stateIdx != -1){
m_states[m_stateIdx].render(m_stateLocalTick, _arg2);
};
}
public function getSharedData():SharedData{
return (m_sharedData);
}
public function flush():void{
m_timer.flush();
}
public function onPoorFrameRate(_arg1:Number):void{
if (!m_hasDecreasedQuality){
if (m_stateIdx != -1){
m_states[m_stateIdx].onPoorFrameRate();
};
m_hasDecreasedQuality = true;
stage.quality = "low";
};
}
public function leaveState():void{
switch (m_stateIdx){
case 0:
if (!DEBUG_MODE){
fscommand("gameStart", "");
};
sendData((((((("33,0," + PROTOCOL_VERSION) + ",") + m_sharedData.build) + ",") + m_sharedData.buildDate.getTime()) + ",0=0"));
m_nextStateIdx = 1;
break;
};
}
public function finalScore(_arg1:int):void{
if (((!(m_hasCalledQuit)) && (!(m_hasCalledEnd)))){
sendData((((("36,-1," + (m_isSoundEnabled) ? 0 : 1) + ",") + (m_isMusicEnabled) ? 0 : 1) + ",0=0"));
if (!DEBUG_MODE){
fscommand("gameEnd", ("" + _arg1));
};
m_hasCalledEnd = true;
};
}
public function destroy():void{
if (((m_hasCalledEnd) && (!(m_hasCalledQuit)))){
removeEventListener(MouseEvent.MOUSE_MOVE, mouseMove);
removeEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
removeEventListener(MouseEvent.MOUSE_UP, mouseUp);
m_states[m_stateIdx].disengage();
if (!DEBUG_MODE){
fscommand("gameQuit", "");
};
m_hasCalledQuit = true;
m_stateIdx = -1;
m_nextStateIdx = -1;
};
}
public function isLowPerformanceMode():Boolean{
return (m_hasDecreasedQuality);
}
public function getDisplayObjectContainer():DisplayObjectContainer{
return (m_base);
}
public function sendData(_arg1:String):void{
if (!DEBUG_MODE){
ExternalInterface.call("playData", _arg1);
};
}
public function leaveGame():void{
m_nextStateIdx = 2;
}
public function toggleSound():void{
m_gameCtrl.sfx_btn.gotoAndStop((m_isSoundEnabled) ? 4 : 2);
m_isSoundEnabled = !(m_isSoundEnabled);
m_soundMgr.setVolume((m_isSoundEnabled) ? 1 : 0);
}
public function onClickToggleMusic(_arg1:MouseEvent):void{
m_gameCtrl.music_btn.gotoAndStop((m_isMusicEnabled) ? 4 : 2);
m_isMusicEnabled = !(m_isMusicEnabled);
m_musicMgr.setVolume((m_isMusicEnabled) ? 1 : 0);
}
public function onClickToggleSound(_arg1:MouseEvent):void{
toggleSound();
}
public function onClickExit(_arg1:MouseEvent):void{
if (m_stateIdx != -1){
m_states[m_stateIdx].onGameQuitButton();
};
m_nextStateIdx = 2;
}
public function onFullscreen(_arg1:Event):void{
stage.displayState = "fullScreen";
stage.quality = "low";
}
public function getSoundManager():SoundManager{
return (m_soundMgr);
}
public function getMusicManager():SoundManager{
return (m_musicMgr);
}
}
}//package game
Section 18
//Leaf (game.Leaf)
package game {
import flash.display.*;
import flash.events.*;
import localization.*;
import flash.utils.*;
public class Leaf extends MovieClip {
private const m_step:int = 40;
public var texts:MovieClip;
public var isAutoLeave:Boolean;// = false
private var m_sharedData:SharedData;
private var m_game:Game;
private var m_startTime:int;
private var m_stopFrame:int;
private var m_doInit:Boolean;
var textsAppearAt:int;// = -1
var autoLeaveAt:int;// = -1
var wiggleTrophy1:Boolean;
var wiggleTrophy2:Boolean;
var wiggleTrophy3:Boolean;
public function Leaf(){
stop();
}
public function setGame(_arg1:Game):void{
m_game = _arg1;
m_sharedData = m_game.getSharedData();
}
public function transitionIntro():void{
m_doInit = false;
addEventListener(Event.ENTER_FRAME, animFw);
m_startTime = -1;
textsAppearAt = -1;
m_stopFrame = 23;
isAutoLeave = false;
}
public function transitionSpeedIntro():void{
m_doInit = false;
addEventListener(Event.ENTER_FRAME, animFw);
m_startTime = -1;
textsAppearAt = -1;
m_stopFrame = 25;
isAutoLeave = false;
}
public function transitionNormalOutro():void{
m_doInit = false;
addEventListener(Event.ENTER_FRAME, animFw);
m_startTime = -1;
textsAppearAt = -1;
m_stopFrame = 24;
isAutoLeave = false;
}
public function transitionOpenOutro():void{
m_doInit = false;
addEventListener(Event.ENTER_FRAME, animFw);
m_startTime = -1;
textsAppearAt = -1;
m_stopFrame = 27;
isAutoLeave = false;
}
public function transitionSpeedOutro():void{
m_doInit = false;
addEventListener(Event.ENTER_FRAME, animFw);
m_startTime = -1;
textsAppearAt = -1;
isAutoLeave = false;
m_stopFrame = 26;
}
public function startIntro():void{
if (texts.anim1){
texts.anim1.start();
};
if (texts.anim2){
texts.anim2.start();
};
if (texts.anim3){
texts.anim3.start();
};
}
public function transitionRemove():void{
m_doInit = false;
m_startTime = -1;
removeEventListener(Event.ENTER_FRAME, appear);
if (texts.anim1){
texts.anim1.stop();
};
if (texts.anim2){
texts.anim2.stop();
};
if (texts.anim3){
texts.anim3.stop();
};
addEventListener(Event.ENTER_FRAME, animRw);
}
public function animRw(_arg1:Event):void{
var _local2:int = getTimer();
if (m_startTime < 0){
m_startTime = _local2;
};
var _local3:int = (22 - int(Math.round((((_local2 - m_startTime) / m_step) + 1))));
if (_local3 <= 1){
removeEventListener(Event.ENTER_FRAME, animRw);
_local3 = 1;
};
if (_local3 != currentFrame){
gotoAndStop(_local3);
};
}
public function appear(_arg1:Event):void{
var _local2:int = getTimer();
if (textsAppearAt < 0){
textsAppearAt = (_local2 + 500);
autoLeaveAt = (_local2 + 10000);
};
texts.alpha = (1 - (Math.max(0, (textsAppearAt - _local2)) / 500));
if (m_stopFrame == 23){
texts.countdown_txt.text = I18n.getString("intro_normal_countdown", int(((autoLeaveAt - _local2) / 1000)));
};
if (m_stopFrame == 25){
texts.countdown_txt.text = I18n.getString("intro_speed_countdown", int(((autoLeaveAt - _local2) / 1000)));
};
if ((((m_stopFrame == 24)) || ((m_stopFrame == 27)))){
texts.countdown_txt.text = I18n.getString("end_normal_countdown", int(((autoLeaveAt - _local2) / 1000)));
};
if (m_stopFrame == 26){
texts.countdown_txt.text = I18n.getString("end_speed_countdown", int(((autoLeaveAt - _local2) / 1000)));
};
if (wiggleTrophy1){
texts.trophy1.rotation = (Math.sin((_local2 / 200)) * 12);
};
if (wiggleTrophy2){
texts.trophy2.rotation = (Math.sin(((_local2 + 150) / 200)) * 12);
};
if (wiggleTrophy3){
texts.trophy3.rotation = (Math.sin(((_local2 + 300) / 200)) * 12);
};
if (_local2 > autoLeaveAt){
isAutoLeave = true;
removeEventListener(Event.ENTER_FRAME, appear);
};
}
public function animFw(_arg1:Event):void{
var _local4:int;
var _local5:int;
var _local2:int = getTimer();
if (((!(m_doInit)) && ((currentFrame == m_stopFrame)))){
m_doInit = true;
return;
};
if (m_doInit){
if (m_stopFrame == 23){
texts.instructions_txt.text = I18n.getString("intro_normal_text");
texts.title_txt.text = I18n.getString("intro_normal_title");
};
if (m_stopFrame == 25){
texts.anim1.start();
texts.anim2.start();
texts.text1_txt.text = I18n.getString("intro_speed_text1");
texts.text2_txt.text = I18n.getString("intro_speed_text2");
texts.text3_txt.text = I18n.getString("intro_speed_text3");
texts.title_txt.text = I18n.getString("intro_speed_title");
};
if (m_stopFrame == 24){
if (m_sharedData.finalScore > m_sharedData.bestScore){
texts.record_pop.start();
} else {
texts.record_pop.visible = false;
};
m_sharedData.bestScore = Math.max(m_sharedData.finalScore, m_sharedData.bestScore);
texts.title_txt.text = I18n.getString("end_normal_gameover");
texts.total_score_txt.text = I18n.getString("end_normal_total_score");
texts.total_score_val_txt.text = ("" + m_sharedData.finalScore);
texts.best_ever_txt.text = I18n.getString("end_normal_best_score");
texts.best_ever_val_txt.text = ("" + m_sharedData.bestScore);
texts.combo_txt.text = I18n.getString("end_normal_combo_bonus");
texts.combo_val_txt.text = ("" + I18n.getString("end_normal_combo_bonus_val", m_sharedData.finalCombo));
texts.time_txt.text = I18n.getString("end_normal_time_bonus");
texts.time_val_txt.text = ("" + m_sharedData.timeBonus);
texts.move_txt.text = I18n.getString("end_normal_move_bonus");
texts.move_val_txt.text = ("" + m_sharedData.shotBonus);
texts.trophy1_txt.text = I18n.getString("end_normal_trophy1");
texts.trophy2_txt.text = I18n.getString("end_normal_trophy2");
texts.trophy3_txt.text = I18n.getString("end_normal_trophy3");
texts.record_pop.inner.txt.text = I18n.getString("end_normal_new_record");
if (m_sharedData.trophies.indexOf("1") != -1){
texts.trophy1.gotoAndStop(10);
wiggleTrophy1 = true;
} else {
if (m_sharedData.finalScore >= 20000){
texts.trophy1.start();
};
};
if (m_sharedData.trophies.indexOf("2") != -1){
texts.trophy2.gotoAndStop(10);
wiggleTrophy2 = true;
} else {
if (m_sharedData.finalCombo >= 30){
texts.trophy2.start();
};
};
_local4 = int(((m_sharedData.totalGameTime - m_sharedData.numGameTicksLeft) / GameBase.TICK_RATE));
if (m_sharedData.trophies.indexOf("3") != -1){
texts.trophy3.gotoAndStop(10);
wiggleTrophy3 = true;
} else {
if (((m_sharedData.isGameWin) && ((_local4 < 120)))){
texts.trophy3.start();
};
};
};
if (m_stopFrame == 26){
if (m_sharedData.finalScore > m_sharedData.bestScore){
texts.record_pop.start();
} else {
texts.record_pop.visible = false;
};
m_sharedData.bestScore = Math.max(m_sharedData.bestScore, m_sharedData.finalScore);
m_sharedData.bestMultiplier = Math.max(m_sharedData.bestMultiplier, m_sharedData.finalMultiplier);
m_sharedData.bestCombo = Math.max(m_sharedData.bestCombo, m_sharedData.finalCombo);
texts.title_txt.text = I18n.getString("end_speed_gameover");
texts.score_txt.text = I18n.getString("end_speed_total_score");
texts.score_val_txt.text = m_sharedData.finalScore;
texts.score_best_txt.text = I18n.getString("end_speed_best_score");
texts.score_best_val_txt.text = m_sharedData.bestScore;
texts.record_this_game_txt.text = I18n.getString("end_speed_this_game");
texts.personal_best_txt.text = I18n.getString("end_speed_personal_best");
texts.multiplier_txt.text = I18n.getString("end_speed_multiplier");
texts.record_this_game_mul_val_txt.text = ("" + m_sharedData.finalMultiplier);
texts.personal_best_mul_val_txt.text = ("" + m_sharedData.bestMultiplier);
texts.best_combo_txt.text = I18n.getString("end_speed_best_combo");
texts.record_this_game_combo_val_txt.text = I18n.getString("end_speed_bubbles", m_sharedData.finalCombo);
texts.personal_best_combo_val_txt.text = I18n.getString("end_speed_bubbles", m_sharedData.bestCombo);
texts.trophy1_txt.text = I18n.getString("end_speed_trophy1");
texts.trophy2_txt.text = I18n.getString("end_speed_trophy2");
texts.trophy3_txt.text = I18n.getString("end_speed_trophy3");
texts.record_pop.inner.txt.text = I18n.getString("end_speed_new_record");
_local5 = 0;
if (m_sharedData.trophies.indexOf("1") != -1){
texts.trophy1.gotoAndStop(10);
wiggleTrophy1 = true;
} else {
if (m_sharedData.bestScore >= 200000){
texts.trophy1.start();
_local5++;
};
};
if (m_sharedData.trophies.indexOf("2") != -1){
texts.trophy2.gotoAndStop(10);
wiggleTrophy2 = true;
} else {
if (m_sharedData.bestMultiplier >= 20){
texts.trophy2.start();
_local5++;
};
};
if (m_sharedData.trophies.indexOf("3") != -1){
texts.trophy3.gotoAndStop(10);
wiggleTrophy3 = true;
} else {
if ((m_sharedData.numPlayed + 1) >= 100){
texts.trophy3.start();
_local5++;
};
};
if (_local5 > 0){
};
};
if (m_stopFrame == 27){
texts.title_txt.text = I18n.getString("end_normal_gameover");
texts.msg_txt.text = I18n.getString("end_opengame");
texts.score_txt.text = I18n.getString("end_normal_total_score");
texts.score_val_txt.text = ("" + m_sharedData.finalScore);
};
addEventListener(Event.ENTER_FRAME, appear);
removeEventListener(Event.ENTER_FRAME, animFw);
return;
};
if (m_startTime < 0){
m_startTime = _local2;
};
var _local3:int = int(Math.round((((_local2 - m_startTime) / m_step) + 1)));
if (_local3 > 22){
_local3 = m_stopFrame;
};
if (_local3 != currentFrame){
gotoAndStop(_local3);
};
}
}
}//package game
Section 19
//ScorePop (game.ScorePop)
package game {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class ScorePop extends MovieClip {
public var number0:MovieClip;
public var number1:MovieClip;
public var number2:MovieClip;
private var m_startTime:int;
public function ScorePop(_arg1:int){
var _local2:int = ((_arg1 % 10) + 1);
number0.gotoAndStop(_local2);
_local2 = ((int((_arg1 / 10)) % 10) + 1);
number1.gotoAndStop(_local2);
_local2 = ((int((_arg1 / 100)) % 10) + 1);
number2.gotoAndStop(_local2);
number1.visible = (_arg1 > 9);
number2.visible = (_arg1 > 99);
gotoAndStop(1);
m_startTime = -1;
visible = false;
addEventListener(Event.ENTER_FRAME, enterFrame);
}
public function enterFrame(_arg1:Event):void{
var _local2:int = getTimer();
if (m_startTime < 0){
m_startTime = _local2;
visible = true;
};
var _local3:* = ((1 / 25) * 1000);
var _local4:uint = int(Math.round((((_local2 - m_startTime) / _local3) + 1)));
if (_local4 > totalFrames){
removeEventListener(Event.ENTER_FRAME, enterFrame);
parent.removeChild(this);
return;
};
if (_local4 != currentFrame){
gotoAndStop(_local4);
};
}
}
}//package game
Section 20
//ScorePopHigh (game.ScorePopHigh)
package game {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class ScorePopHigh extends MovieClip {
public var number0:MovieClip;
public var pop3:MovieClip;
public var number1:MovieClip;
public var pop4:MovieClip;
public var number2:MovieClip;
public var pop5:MovieClip;
public var number3:MovieClip;
public var number4:MovieClip;
private var startTime:int;
private var spark:Boolean;
private var score:int;
public function ScorePopHigh(_arg1:int){
var _local2:int;
super();
this.spark = false;
this.score = _arg1;
number0.visible = false;
number1.visible = false;
number2.visible = false;
number3.visible = false;
number4.visible = false;
if (_arg1 > 9999){
_local2 = ((_arg1 % 10) + 1);
number0.gotoAndStop(_local2);
number0.visible = true;
_local2 = ((int((_arg1 / 10)) % 10) + 1);
number1.gotoAndStop(_local2);
number1.visible = true;
_local2 = ((int((_arg1 / 100)) % 10) + 1);
number2.gotoAndStop(_local2);
number2.visible = true;
_local2 = ((int((_arg1 / 1000)) % 10) + 1);
number3.gotoAndStop(_local2);
number3.visible = true;
_local2 = ((int((_arg1 / 10000)) % 10) + 1);
number4.gotoAndStop(_local2);
number4.visible = true;
} else {
if (_arg1 > 999){
_local2 = ((_arg1 % 10) + 1);
number0.gotoAndStop(_local2);
number0.visible = true;
_local2 = ((int((_arg1 / 10)) % 10) + 1);
number1.gotoAndStop(_local2);
number1.visible = true;
_local2 = ((int((_arg1 / 100)) % 10) + 1);
number2.gotoAndStop(_local2);
number2.visible = true;
_local2 = ((int((_arg1 / 1000)) % 10) + 1);
number3.gotoAndStop(_local2);
number3.visible = true;
} else {
if (_arg1 > 99){
_local2 = ((_arg1 % 10) + 1);
number1.gotoAndStop(_local2);
number1.visible = true;
_local2 = ((int((_arg1 / 10)) % 10) + 1);
number2.gotoAndStop(_local2);
number2.visible = true;
_local2 = ((int((_arg1 / 100)) % 10) + 1);
number3.gotoAndStop(_local2);
number3.visible = true;
};
};
};
number0.bkg1.visible = (Math.random() > 0.5);
number0.bkg2.visible = (Math.random() > 0.25);
number1.bkg1.visible = (Math.random() > 0.5);
number1.bkg2.visible = (Math.random() > 0.25);
number2.bkg1.visible = (Math.random() > 0.5);
number2.bkg2.visible = (Math.random() > 0.25);
number3.bkg1.visible = (Math.random() > 0.5);
number3.bkg2.visible = (Math.random() > 0.25);
number4.bkg1.visible = (Math.random() > 0.5);
number4.bkg2.visible = (Math.random() > 0.25);
gotoAndStop(1);
startTime = -1;
visible = false;
pop5.visible = false;
pop4.visible = false;
pop3.visible = false;
addEventListener(Event.ENTER_FRAME, enterFrame);
}
public function enterFrame(_arg1:Event):void{
var _local2:int = getTimer();
if (startTime < 0){
startTime = _local2;
visible = true;
};
var _local3:* = ((1 / 25) * 1000);
var _local4:uint = int(Math.round((((_local2 - startTime) / _local3) + 1)));
if ((((_local4 > (totalFrames - 3))) && (!(spark)))){
spark = true;
if (score > 9999){
pop5.visible = true;
} else {
if (score > 999){
pop4.visible = true;
} else {
if (score > 99){
pop3.visible = true;
};
};
};
};
if (_local4 > totalFrames){
removeEventListener(Event.ENTER_FRAME, enterFrame);
parent.removeChild(this);
return;
};
if (_local4 != currentFrame){
gotoAndStop(_local4);
};
}
}
}//package game
Section 21
//SharedData (game.SharedData)
package game {
public class SharedData {
public var bestScore:int;
public var bestMultiplier:int;
public var bestCombo:int;
public var numPlayed:int;
public var finalMultiplier:int;
public var finalCombo:int;
public var trophies:String;
public var score:int;
public var shotBonus:int;
public var timeBonus:int;
public var finalScore:int;
public var shotBonusMax:int;
public var isGameWin:Boolean;
public var isGameOver:Boolean;
public var isNoMoreBubbles:Boolean;
public var globalTick:int;
public var globalSeed:int;
public var numGameTicksLeft:int;
public var build:int;
public var colors:int;
public var rows:int;
public var buildDate:Date;
public var totalGameTime:int;
public var isShortMode:Boolean;
public var isSpeedMode:Boolean;
public var bonusLevel:Array;
public var bonusLevelSubScore:Array;
public var startMultiplier:int;
public function SharedData(){
trophies = "";
bestScore = 0;
bestCombo = 0;
bestMultiplier = 0;
isShortMode = false;
bonusLevel = new Array();
bonusLevelSubScore = new Array();
score = 0;
timeBonus = 0;
rows = 20;
colors = 5;
finalScore = 0;
shotBonus = 25000;
isGameWin = false;
isNoMoreBubbles = false;
isGameOver = false;
globalSeed = 0;
startMultiplier = 1;
}
public function setGameTime(_arg1:int):void{
totalGameTime = (numGameTicksLeft = int((GameBase.TICK_RATE * _arg1)));
}
}
}//package game
Section 22
//State (game.State)
package game {
public interface State {
function tick(_arg1:int):void;
function render(_arg1:int, _arg2:Number):void;
function engage():void;
function disengage():void;
function hasExitButton():Boolean;
function hasSoundButton():Boolean;
function onGameQuitButton():void;
function onMouseDown():void;
function onMouseUp():void;
function onMouseMove(_arg1:int, _arg2:int):void;
function onPoorFrameRate():void;
}
}//package game
Section 23
//StateBase (game.StateBase)
package game {
public class StateBase implements State {
public function tick(_arg1:int):void{
}
public function render(_arg1:int, _arg2:Number):void{
}
public function engage():void{
}
public function disengage():void{
}
public function hasExitButton():Boolean{
return (true);
}
public function hasSoundButton():Boolean{
return (true);
}
public function onGameQuitButton():void{
}
public function onMouseDown():void{
}
public function onMouseUp():void{
}
public function onMouseMove(_arg1:int, _arg2:int):void{
}
public function onPoorFrameRate():void{
}
}
}//package game
Section 24
//StateEnd (game.StateEnd)
package game {
public class StateEnd extends StateBase {
private var m_game:Game;
private var m_tick:int;
private var m_sendQuitAt:int;
private var m_isMouseDown:Boolean;
private var m_isEarlyExit:Boolean;
public function StateEnd(_arg1:Game, _arg2:int){
m_game = _arg1;
}
override public function tick(_arg1:int):void{
m_tick = _arg1;
var _local2:* = m_game.getDisplayObjectContainer();
if (((!(m_isEarlyExit)) && (_local2.big_leaf.isAutoLeave))){
m_isEarlyExit = true;
m_isMouseDown = false;
m_sendQuitAt = (_arg1 + 1);
} else {
if (((((!(m_isEarlyExit)) && ((_arg1 > 45)))) && (m_isMouseDown))){
m_isEarlyExit = true;
m_isMouseDown = false;
m_sendQuitAt = (_arg1 + (GameBase.TICK_RATE * 2));
};
};
if (m_sendQuitAt == _arg1){
m_game.destroy();
};
m_isMouseDown = false;
}
override public function render(_arg1:int, _arg2:Number):void{
}
override public function engage():void{
var _local3:Number;
var _local1:SharedData = m_game.getSharedData();
m_sendQuitAt = (GameBase.TICK_RATE * 10);
m_isEarlyExit = false;
m_sendQuitAt = -1;
var _local2:* = m_game.getDisplayObjectContainer();
if (!_local1.isGameWin){
_local1.shotBonus = 0;
} else {
_local3 = GameBase.TICK_RATE;
_local1.timeBonus = int((((_local1.numGameTicksLeft / _local3) / (_local1.totalGameTime / _local3)) * 1000));
};
m_game.sendData((((((((("201," + m_tick) + ",") + _local1.score) + ",") + _local1.shotBonus) + ",0,") + _local1.timeBonus) + ",0=0"));
_local1.finalScore = ((_local1.score + _local1.shotBonus) + _local1.timeBonus);
m_game.getMusicManager().stopAll();
if (_local1.isShortMode){
m_game.getMusicManager().get("end2").play(0.6);
_local2.big_leaf.transitionOpenOutro();
} else {
if (_local1.isSpeedMode){
m_game.getMusicManager().get("end1").play(0.6);
_local2.big_leaf.transitionSpeedOutro();
} else {
m_game.getMusicManager().get("end2").play(0.6);
_local2.big_leaf.transitionNormalOutro();
};
};
m_game.finalScore(_local1.finalScore);
}
override public function onMouseDown():void{
m_isMouseDown = true;
}
override public function disengage():void{
var _local1:SharedData = m_game.getSharedData();
if (_local1.isSpeedMode){
m_game.getMusicManager().get("end1").fadeToAndStop(0, 1000);
} else {
m_game.getMusicManager().get("end2").fadeToAndStop(0, 1000);
};
}
override public function hasSoundButton():Boolean{
return (true);
}
override public function hasExitButton():Boolean{
return (false);
}
}
}//package game
Section 25
//StateGame (game.StateGame)
package game {
import sfx.*;
import geom.*;
import math.*;
import util.*;
public class StateGame extends StateBase implements BubbleListener {
private var m_newMouseX:int;
private var m_newMouseY:int;
private var m_mouseX:int;
private var m_mouseY:int;
private var m_game:Game;
private var m_bubbles:BubbleBox;
private var m_aimCursor:AimCursor;
private var m_bubbleLauncher:BubbleLauncher;
private var m_tick:int;
private var m_ballRng:MtRandom;
private var m_tickList:Array;
private var m_aimBubble:Bubble;
private var m_nextBubble:Bubble;
private var m_isMouseDown:Boolean;
private var m_lastTickScore:int;
private var m_lastScoring:int;
private var m_lastScoreDisp:int;
private var m_lastShotBonusDisp:int;
private var m_leaveGameAt:int;
private var m_collidableList:Array;
private var m_lastMultipierX:int;
private var m_lastMultipierY:int;
private var m_accumulatedMultiplierInc:int;
private var m_startLoopAt:int;
var animalLever:int;// = 2
public function StateGame(_arg1:Game, _arg2:int){
m_game = _arg1;
m_tick = -2;
m_leaveGameAt = -1;
m_lastScoreDisp = -1;
m_lastShotBonusDisp = -1;
m_collidableList = new Array();
m_collidableList.push(new Line(32, -2500, 32, 500));
m_collidableList.push(new Line(0x0100, -2500, 0x0100, 500));
m_isMouseDown = false;
m_tickList = new Array();
}
public function onMultiplierChanged(_arg1:int, _arg2:int, _arg3:int, _arg4:int):void{
m_lastMultipierX = _arg1;
m_lastMultipierY = _arg2;
if (m_accumulatedMultiplierInc == -1){
m_accumulatedMultiplierInc = _arg4;
} else {
m_accumulatedMultiplierInc = (m_accumulatedMultiplierInc + _arg4);
};
if (_arg4 <= 1){
if (!m_game.getSoundManager().get("multiplier_collected1").isPlaying()){
m_game.getSoundManager().get("multiplier_collected1").play();
};
};
if (_arg4 >= 2){
if (!m_game.getSoundManager().get("double_multiplier_collected").isPlaying()){
m_game.getSoundManager().get("double_multiplier_collected").play();
};
};
var _local5:* = m_game.getDisplayObjectContainer();
_local5.bonus_val_txt.text = ("x " + _arg3);
}
public function onEarlyExit():void{
m_leaveGameAt = (m_tick + 1);
}
public function onBubbleRemove(_arg1:int):void{
var _local4:int;
var _local5:int;
var _local2:Array = m_bubbles.getUniqueColors();
var _local3:Boolean;
_local5 = 0;
while (((!(_local3)) && ((_local5 < _local2.length)))) {
if (m_aimBubble.getColorIndex() == _local2[_local5]){
_local3 = true;
};
_local5++;
};
if (!_local3){
_local4 = _local2[m_ballRng.nextInt(_local2.length)];
m_aimBubble.setColorIndex(_local4);
};
_local3 = false;
_local5 = 0;
while (((!(_local3)) && ((_local5 < _local2.length)))) {
if (m_nextBubble.getColorIndex() == _local2[_local5]){
_local3 = true;
};
_local5++;
};
if (!_local3){
_local4 = _local2[m_ballRng.nextInt(_local2.length)];
m_nextBubble.setColorIndex(_local4);
};
m_aimCursor.setColor(m_aimBubble.getColorIndex());
}
public function onNoMoreBubbles():void{
}
override public function tick(_arg1:int):void{
var _local8:TickObject;
var _local9:ManagedSoundChannel;
m_tick = _arg1;
var _local2:* = m_game.getSharedData();
var _local3:* = m_game.getDisplayObjectContainer();
m_lastTickScore = _local2.score;
if (m_accumulatedMultiplierInc != -1){
_local3.addChild(new BigPopper(m_lastMultipierX, m_lastMultipierY, m_accumulatedMultiplierInc));
m_accumulatedMultiplierInc = -1;
};
if (_local2.numGameTicksLeft == (GameBase.TICK_RATE * 10)){
_local3.time_up.start();
m_game.getSoundManager().get("time_warning1").play();
};
if ((((_local2.numGameTicksLeft == 0)) && (!(_local2.isGameOver)))){
_local3.time_up.remove();
_local2.isGameOver = true;
_local2.isGameWin = false;
m_leaveGameAt = (_arg1 + (GameBase.TICK_RATE * 2));
m_bubbles.disableBubbles();
};
if (_arg1 == m_leaveGameAt){
m_game.leaveGame();
return;
};
handleMouseDown();
m_bubbles.tick(_arg1);
m_bubbleLauncher.tick(_arg1, m_mouseX, m_mouseY);
m_aimCursor.tick(m_mouseX, m_mouseY);
if (!_local2.isGameOver){
if (_local2.isNoMoreBubbles){
m_game.sendData((("200," + m_tick) + ",0=0"));
_local2.isGameOver = true;
_local2.isGameWin = true;
m_leaveGameAt = (m_tick + (GameBase.TICK_RATE * 2));
} else {
_local2.numGameTicksLeft--;
};
};
var _local4:int;
while (_local4 < m_tickList.length) {
_local8 = m_tickList[_local4];
_local8.tick(_arg1);
if (_local8.isRemoving){
_local8.isRemoving = false;
m_tickList.splice(_local4, 1);
} else {
_local4++;
};
};
var _local5:int = int(((_local2.numGameTicksLeft / GameBase.TICK_RATE) * 1000));
var _local6:String = Numbers.asTime(_local5, false, true);
if (_local3.time_val_txt.text != _local6){
_local3.time_val_txt.text = _local6;
};
if (m_startLoopAt == _arg1){
_local9 = m_game.getMusicManager().get("loop1").loop(0);
_local9.fadeTo(0.6, 500);
};
if (m_lastScoreDisp != _local2.score){
m_lastScoreDisp = _local2.score;
_local3.points_val_txt.text = _local2.score;
};
if (!_local2.isSpeedMode){
if (m_lastShotBonusDisp != _local2.shotBonus){
m_lastShotBonusDisp = _local2.shotBonus;
_local3.bonus_val_txt.text = _local2.shotBonus;
};
};
var _local7:int = (_local2.score - m_lastTickScore);
if (_local7 > 0){
m_lastScoring = _arg1;
};
if (_local7 != 0){
m_game.sendData(((("2," + m_tick) + ",0=") + _local7));
};
}
override public function render(_arg1:int, _arg2:Number):void{
var _local3:int;
while (_local3 < m_tickList.length) {
m_tickList[_local3].render(_arg1, _arg2);
_local3++;
};
m_bubbles.render(_arg1, _arg2);
m_bubbleLauncher.render(_arg1, _arg2);
m_aimCursor.update(_arg1, _arg2);
}
override public function engage():void{
var _local1:* = m_game.getDisplayObjectContainer();
var _local2:SharedData = m_game.getSharedData();
m_aimCursor = _local1.aim_over;
m_aimCursor.setAncorPosition((454 + 8), 334);
m_aimCursor.setVisibleLimit(332, 20, 588, 560);
m_bubbleLauncher = _local1.bubble_launcher;
m_bubbleLauncher.setPosition((458 + 8), 334);
m_bubbleLauncher.setAimChangeCallback(onChangeBubbleAim);
m_accumulatedMultiplierInc = -1;
var _local3:int = _local2.globalSeed;
_local2.shotBonus = _local2.shotBonusMax;
m_bubbles = new BubbleBox(m_game, _local2, _local3, _local2.rows, [1, 2, 3, 4, 5].splice(0, _local2.colors), 10, _local2.startMultiplier);
m_bubbles.setPreferredBottomPos(2);
if (_local2.isShortMode){
m_bubbles.setEarlyGameEnd(12);
};
m_bubbles.addListener(this);
var _local4:* = _local1.getChildByName("bubbleBoxParent");
_local4.addChild(m_bubbles);
m_ballRng = new MtRandom((_local3 + 1));
m_startLoopAt = (m_tick + 25);
m_game.getMusicManager().get("game_start").play();
m_game.sendData((((("99," + m_tick) + ",") + _local2.globalSeed) + ",0=0"));
nextBubble();
m_game.flush();
}
public function onChangeBubbleAim(_arg1:Number, _arg2:Number):void{
var _local3:* = m_game.getDisplayObjectContainer();
if (_arg1 < ((-(Math.PI) / 2) - (Math.PI / 4))){
_local3.animal.gotoAndStop(1);
} else {
if (_arg1 < (-(Math.PI) / 2)){
_local3.animal.gotoAndStop(2);
} else {
if (_arg1 > ((-(Math.PI) / 2) + (Math.PI / 4))){
_local3.animal.gotoAndStop(3);
} else {
if (_arg1 > (-(Math.PI) / 2)){
_local3.animal.gotoAndStop(2);
} else {
_local3.gotoAndStop(1);
};
};
};
};
}
override public function disengage():void{
var _local1:* = m_game.getDisplayObjectContainer();
_local1.time_up.remove();
var _local2:SharedData = m_game.getSharedData();
_local2.finalMultiplier = m_bubbles.getMultiplier();
_local2.finalCombo = m_bubbles.getCombo();
if (m_aimBubble != null){
m_aimBubble.remove();
m_aimBubble = null;
};
if (m_nextBubble != null){
m_nextBubble.remove();
m_nextBubble = null;
};
}
override public function onGameQuitButton():void{
m_game.getSharedData().shotBonus = 0;
m_game.sendData((("113," + m_tick) + ",0=0"));
}
override public function onMouseDown():void{
if (m_game.getSharedData().isGameOver){
return;
};
if (m_mouseY > 390){
return;
};
m_game.sendData((((((("1," + m_tick) + ",") + m_mouseX) + ",") + m_mouseY) + ",0=0"));
m_isMouseDown = true;
}
private function handleMouseDown():void{
m_mouseX = m_newMouseX;
m_mouseY = m_newMouseY;
if (!m_isMouseDown){
return;
};
m_isMouseDown = false;
if (((m_bubbles.canFire()) && (m_bubbleLauncher.fire()))){
m_game.getSoundManager().get("ball_shot1").play();
m_game.sendData((((("1002," + m_tick) + ",") + m_bubbleLauncher.getRad()) + ",0=0"));
m_game.getSharedData().shotBonus = (m_game.getSharedData().shotBonus - 200);
if (m_game.getSharedData().shotBonus < 0){
m_game.getSharedData().shotBonus = 0;
};
m_bubbles.addLiveBubble(m_aimBubble);
m_tickList.push(m_aimBubble);
nextBubble();
};
}
override public function hasSoundButton():Boolean{
return (true);
}
override public function hasExitButton():Boolean{
return (true);
}
override public function onMouseMove(_arg1:int, _arg2:int):void{
m_newMouseX = _arg1;
m_newMouseY = _arg2;
}
private function nextBubble():void{
var _local1:int;
var _local2:Array;
var _local3:* = m_game.getDisplayObjectContainer();
if (m_aimBubble == null){
m_aimBubble = new Bubble();
m_aimBubble.setBubbleParent(_local3.bubble_base);
m_aimBubble.assureFull();
m_aimBubble.setCollidableList(m_collidableList);
_local3.addChild(m_aimBubble.bubble);
_local2 = m_bubbles.getUniqueColors();
_local1 = _local2[m_ballRng.nextInt(_local2.length)];
m_aimBubble.setColorIndex(_local1);
m_game.sendData((((("76," + m_tick) + ",") + _local1) + ",0=0"));
m_aimBubble.gotoAimPosition();
} else {
m_aimBubble = m_nextBubble;
m_aimBubble.gotoAimPosition();
};
m_bubbleLauncher.setBubble(m_aimBubble);
m_nextBubble = new Bubble();
m_nextBubble.assureFull();
m_nextBubble.setBubbleParent(_local3.bubble_base);
m_nextBubble.setCollidableList(m_collidableList);
_local3.addChild(m_nextBubble.bubble);
_local2 = m_bubbles.getUniqueColors();
_local1 = _local2[m_ballRng.nextInt(_local2.length)];
m_nextBubble.setColorIndex(_local1);
m_game.sendData((((("77," + m_tick) + ",") + _local1) + ",0=0"));
m_nextBubble.gotoPreviewPosition();
m_aimCursor.setColor(m_aimBubble.getColorIndex());
}
}
}//package game
Section 26
//StateIntro (game.StateIntro)
package game {
import localization.*;
import util.*;
public class StateIntro extends StateBase {
private var m_mouseX:int;
private var m_mouseY:int;
private var m_game:Game;
private var m_hasLeft:Boolean;
private var m_hideAt:int;
private var m_possiblyLeaveDelay:int;
private var m_leaveAt:int;
private var m_nextSlideAt:int;
private var m_startIntroAt:int;
private var m_tick:int;
public function StateIntro(_arg1:Game, _arg2:int){
m_hideAt = -1;
m_startIntroAt = -1;
m_leaveAt = -1;
m_possiblyLeaveDelay = -1;
m_hasLeft = false;
m_game = _arg1;
m_tick = -2;
}
override public function tick(_arg1:int):void{
var _local2:* = m_game.getDisplayObjectContainer();
m_tick = _arg1;
if (m_startIntroAt == -1){
m_startIntroAt = (m_tick + (GameBase.TICK_RATE * 1.5));
};
if (m_startIntroAt == _arg1){
_local2.big_leaf.startIntro();
m_possiblyLeaveDelay = (m_tick + (GameBase.TICK_RATE * 1));
};
if (m_hideAt == _arg1){
_local2.big_leaf.transitionRemove();
};
if (((!(m_hasLeft)) && (_local2.big_leaf.isAutoLeave))){
leave();
};
if (m_leaveAt == _arg1){
m_game.leaveState();
};
}
public function leave(){
if (((((!(m_hasLeft)) && (!((m_possiblyLeaveDelay == -1))))) && ((m_tick > m_possiblyLeaveDelay)))){
m_hasLeft = true;
m_hideAt = (m_tick + 1);
m_leaveAt = (m_tick + 25);
};
}
override public function render(_arg1:int, _arg2:Number):void{
}
override public function engage():void{
var _local1:* = m_game.getSharedData();
var _local2:* = m_game.getDisplayObjectContainer();
_local2.animal.stop();
_local2.time_txt.text = I18n.getString("time");
var _local3:int = int(((_local1.numGameTicksLeft / GameBase.TICK_RATE) * 1000));
_local2.time_val_txt.text = Numbers.asTime(_local3, false, true);
_local2.points_txt.text = I18n.getString("score");
_local2.points_val_txt.text = "0";
_local2.big_leaf.setGame(m_game);
if (_local1.isSpeedMode){
m_game.getMusicManager().get("intro1").play();
_local2.bonus_val_txt.text = ("x " + String(_local1.startMultiplier));
_local2.bonus_txt.text = I18n.getString("multiplier");
_local2.big_leaf.transitionSpeedIntro();
} else {
m_game.getMusicManager().get("intro2").play();
_local2.bonus_txt.text = I18n.getString("bonus");
_local2.bonus_val_txt.text = _local1.shotBonus;
_local2.big_leaf.transitionIntro();
};
}
override public function disengage():void{
m_game.getMusicManager().stopAll();
}
override public function onMouseMove(_arg1:int, _arg2:int):void{
m_mouseX = _arg1;
m_mouseY = _arg2;
}
override public function onGameQuitButton():void{
m_game.getSharedData().shotBonus = 0;
}
override public function onMouseDown():void{
if (m_mouseY < 390){
leave();
};
}
override public function hasSoundButton():Boolean{
return (true);
}
override public function hasExitButton():Boolean{
return (false);
}
}
}//package game
Section 27
//TickObject (game.TickObject)
package game {
public class TickObject {
public var isRemoving:Boolean;
public function TickObject(){
isRemoving = false;
}
public function tick(_arg1:int):void{
}
public function render(_arg1:int, _arg2:Number):void{
}
}
}//package game
Section 28
//TimeUp (game.TimeUp)
package game {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class TimeUp extends MovieClip {
private var startTime:int;
public function TimeUp(){
gotoAndStop(1);
visible = false;
}
public function remove(){
removeEventListener(Event.ENTER_FRAME, enterFrame);
visible = false;
}
public function start(){
startTime = -1;
addEventListener(Event.ENTER_FRAME, enterFrame);
}
public function enterFrame(_arg1:Event):void{
var _local2:int = getTimer();
if (startTime < 0){
startTime = _local2;
visible = true;
};
var _local3:* = ((1 / 30) * 1000);
var _local4:uint = int(Math.round((((_local2 - startTime) / _local3) + 1)));
if (_local4 > totalFrames){
_local4 = totalFrames;
startTime = -1;
};
if (_local4 != currentFrame){
gotoAndStop(_local4);
};
}
}
}//package game
Section 29
//Line (geom.Line)
package geom {
public class Line {
public var x1:Number;
public var y1:Number;
public var x2:Number;
public var y2:Number;
public function Line(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0){
this.x1 = _arg1;
this.y1 = _arg2;
this.x2 = _arg3;
this.y2 = _arg4;
}
public function distance(_arg1:Number, _arg2:Number):Number{
return (Math.sqrt(distanceSquared(_arg1, _arg2)));
}
public function distanceSquared(_arg1:Number, _arg2:Number):Number{
var _local3:* = (x2 - x1);
var _local4:* = (y2 - y1);
var _local5:* = (_arg1 - x1);
var _local6:* = (_arg2 - y1);
var _local7:* = ((_local5 * _local3) + (_local6 * _local4));
var _local8:* = ((_local3 * _local3) + (_local4 * _local4));
var _local9:* = (_local7 / _local8);
var _local10:* = (x1 + (_local9 * _local3));
var _local11:* = (y1 + (_local9 * _local4));
var _local12:* = (_arg1 - _local10);
_local12 = ((_arg1 - _local10) * _local12);
var _local13:* = (_arg2 - _local11);
_local13 = ((_arg2 - _local11) * _local13);
return ((_local12 + _local13));
}
public function intersects(_arg1:Line):Boolean{
var _local10:*;
var _local2:* = (x2 - x1);
var _local3:* = (y2 - y1);
var _local4:* = (_arg1.x2 - _arg1.x1);
var _local5:* = (_arg1.y2 - _arg1.y1);
var _local6:* = ((_local5 * _local2) - (_local4 * _local3));
if (_local6 == 0){
return (false);
};
var _local7:* = (x1 - _arg1.x1);
var _local8:* = (y1 - _arg1.y1);
var _local9:* = (((_local4 * _local8) - (_local5 * _local7)) / _local6);
if ((((_local9 > 0)) && ((_local9 < 1)))){
_local10 = (((_local2 * _local8) - (_local3 * _local7)) / _local6);
return ((((_local10 > 0)) && ((_local10 < 1))));
};
return (false);
}
public function length():Number{
var _local1:* = (x1 - x2);
var _local2:* = (y1 - y2);
return (Math.sqrt(((_local1 * _local1) + (_local2 * _local2))));
}
public function intersectionPoint(_arg1:Line):Pt{
var _local2:* = _arg1.x1;
var _local3:* = _arg1.x2;
var _local4:* = _arg1.y1;
var _local5:* = _arg1.y2;
var _local6:* = (x1 - _local2);
var _local7:* = (y1 - _local4);
var _local8:* = (_local3 - _local2);
var _local9:* = (_local5 - _local4);
var _local10:* = (x2 - x1);
var _local11:* = (y2 - y1);
var _local12:* = ((_local9 * _local10) - (_local8 * _local11));
var _local13:* = (((_local8 * _local7) - (_local9 * _local6)) / _local12);
var _local14:* = (((_local10 * _local7) - (_local11 * _local6)) / _local12);
var _local15:Pt;
if ((((((_local13 > 0)) && ((_local13 < 1)))) && ((((_local14 > 0)) && ((_local14 < 1)))))){
_local15 = new Pt((x1 + (_local13 * (x2 - x1))), (y1 + (_local13 * (y2 - y1))));
};
return (_local15);
}
}
}//package geom
Section 30
//Pt (geom.Pt)
package geom {
public class Pt {
public var x:Number;
public var y:Number;
public function Pt(_arg1:Number=0, _arg2:Number=0){
this.x = _arg1;
this.y = _arg2;
}
public function toString():String{
return ((((("Pt[" + x) + ",") + y) + "]"));
}
}
}//package geom
Section 31
//Vec2D (geom.Vec2D)
package geom {
public class Vec2D {
public var x:Number;
public var y:Number;
public function Vec2D(_arg1:Number=0, _arg2:Number=0){
this.x = _arg1;
this.y = _arg2;
}
public function normalize():void{
var _local2:*;
var _local1:* = Math.sqrt(((x * x) + (y * y)));
if (_local1 > 0){
_local2 = (1 / _local1);
x = (x * _local2);
y = (y * _local2);
};
}
public function copyFrom(_arg1:Vec2D):void{
x = _arg1.x;
y = _arg1.y;
}
public function dot(_arg1:Vec2D):Number{
return (((_arg1.x * x) + (_arg1.y * y)));
}
public function length():Number{
return (Math.sqrt(((x * x) + (y * y))));
}
public function toString():String{
return (((x + ", ") + y));
}
}
}//package geom
Section 32
//bubbleBoxContainer_7 (jungle_bubble_fla.bubbleBoxContainer_7)
package jungle_bubble_fla {
import flash.display.*;
public dynamic class bubbleBoxContainer_7 extends MovieClip {
public function bubbleBoxContainer_7(){
addFrameScript(1, frame2);
}
function frame2(){
stop();
}
}
}//package jungle_bubble_fla
Section 33
//I18n (localization.I18n)
package localization {
public class I18n {
private static var m_strings:Object;
public function I18n(){
m_strings = new Object();
}
public static function init(_arg1:Object):void{
var _local2:String;
m_strings = new Object();
for (_local2 in _arg1) {
m_strings[_local2] = _arg1[_local2];
};
}
public static function getString(_arg1:String, ... _args):String{
var _local3:String;
var _local4:*;
var _local5:RegExp;
if (m_strings[_arg1] != undefined){
_local3 = m_strings[_arg1];
if (_args.length > 0){
_local4 = 0;
while (_local4 < _args.length) {
_local5 = new RegExp((("\\{" + _local4) + "\\}"), "gi");
_local3 = _local3.replace(_local5, _args[_local4]);
_local4++;
};
};
return (_local3);
} else {
};
return ((!NULL! + !NULL!));
}
}
}//package localization
Section 34
//MtRandom (math.MtRandom)
package math {
import flash.utils.*;
public class MtRandom {
private var mt:Array;
private var mti:uint;
public static var N:int = 624;
public static var M:int = 397;
public static var MATRIX_A:uint = 2567483615;
public static var UPPER_MASK:uint = 2147483648;
public static var LOWER_MASK:uint = 2147483647;
private static var mag01:Array = [uint(0), uint(MATRIX_A)];
public function MtRandom(_arg1:uint=0){
mti = (N + 1);
super();
if (_arg1 == 0){
_arg1 = getTimer();
};
mt = new Array(N);
init_genrand(_arg1);
}
public function setSeed(_arg1:uint):void{
init_genrand(_arg1);
}
public function nextInt(_arg1:uint):uint{
return (((genrand_int32() & 2147483647) % _arg1));
}
public function nextFloat():Number{
return ((next(24) / 16777216));
}
public function nextDouble():Number{
return ((next(24) / 16777216));
}
private function next(_arg1:uint):uint{
return ((genrand_int32() & ((uint(1) << _arg1) - uint(1))));
}
private function init_genrand(_arg1:uint){
var _local2:uint;
var _local3:uint;
mt[0] = uint(_arg1);
mti = 1;
while (mti < N) {
_local2 = (mt[(mti - 1)] ^ (mt[(mti - 1)] >>> 30));
_local3 = uint((_local2 * 1289));
_local3 = uint((_local3 * 1406077));
_local3 = uint((_local3 + mti));
mt[mti] = _local3;
mti++;
};
}
private function genrand_int32():uint{
var _local1:Number;
var _local2:uint;
if (mti >= N){
if (mti == (N + 1)){
init_genrand(5489);
};
_local2 = 0;
while (_local2 < (N - M)) {
_local1 = ((mt[_local2] & UPPER_MASK) | (mt[(_local2 + 1)] & LOWER_MASK));
mt[_local2] = ((mt[(_local2 + M)] ^ (_local1 >>> 1)) ^ mag01[uint((_local1 & 1))]);
_local2++;
};
while (_local2 < (N - 1)) {
_local1 = ((mt[_local2] & UPPER_MASK) | (mt[(_local2 + 1)] & LOWER_MASK));
mt[_local2] = ((mt[(_local2 + (M - N))] ^ (_local1 >>> 1)) ^ mag01[uint((_local1 & 1))]);
_local2++;
};
_local1 = ((mt[(N - 1)] & UPPER_MASK) | (mt[0] & LOWER_MASK));
mt[(N - 1)] = ((mt[(M - 1)] ^ (_local1 >>> 1)) ^ mag01[uint((_local1 & 1))]);
mti = 0;
};
_local1 = mt[mti++];
_local1 = (_local1 ^ (_local1 >>> 11));
_local1 = (_local1 ^ ((_local1 << 7) & 2636928640));
_local1 = (_local1 ^ ((_local1 << 15) & 4022730752));
_local1 = (_local1 ^ (_local1 >>> 18));
return (uint(_local1));
}
}
}//package math
Section 35
//XPMath (math.XPMath)
package math {
public class XPMath {
public static function atan2(_arg1:Number, _arg2:Number):Number{
var _local5:Number;
var _local3:Number = 3.14159265358979;
var _local4:Number = 1.5707963267949;
if (_arg2 == 0){
if (_arg1 > 0){
return (_local4);
};
if (_arg1 == 0){
return (0);
};
return (-(_local4));
};
var _local6:Number = (_arg1 / _arg2);
if (Math.abs(_local6) < 1){
_local5 = (_local6 / (1 + ((0.28 * _local6) * _local6)));
if (_arg2 < 0){
if (_arg1 < 0){
return ((_local5 - _local3));
};
return ((_local5 + _local3));
};
} else {
_local5 = (_local4 - (_local6 / ((_local6 * _local6) + 0.28)));
if (_arg1 < 0){
return ((_local5 - _local3));
};
};
return (_local5);
}
public static function cos(_arg1:Number):Number{
var _local2:* = 0;
var _local3:* = ((_arg1 > 0)) ? _arg1 : -(_arg1);
var _local4:* = 1.5707963267949;
if (_local3 >= (12.5663706143592 + _local4)){
_local2 = int((_local3 * 0.636619772367581));
if ((_local2 & 1) != 0){
_local2++;
};
_local3 = (_local3 - (_local2 * _local4));
} else {
if (_local3 < _local4){
} else {
if (_local3 < (_local4 + 3.14159265358979)){
_local3 = (_local3 - 3.14159265358979);
_local2 = 2;
} else {
if (_local3 < (6.28318530717959 + _local4)){
_local3 = (_local3 - 6.28318530717959);
} else {
if (_local3 < (9.42477796076938 + _local4)){
_local3 = (_local3 - 9.42477796076938);
_local2 = 2;
} else {
_local3 = (_local3 - 12.5663706143592);
};
};
};
};
};
var _local5:* = (_local3 * _local3);
var _local6:* = (0.999999953027512 + (_local5 * (-0.499999047777921 + (_local5 * (0.041663573160188 + (_local5 * (-0.0013853629536173 + (_local5 * 2.31524166599385E-5))))))));
return ((((_local2 & 2))!=0) ? -(_local6) : _local6);
}
public static function sin(_arg1:Number):Number{
_arg1 = (_arg1 - 1.5707963267949);
var _local2:* = 0;
var _local3:* = ((_arg1 > 0)) ? _arg1 : -(_arg1);
if (_local3 >= (12.5663706143592 + 1.5707963267949)){
_local2 = int((_local3 * 0.636619772367581));
if ((_local2 & 1) != 0){
_local2++;
};
_local3 = (_local3 - (_local2 * 1.5707963267949));
} else {
if (_local3 < 1.5707963267949){
} else {
if (_local3 < (1.5707963267949 + 3.14159265358979)){
_local3 = (_local3 - 3.14159265358979);
_local2 = 2;
} else {
if (_local3 < (6.28318530717959 + 1.5707963267949)){
_local3 = (_local3 - 6.28318530717959);
} else {
if (_local3 < (9.42477796076938 + 1.5707963267949)){
_local3 = (_local3 - 9.42477796076938);
_local2 = 2;
} else {
_local3 = (_local3 - 12.5663706143592);
};
};
};
};
};
var _local4:* = (_local3 * _local3);
var _local5:* = (0.999999953027512 + (_local4 * (-0.499999047777921 + (_local4 * (0.041663573160188 + (_local4 * (-0.0013853629536173 + (_local4 * 2.31524166599385E-5))))))));
return ((((_local2 & 2))!=0) ? -(_local5) : _local5);
}
}
}//package math
Section 36
//ManagedSound (sfx.ManagedSound)
package sfx {
import flash.media.*;
public class ManagedSound {
private var ClassReference:Class;
public var activeSounds:Array;
private var manager:SoundManager;
public function ManagedSound(_arg1:SoundManager, _arg2:Class){
activeSounds = new Array();
super();
this.manager = _arg1;
this.ClassReference = _arg2;
}
public function play(_arg1:Number=1, _arg2:Number=0):ManagedSoundChannel{
if (manager.isMuted){
return (new ManagedSoundChannel(manager, this, null));
};
var _local3:SoundChannel = new ClassReference().play(0, 0, new SoundTransform(_arg1, _arg2));
return (new ManagedSoundChannel(manager, this, _local3));
}
public function loop(_arg1:Number=1, _arg2:Number=0):ManagedSoundChannel{
var _local3:SoundChannel = new ClassReference().play(0, 999999999, new SoundTransform(_arg1, _arg2));
return (new ManagedSoundChannel(manager, this, _local3));
}
public function repeat(_arg1:int, _arg2:Number=1, _arg3:Number=0):ManagedSoundChannel{
var _local4:SoundChannel = new ClassReference().play(0, _arg1, new SoundTransform(_arg2, _arg3));
return (new ManagedSoundChannel(manager, this, _local4));
}
public function stop():void{
var _local1:int;
while (_local1 < activeSounds.length) {
activeSounds[_local1].stop();
_local1++;
};
}
public function setPan(_arg1:Number):void{
var _local2:int;
while (_local2 < activeSounds.length) {
activeSounds[_local2].setPan(_arg1);
_local2++;
};
}
public function setVolume(_arg1:Number):void{
var _local2:int;
while (_local2 < activeSounds.length) {
activeSounds[_local2].setVolume(_arg1);
_local2++;
};
}
public function fadeTo(_arg1:Number, _arg2:int):void{
var _local3:int;
while (_local3 < activeSounds.length) {
activeSounds[_local3].fadeTo(_arg1, _arg2);
_local3++;
};
}
public function fadeToAndStop(_arg1:Number, _arg2:int):void{
var _local3:int;
while (_local3 < activeSounds.length) {
activeSounds[_local3].fadeToAndStop(_arg1, _arg2);
_local3++;
};
}
public function panTo(_arg1:Number, _arg2:int):void{
var _local3:int;
while (_local3 < activeSounds.length) {
activeSounds[_local3].panTo(_arg1, _arg2);
_local3++;
};
}
public function isPlaying():Boolean{
return ((activeSounds.length > 0));
}
public function update():void{
var _local1:int;
while (_local1 < activeSounds.length) {
activeSounds[_local1].update();
_local1++;
};
}
}
}//package sfx
Section 37
//ManagedSoundChannel (sfx.ManagedSoundChannel)
package sfx {
import flash.media.*;
import flash.events.*;
import flash.utils.*;
public class ManagedSoundChannel {
private var sound:ManagedSound;
private var channel:SoundChannel;
private var manager:SoundManager;
private var targetVolume:Number;
private var targetPan:Number;
private var fadeStartTime:int;// = -1
private var fadeEndTime:int;// = -1
private var fadeStartVolume:Number;// = -1
private var fadeEndVolume:Number;// = -1
private var panStartTime:int;// = -1
private var panEndTime:int;// = -1
private var panStartVolume:Number;// = -1
private var panEndVolume:Number;// = -1
private var stopAfterFade:Boolean;// = false
private var playing:Boolean;// = true
public function ManagedSoundChannel(_arg1:SoundManager, _arg2:ManagedSound, _arg3:SoundChannel){
this.manager = _arg1;
this.sound = _arg2;
this.channel = _arg3;
_arg2.activeSounds.push(this);
if (_arg3 == null){
soundComplete(null);
return;
};
_arg3.addEventListener(Event.SOUND_COMPLETE, soundComplete);
targetVolume = _arg3.soundTransform.volume;
targetPan = _arg3.soundTransform.pan;
update();
}
public function soundComplete(_arg1:Event):void{
if (!playing){
return;
};
sound.activeSounds.splice(sound.activeSounds.indexOf(this), 1);
playing = false;
}
public function setPan(_arg1:Number):void{
if (!playing){
return;
};
if (channel == null){
return;
};
channel.soundTransform.pan = _arg1;
panStartTime = -1;
update();
}
public function setVolume(_arg1:Number):void{
if (!playing){
return;
};
stopAfterFade = false;
this.targetVolume = _arg1;
fadeStartTime = -1;
update();
}
public function stop():void{
if (!playing){
return;
};
if (channel == null){
return;
};
channel.stop();
soundComplete(null);
}
public function fadeTo(_arg1:Number, _arg2:Number):void{
if (!playing){
return;
};
fadeStartVolume = Math.sqrt(targetVolume);
fadeEndVolume = Math.sqrt(_arg1);
fadeStartTime = getTimer();
fadeEndTime = (getTimer() + _arg2);
stopAfterFade = false;
}
public function fadeToAndStop(_arg1:Number, _arg2:Number):void{
if (!playing){
return;
};
fadeTo(_arg1, _arg2);
stopAfterFade = true;
}
public function panTo(_arg1:Number, _arg2:Number):void{
if (!playing){
return;
};
panStartVolume = targetPan;
panEndVolume = _arg1;
panStartTime = getTimer();
panEndTime = (getTimer() + _arg2);
}
public function update():void{
var _local1:Number;
if (!playing){
return;
};
if (fadeStartTime >= 0){
_local1 = ((getTimer() - fadeStartTime) / (fadeEndTime - fadeStartTime));
if (_local1 < 0){
_local1 = 0;
};
if (_local1 > 1){
_local1 = 1;
};
targetVolume = (fadeStartVolume + ((fadeEndVolume - fadeStartVolume) * _local1));
targetVolume = (targetVolume * targetVolume);
if (_local1 == 1){
fadeStartTime = -1;
};
if ((((_local1 == 1)) && (stopAfterFade))){
stop();
};
};
if (panStartTime >= 0){
_local1 = ((getTimer() - panStartTime) / (panEndTime - panStartTime));
if (_local1 < 0){
_local1 = 0;
};
if (_local1 > 1){
_local1 = 1;
};
targetPan = (panStartVolume + ((panEndVolume - panStartVolume) * _local1));
if (_local1 == 1){
panStartTime = -1;
};
};
var _local2:Number = (targetVolume * manager.volume);
var _local3:Number = targetPan;
if (channel == null){
return;
};
if (((!((_local2 == channel.soundTransform.volume))) || (!((_local3 == channel.soundTransform.pan))))){
channel.soundTransform = new SoundTransform(_local2, _local3);
};
}
public function isPlaying():Boolean{
return (playing);
}
}
}//package sfx
Section 38
//SoundManager (sfx.SoundManager)
package sfx {
import flash.utils.*;
public class SoundManager {
public var volume:Number;// = 1
public var isMuted:Boolean;// = false
private var managedSoundMap:Object;
private var managedSounds:Array;
private var lastTime:int;// = -1
private var fadeStartTime:int;// = -1
private var fadeEndTime:int;// = -1
private var fadeStartVolume:Number;// = -1
private var fadeEndVolume:Number;// = -1
public function SoundManager(){
managedSoundMap = new Object();
managedSounds = new Array();
super();
}
public function get(_arg1:String):ManagedSound{
var _local2:Class;
if (managedSoundMap[_arg1] == null){
_local2 = (getDefinitionByName(("sound." + _arg1)) as Class);
if (_local2 == null){
throw (new Error((("Failed to find sound [sound." + _arg1) + "]")));
};
managedSoundMap[_arg1] = new ManagedSound(this, _local2);
managedSounds.push(managedSoundMap[_arg1]);
};
return (managedSoundMap[_arg1]);
}
public function fadeTo(_arg1:Number, _arg2:int):void{
fadeStartVolume = Math.sqrt(volume);
fadeEndVolume = Math.sqrt(_arg1);
fadeStartTime = getTimer();
fadeEndTime = (getTimer() + _arg2);
}
public function setVolume(_arg1:Number):void{
isMuted = (_arg1 == 0);
this.volume = _arg1;
fadeStartTime = -1;
}
public function stopAll():void{
var _local1:int;
while (_local1 < managedSounds.length) {
managedSounds[_local1].stop();
_local1++;
};
}
public function update():void{
var _local3:Number;
var _local1:int = getTimer();
if (lastTime < 0){
lastTime = _local1;
};
if (fadeStartTime >= 0){
_local3 = ((_local1 - fadeStartTime) / (fadeEndTime - fadeStartTime));
if (_local3 < 0){
_local3 = 0;
};
if (_local3 > 1){
_local3 = 1;
};
volume = (fadeStartVolume + ((fadeEndVolume - fadeStartVolume) * _local3));
volume = (volume * volume);
if (_local3 == 1){
fadeStartTime = -1;
};
};
var _local2:int;
while (_local2 < managedSounds.length) {
managedSounds[_local2].update();
_local2++;
};
}
}
}//package sfx
Section 39
//2 (sound.score_pop1.2)
package sound.score_pop1 {
import flash.media.*;
public dynamic class 2 extends Sound {
}
}//package sound.score_pop1
Section 40
//2 (sound.score_pop2.2)
package sound.score_pop2 {
import flash.media.*;
public dynamic class 2 extends Sound {
}
}//package sound.score_pop2
Section 41
//2 (sound.score_pop3.2)
package sound.score_pop3 {
import flash.media.*;
public dynamic class 2 extends Sound {
}
}//package sound.score_pop3
Section 42
//2 (sound.score_pop4.2)
package sound.score_pop4 {
import flash.media.*;
public dynamic class 2 extends Sound {
}
}//package sound.score_pop4
Section 43
//ball_shot1 (sound.ball_shot1)
package sound {
import flash.media.*;
public dynamic class ball_shot1 extends Sound {
}
}//package sound
Section 44
//ball_sticks2 (sound.ball_sticks2)
package sound {
import flash.media.*;
public dynamic class ball_sticks2 extends Sound {
}
}//package sound
Section 45
//balls_dropped21 (sound.balls_dropped21)
package sound {
import flash.media.*;
public dynamic class balls_dropped21 extends Sound {
}
}//package sound
Section 46
//double_multiplier_collected (sound.double_multiplier_collected)
package sound {
import flash.media.*;
public dynamic class double_multiplier_collected extends Sound {
}
}//package sound
Section 47
//end1 (sound.end1)
package sound {
import flash.media.*;
public dynamic class end1 extends Sound {
}
}//package sound
Section 48
//end2 (sound.end2)
package sound {
import flash.media.*;
public dynamic class end2 extends Sound {
}
}//package sound
Section 49
//game_start (sound.game_start)
package sound {
import flash.media.*;
public dynamic class game_start extends Sound {
}
}//package sound
Section 50
//intro1 (sound.intro1)
package sound {
import flash.media.*;
public dynamic class intro1 extends Sound {
}
}//package sound
Section 51
//intro2 (sound.intro2)
package sound {
import flash.media.*;
public dynamic class intro2 extends Sound {
}
}//package sound
Section 52
//line_blast3 (sound.line_blast3)
package sound {
import flash.media.*;
public dynamic class line_blast3 extends Sound {
}
}//package sound
Section 53
//loop1 (sound.loop1)
package sound {
import flash.media.*;
public dynamic class loop1 extends Sound {
}
}//package sound
Section 54
//multiplier_collected1 (sound.multiplier_collected1)
package sound {
import flash.media.*;
public dynamic class multiplier_collected1 extends Sound {
}
}//package sound
Section 55
//time_warning1 (sound.time_warning1)
package sound {
import flash.media.*;
public dynamic class time_warning1 extends Sound {
}
}//package sound
Section 56
//unlocked_trophy (sound.unlocked_trophy)
package sound {
import flash.media.*;
public dynamic class unlocked_trophy extends Sound {
}
}//package sound
Section 57
//IFloat (timing.IFloat)
package timing {
public class IFloat {
public var ivalue:Number;
private var lastValue:Number;
private static var alpha:Number;
public function IFloat(_arg1:Number){
ivalue = _arg1;
lastValue = _arg1;
alpha = 0;
}
public function copyFrom(_arg1:IFloat):void{
ivalue = _arg1.ivalue;
lastValue = _arg1.lastValue;
}
public function setTo(_arg1:Number){
ivalue = _arg1;
lastValue = _arg1;
}
public function set(_arg1:Number){
lastValue = ivalue;
ivalue = _arg1;
}
public function get(_arg1:Number){
return ((lastValue + ((ivalue - lastValue) * _arg1)));
}
public function get value():Number{
return ((lastValue + ((ivalue - lastValue) * alpha)));
}
public function set value(_arg1:Number):void{
ivalue = _arg1;
lastValue = _arg1;
}
public static function setAlpha(_arg1:Number):void{
alpha = _arg1;
}
}
}//package timing
Section 58
//Performance (timing.Performance)
package timing {
import flash.utils.*;
public class Performance {
private var fpsCount:Number;
private var totalFps:Number;
private var lastFpsCount:Number;
private var nextFpsUpdate:Number;
private var startAt:Number;
private var period:Number;
private var periodFps:Number;
private var idealFps:Number;
private var listeners:Array;
private var updates:Number;
private var minPeriodFps:Number;
private var measurePeriod:Number;
public function Performance(_arg1:Number){
this.idealFps = _arg1;
this.measurePeriod = 5;
this.minPeriodFps = ((_arg1 / 2) * measurePeriod);
this.listeners = [];
begin();
}
public function begin():void{
startAt = -1;
period = -1;
nextFpsUpdate = getTimer();
totalFps = 0;
fpsCount = 0;
lastFpsCount = -1;
periodFps = 0;
updates = 0;
}
public function frameUpdated():void{
var _local2:*;
fpsCount++;
var _local1:* = getTimer();
if (startAt < 0){
startAt = _local1;
};
if (_local1 > nextFpsUpdate){
if (updates > 0){
lastFpsCount = fpsCount;
totalFps = (totalFps + fpsCount);
};
periodFps = (periodFps + fpsCount);
if (++period == measurePeriod){
if (periodFps < minPeriodFps){
for (_local2 in listeners) {
var _local5 = listeners;
_local5[_local2]((periodFps / measurePeriod));
};
};
period = 0;
periodFps = 0;
};
nextFpsUpdate = (_local1 + 1000);
fpsCount = 0;
updates++;
};
}
public function addQualityFeedbackListener(_arg1:Function):void{
listeners.push(_arg1);
}
public function setFpsThreshold(_arg1:Number, _arg2:Number):void{
this.minPeriodFps = (_arg1 * _arg2);
this.measurePeriod = _arg2;
}
public function get fps():int{
return (lastFpsCount);
}
public function get averageFps():Number{
return ((totalFps / ((getTimer() - startAt) / 1000)));
}
}
}//package timing
Section 59
//Timeable (timing.Timeable)
package timing {
public interface Timeable {
function tick(_arg1:int):void;
function render(_arg1:int, _arg2:Number):void;
}
}//package timing
Section 60
//Timer (timing.Timer)
package timing {
import flash.utils.*;
public class Timer {
private var time:Number;// = 0
private var startTime:Number;// = -1
private var lastTime:Number;// = 0
private var unprocessedTime:Number;// = 0
private var tick:Number;// = 0
private var millisPerGameTick:Number;// = 0
private var maxTickTime:Number;// = -1
private var timeable:Timeable;
public function Timer(_arg1:Timeable, _arg2:Number){
millisPerGameTick = (1000 / _arg2);
this.timeable = _arg1;
this.maxTickTime = 500;
}
public function getMillisPerTick():Number{
return (millisPerGameTick);
}
public function setMaxTickTime(_arg1:Number):void{
maxTickTime = _arg1;
}
public function flush(){
unprocessedTime = 0;
lastTime = getTimer();
}
public function advanceTime2():void{
var _local4:*;
var _local1:* = getTimer();
if (startTime < 0){
startTime = _local1;
unprocessedTime = millisPerGameTick;
};
time = (_local1 - startTime);
var _local2:* = (time - lastTime);
lastTime = time;
unprocessedTime = (unprocessedTime + _local2);
if (unprocessedTime >= millisPerGameTick){
_local4 = (maxTickTime + _local1);
do {
timeable.tick(tick);
tick++;
unprocessedTime = (unprocessedTime - millisPerGameTick);
} while ((((unprocessedTime >= millisPerGameTick)) && ((getTimer() < _local4))));
};
var _local3:Number = ((unprocessedTime % millisPerGameTick) / millisPerGameTick);
IFloat.setAlpha(_local3);
timeable.render(tick, _local3);
}
public function advanceTime(){
time = getTimer();
var _local1:* = (time - lastTime);
lastTime = time;
unprocessedTime = (unprocessedTime + _local1);
var _local2:Number = 0;
while (unprocessedTime > millisPerGameTick) {
unprocessedTime = (unprocessedTime - millisPerGameTick);
timeable.tick(tick);
tick++;
_local2++;
if (_local2 >= 10){
unprocessedTime = 0;
};
};
var _local3:Number = (unprocessedTime / millisPerGameTick);
IFloat.setAlpha(_local3);
timeable.render(tick, _local3);
}
}
}//package timing
Section 61
//Numbers (util.Numbers)
package util {
public class Numbers {
public static function dec2hex(_arg1:Number, _arg2:Boolean):String{
var _local3:* = "";
while (_arg1 != 0) {
_local3 = ("0123456789abcdef".charAt((_arg1 & 15)) + _local3);
_arg1 = (_arg1 >>> 4);
};
if (_arg2){
if (_local3.length == 0){
_local3 = "00";
};
if (_local3.length < 2){
_local3 = ("0" + _local3);
};
} else {
if (_local3.length == 0){
_local3 = "0";
};
};
return (_local3);
}
public static function itoa(_arg1:Number, _arg2:Number):String{
var _local4:*;
var _local3:String = ("" + _arg1);
if (_arg2){
_local4 = (_arg2 - 1);
while (_local4 > 0) {
if (_arg1 < Math.pow(10, _local4)){
_local3 = ("0" + _local3);
};
_local4--;
};
};
return (_local3);
}
public static function asTime(_arg1:Number, _arg2:Boolean, _arg3:Boolean){
if (_arg2){
_arg3 = true;
};
if (_arg1 < 0){
_arg1 = 0;
};
_arg1 = (_arg1 / 1000);
_arg1 = Math.floor(_arg1);
var _local4:Number = Math.floor((_arg1 / 3600));
var _local5:Number = (Math.floor((_arg1 / 60)) % 60);
var _local6:Number = (_arg1 % 60);
var _local7 = "";
if (((_arg2) || ((_local4 > 0)))){
_local7 = (_local7 + itoa(_local4, 2));
};
if (((_arg2) || ((_local7.length > 0)))){
_local7 = (_local7 + ":");
};
var _local8:Number = _local7.length;
if (((((_arg3) || ((_local5 > 0)))) || ((_local4 > 0)))){
_local7 = (_local7 + itoa(_local5, 2));
};
if (((_arg3) || (!((_local7.length == _local8))))){
_local7 = (_local7 + ":");
};
return ((_local7 + itoa(_local6, 2)));
}
}
}//package util
Section 62
//Stats (util.Stats)
package util {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
public class Stats extends Sprite {
private var graph:BitmapData;
private var ver:Sprite;
private var fpsText:TextField;
private var msText:TextField;
private var memText:TextField;
private var verText:TextField;
private var format:TextFormat;
private var fps:int;
private var timer:int;
private var ms:int;
private var msPrev:int;// = 0
private var mem:Number;// = 0
private var rectangle:Rectangle;
public function Stats():void{
addEventListener(Event.ADDED_TO_STAGE, init);
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
addEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage);
}
private function init(_arg1:Event):void{
x = 5;
y = 5;
removeEventListener(Event.ADDED_TO_STAGE, init);
graphics.beginFill(51, 0.5);
graphics.drawRect(0, 0, 72, 40);
graphics.endFill();
ver = new Sprite();
ver.graphics.beginFill(51, 0.5);
ver.graphics.drawRect(0, 0, 72, 30);
ver.graphics.endFill();
ver.y = 90;
ver.visible = false;
addChild(ver);
verText = new TextField();
fpsText = new TextField();
msText = new TextField();
memText = new TextField();
format = new TextFormat("_sans", 9);
verText.defaultTextFormat = (fpsText.defaultTextFormat = (msText.defaultTextFormat = (memText.defaultTextFormat = format)));
verText.width = (fpsText.width = (msText.width = (memText.width = 72)));
verText.selectable = (fpsText.selectable = (msText.selectable = (memText.selectable = false)));
verText.textColor = 0xFFFFFF;
verText.text = ((Capabilities.version.split(" ")[0] + "\n") + Capabilities.version.split(" ")[1]);
ver.addChild(verText);
fpsText.textColor = 0xFFFF00;
fpsText.text = "FPS: ";
addChild(fpsText);
msText.y = 10;
msText.textColor = 0xFF00;
msText.text = "MS: ";
addChild(msText);
memText.y = 20;
memText.textColor = 0xFFFF;
memText.text = "MEM: ";
addChild(memText);
graph = new BitmapData(72, 50, true, 2147483699);
var _local2:Bitmap = new Bitmap(graph);
_local2.y = 40;
addChild(_local2);
rectangle = new Rectangle(0, 0, 1, graph.height);
}
private function onAddedToStage(_arg1:Event):void{
addEventListener(MouseEvent.CLICK, onClick);
addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
addEventListener(Event.ENTER_FRAME, update);
}
private function onRemovedFromStage(_arg1:Event):void{
removeEventListener(MouseEvent.CLICK, onClick);
removeEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
removeEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
removeEventListener(Event.ENTER_FRAME, update);
}
private function update(_arg1:Event):void{
var _local2:int;
var _local3:Number;
timer = getTimer();
fps++;
if ((timer - 1000) > msPrev){
msPrev = timer;
mem = Number((System.totalMemory * 9.54E-7).toFixed(3));
_local2 = Math.min(50, ((50 / stage.frameRate) * fps));
_local3 = (Math.min(50, Math.sqrt(Math.sqrt((mem * 5000)))) - 2);
graph.scroll(1, 0);
graph.fillRect(rectangle, 2147483699);
graph.setPixel32(0, (graph.height - _local2), 0xFFFF00);
graph.setPixel32(0, (graph.height - ((timer - ms) >> 1)), 0xFF00);
graph.setPixel32(0, (graph.height - _local3), 0xFFFF);
fpsText.text = ((("FPS: " + fps) + " / ") + stage.frameRate);
memText.text = ("MEM: " + mem);
fps = 0;
};
msText.text = ("MS: " + (timer - ms));
ms = timer;
}
private function onClick(_arg1:MouseEvent):void{
if (mouseY > (height * 0.35)){
stage.frameRate--;
} else {
stage.frameRate++;
};
fpsText.text = ((("FPS: " + fps) + " / ") + stage.frameRate);
}
private function onMouseOver(_arg1:MouseEvent):void{
ver.visible = true;
}
private function onMouseOut(_arg1:MouseEvent):void{
ver.visible = false;
}
}
}//package util
Section 63
//Assembly (Assembly)
package {
import game.*;
import flash.display.*;
import flash.text.*;
public dynamic class Assembly extends MovieClip {
public var bonus_val_txt:TextField;
public var time_txt:TextField;
public var aim_over:AimCursor;
public var big_leaf:Leaf;
public var bonus_txt:TextField;
public var bubbleBoxFxParent:MovieClip;
public var bubbleBoxParent:MovieClip;
public var animal:MovieClip;
public var bubble_base:MovieClip;
public var bubble_launcher:bubbleshooter;
public var time_up:TimeUp;
public var points_txt:TextField;
public var points_val_txt:TextField;
public var time_val_txt:TextField;
public function Assembly(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 64
//bubbleshooter (bubbleshooter)
package {
import game.*;
public dynamic class bubbleshooter extends BubbleLauncher {
}
}//package
Section 65
//ErrorSymbol (ErrorSymbol)
package {
import flash.display.*;
public dynamic class ErrorSymbol extends MovieClip {
}
}//package
Section 66
//GameControl (GameControl)
package {
import flash.display.*;
public dynamic class GameControl extends MovieClip {
public var sfx_btn:MovieClip;
public var exit_btn:MovieClip;
public var music_btn:MovieClip;
public var sfx_hit:MovieClip;
public var music_hit:MovieClip;
public var exit_hit:MovieClip;
}
}//package
Section 67
//instruction_anim (instruction_anim)
package {
import anim.*;
public dynamic class instruction_anim extends PausedLoopingFlare30Fps {
}
}//package
Section 68
//instruction_anim_speed (instruction_anim_speed)
package {
import anim.*;
public dynamic class instruction_anim_speed extends PausedLoopingFlare30Fps {
}
}//package
Section 69
//LineBlastProjectile (LineBlastProjectile)
package {
import flash.display.*;
public dynamic class LineBlastProjectile extends MovieClip {
}
}//package
Section 70
//LineExplosionMarker (LineExplosionMarker)
package {
import anim.*;
public dynamic class LineExplosionMarker extends PausedLoopingFlare25Fps {
}
}//package
Section 71
//MultiplyMarker (MultiplyMarker)
package {
import anim.*;
public dynamic class MultiplyMarker extends PausedLoopingFlare25Fps {
}
}//package
Section 72
//newrecord_anim (newrecord_anim)
package {
import anim.*;
public dynamic class newrecord_anim extends PausedLoopingFlare25Fps {
}
}//package
Section 73
//PopX (PopX)
package {
import anim.*;
public dynamic class PopX extends PausedSingleFlareDestroy25Fps {
}
}//package
Section 74
//trophy_2_anim (trophy_2_anim)
package {
import anim.*;
public dynamic class trophy_2_anim extends PausedLoopingFlare25Fps {
}
}//package
Section 75
//trophy_3_anim (trophy_3_anim)
package {
import anim.*;
public dynamic class trophy_3_anim extends PausedLoopingFlare25Fps {
}
}//package
Section 76
//trophy_anim (trophy_anim)
package {
import anim.*;
public dynamic class trophy_anim extends PausedLoopingFlare25Fps {
}
}//package