Section 1
//BackGround_1 (amazon_survival_fla.BackGround_1)
package amazon_survival_fla {
import flash.display.*;
public dynamic class BackGround_1 extends MovieClip {
public function BackGround_1(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 2
//BetweenRounds_41 (amazon_survival_fla.BetweenRounds_41)
package amazon_survival_fla {
import flash.display.*;
public dynamic class BetweenRounds_41 extends MovieClip {
public var mcInfoText:MovieClip;
public function BetweenRounds_41(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 3
//Bomb_51 (amazon_survival_fla.Bomb_51)
package amazon_survival_fla {
import flash.display.*;
public dynamic class Bomb_51 extends MovieClip {
public function Bomb_51(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 4
//ButtonMusic_38 (amazon_survival_fla.ButtonMusic_38)
package amazon_survival_fla {
import flash.display.*;
public dynamic class ButtonMusic_38 extends MovieClip {
public function ButtonMusic_38(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 5
//ButtonSFX_39 (amazon_survival_fla.ButtonSFX_39)
package amazon_survival_fla {
import flash.display.*;
public dynamic class ButtonSFX_39 extends MovieClip {
public function ButtonSFX_39(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 6
//Checkbox_45 (amazon_survival_fla.Checkbox_45)
package amazon_survival_fla {
import flash.display.*;
public dynamic class Checkbox_45 extends MovieClip {
public function Checkbox_45(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 7
//ExplosionBlue_82 (amazon_survival_fla.ExplosionBlue_82)
package amazon_survival_fla {
import flash.display.*;
public dynamic class ExplosionBlue_82 extends MovieClip {
public function ExplosionBlue_82(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 8
//ExplosionGreen_84 (amazon_survival_fla.ExplosionGreen_84)
package amazon_survival_fla {
import flash.display.*;
public dynamic class ExplosionGreen_84 extends MovieClip {
public function ExplosionGreen_84(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 9
//ExplosionLineBlast_80 (amazon_survival_fla.ExplosionLineBlast_80)
package amazon_survival_fla {
import flash.display.*;
public dynamic class ExplosionLineBlast_80 extends MovieClip {
public function ExplosionLineBlast_80(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 10
//ExplosionRed_81 (amazon_survival_fla.ExplosionRed_81)
package amazon_survival_fla {
import flash.display.*;
public dynamic class ExplosionRed_81 extends MovieClip {
public function ExplosionRed_81(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 11
//ExplosionYellow_83 (amazon_survival_fla.ExplosionYellow_83)
package amazon_survival_fla {
import flash.display.*;
public dynamic class ExplosionYellow_83 extends MovieClip {
public function ExplosionYellow_83(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 12
//ForeGround_2 (amazon_survival_fla.ForeGround_2)
package amazon_survival_fla {
import flash.display.*;
public dynamic class ForeGround_2 extends MovieClip {
public function ForeGround_2(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 13
//IntroScreen_13 (amazon_survival_fla.IntroScreen_13)
package amazon_survival_fla {
import flash.display.*;
public dynamic class IntroScreen_13 extends MovieClip {
public var mcIntroText2:MovieClip;
public var mcIntroText1:MovieClip;
public var mcLogo:MovieClip;
public function IntroScreen_13(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 14
//LeftHand_94 (amazon_survival_fla.LeftHand_94)
package amazon_survival_fla {
import flash.display.*;
public dynamic class LeftHand_94 extends MovieClip {
public function LeftHand_94(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 15
//LineBlast_52 (amazon_survival_fla.LineBlast_52)
package amazon_survival_fla {
import flash.display.*;
public dynamic class LineBlast_52 extends MovieClip {
public function LineBlast_52(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 16
//PieceBlock_56 (amazon_survival_fla.PieceBlock_56)
package amazon_survival_fla {
import flash.display.*;
public dynamic class PieceBlock_56 extends MovieClip {
public function PieceBlock_56(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 17
//PieceBone_67 (amazon_survival_fla.PieceBone_67)
package amazon_survival_fla {
import flash.display.*;
public dynamic class PieceBone_67 extends MovieClip {
public var mcBall:MovieClip;
public var mcLineBlast:MovieClip;
public var mcBomb:MovieClip;
public function PieceBone_67(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 18
//PieceBoneBlock_72 (amazon_survival_fla.PieceBoneBlock_72)
package amazon_survival_fla {
import flash.display.*;
public dynamic class PieceBoneBlock_72 extends MovieClip {
public function PieceBoneBlock_72(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 19
//PieceBoneBomb_60 (amazon_survival_fla.PieceBoneBomb_60)
package amazon_survival_fla {
import flash.display.*;
public dynamic class PieceBoneBomb_60 extends MovieClip {
public function PieceBoneBomb_60(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 20
//PieceBoneCroc_68 (amazon_survival_fla.PieceBoneCroc_68)
package amazon_survival_fla {
import flash.display.*;
public dynamic class PieceBoneCroc_68 extends MovieClip {
public function PieceBoneCroc_68(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 21
//PieceBoneLineBlast_61 (amazon_survival_fla.PieceBoneLineBlast_61)
package amazon_survival_fla {
import flash.display.*;
public dynamic class PieceBoneLineBlast_61 extends MovieClip {
public function PieceBoneLineBlast_61(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 22
//PieceBonePanther_69 (amazon_survival_fla.PieceBonePanther_69)
package amazon_survival_fla {
import flash.display.*;
public dynamic class PieceBonePanther_69 extends MovieClip {
public function PieceBonePanther_69(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 23
//PieceBoneSnake_70 (amazon_survival_fla.PieceBoneSnake_70)
package amazon_survival_fla {
import flash.display.*;
public dynamic class PieceBoneSnake_70 extends MovieClip {
public function PieceBoneSnake_70(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 24
//PieceBoneSpider_71 (amazon_survival_fla.PieceBoneSpider_71)
package amazon_survival_fla {
import flash.display.*;
public dynamic class PieceBoneSpider_71 extends MovieClip {
public function PieceBoneSpider_71(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 25
//PieceCoin_57 (amazon_survival_fla.PieceCoin_57)
package amazon_survival_fla {
import flash.display.*;
public dynamic class PieceCoin_57 extends MovieClip {
public function PieceCoin_57(){
addFrameScript(0, frame1);
}
function frame1(){
}
}
}//package amazon_survival_fla
Section 26
//PieceCrab_66 (amazon_survival_fla.PieceCrab_66)
package amazon_survival_fla {
import flash.display.*;
public dynamic class PieceCrab_66 extends MovieClip {
public function PieceCrab_66(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 27
//PieceRock_58 (amazon_survival_fla.PieceRock_58)
package amazon_survival_fla {
import flash.display.*;
public dynamic class PieceRock_58 extends MovieClip {
public var mcBall:MovieClip;
public var mcLineBlast:MovieClip;
public var mcBomb:MovieClip;
public function PieceRock_58(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 28
//PieceRockBlock_65 (amazon_survival_fla.PieceRockBlock_65)
package amazon_survival_fla {
import flash.display.*;
public dynamic class PieceRockBlock_65 extends MovieClip {
public function PieceRockBlock_65(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 29
//PieceRockCroc_59 (amazon_survival_fla.PieceRockCroc_59)
package amazon_survival_fla {
import flash.display.*;
public dynamic class PieceRockCroc_59 extends MovieClip {
public function PieceRockCroc_59(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 30
//PieceRockPanther_62 (amazon_survival_fla.PieceRockPanther_62)
package amazon_survival_fla {
import flash.display.*;
public dynamic class PieceRockPanther_62 extends MovieClip {
public function PieceRockPanther_62(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 31
//PieceRockSnake_63 (amazon_survival_fla.PieceRockSnake_63)
package amazon_survival_fla {
import flash.display.*;
public dynamic class PieceRockSnake_63 extends MovieClip {
public function PieceRockSnake_63(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 32
//PieceRockSpider_64 (amazon_survival_fla.PieceRockSpider_64)
package amazon_survival_fla {
import flash.display.*;
public dynamic class PieceRockSpider_64 extends MovieClip {
public function PieceRockSpider_64(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 33
//PieceSeaHorse_73 (amazon_survival_fla.PieceSeaHorse_73)
package amazon_survival_fla {
import flash.display.*;
public dynamic class PieceSeaHorse_73 extends MovieClip {
public function PieceSeaHorse_73(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 34
//PieceWood_49 (amazon_survival_fla.PieceWood_49)
package amazon_survival_fla {
import flash.display.*;
public dynamic class PieceWood_49 extends MovieClip {
public var mcBall:MovieClip;
public var mcLineBlast:MovieClip;
public var mcBomb:MovieClip;
public function PieceWood_49(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 35
//PieceWoodCroc_50 (amazon_survival_fla.PieceWoodCroc_50)
package amazon_survival_fla {
import flash.display.*;
public dynamic class PieceWoodCroc_50 extends MovieClip {
public function PieceWoodCroc_50(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 36
//PieceWoodPanther_53 (amazon_survival_fla.PieceWoodPanther_53)
package amazon_survival_fla {
import flash.display.*;
public dynamic class PieceWoodPanther_53 extends MovieClip {
public function PieceWoodPanther_53(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 37
//PieceWoodSnake_54 (amazon_survival_fla.PieceWoodSnake_54)
package amazon_survival_fla {
import flash.display.*;
public dynamic class PieceWoodSnake_54 extends MovieClip {
public function PieceWoodSnake_54(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 38
//PieceWoodSpider_55 (amazon_survival_fla.PieceWoodSpider_55)
package amazon_survival_fla {
import flash.display.*;
public dynamic class PieceWoodSpider_55 extends MovieClip {
public function PieceWoodSpider_55(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 39
//RegularExplosion_79 (amazon_survival_fla.RegularExplosion_79)
package amazon_survival_fla {
import flash.display.*;
public dynamic class RegularExplosion_79 extends MovieClip {
public function RegularExplosion_79(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 40
//RightHand_95 (amazon_survival_fla.RightHand_95)
package amazon_survival_fla {
import flash.display.*;
public dynamic class RightHand_95 extends MovieClip {
public function RightHand_95(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 41
//ScorePopBG_100 (amazon_survival_fla.ScorePopBG_100)
package amazon_survival_fla {
import flash.display.*;
public dynamic class ScorePopBG_100 extends MovieClip {
public function ScorePopBG_100(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 42
//Symbol14_16 (amazon_survival_fla.Symbol14_16)
package amazon_survival_fla {
import flash.display.*;
public dynamic class Symbol14_16 extends MovieClip {
public function Symbol14_16(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 43
//TimeNumbers_6 (amazon_survival_fla.TimeNumbers_6)
package amazon_survival_fla {
import flash.display.*;
public dynamic class TimeNumbers_6 extends MovieClip {
public function TimeNumbers_6(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 44
//TopFG_11 (amazon_survival_fla.TopFG_11)
package amazon_survival_fla {
import flash.display.*;
public dynamic class TopFG_11 extends MovieClip {
public function TopFG_11(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package amazon_survival_fla
Section 45
//Trophy1_107 (amazon_survival_fla.Trophy1_107)
package amazon_survival_fla {
import flash.display.*;
public dynamic class Trophy1_107 extends MovieClip {
public function Trophy1_107(){
addFrameScript(0, frame1, 51, frame52);
}
function frame1(){
stop();
}
function frame52(){
gotoAndPlay(2);
}
}
}//package amazon_survival_fla
Section 46
//Trophy2_108 (amazon_survival_fla.Trophy2_108)
package amazon_survival_fla {
import flash.display.*;
public dynamic class Trophy2_108 extends MovieClip {
public function Trophy2_108(){
addFrameScript(0, frame1, 50, frame51);
}
function frame1(){
stop();
}
function frame51(){
gotoAndPlay(2);
}
}
}//package amazon_survival_fla
Section 47
//Trophy3_109 (amazon_survival_fla.Trophy3_109)
package amazon_survival_fla {
import flash.display.*;
public dynamic class Trophy3_109 extends MovieClip {
public function Trophy3_109(){
addFrameScript(0, frame1, 50, frame51);
}
function frame1(){
stop();
}
function frame51(){
gotoAndPlay(2);
}
}
}//package amazon_survival_fla
Section 48
//blackBall (sound.blackBall)
package sound {
import flash.media.*;
public dynamic class blackBall extends Sound {
}
}//package sound
Section 49
//bonusScore (sound.bonusScore)
package sound {
import flash.media.*;
public dynamic class bonusScore extends Sound {
}
}//package sound
Section 50
//colorBomb (sound.colorBomb)
package sound {
import flash.media.*;
public dynamic class colorBomb extends Sound {
}
}//package sound
Section 51
//combo (sound.combo)
package sound {
import flash.media.*;
public dynamic class combo extends Sound {
}
}//package sound
Section 52
//combo1 (sound.combo1)
package sound {
import flash.media.*;
public dynamic class combo1 extends Sound {
}
}//package sound
Section 53
//combo2 (sound.combo2)
package sound {
import flash.media.*;
public dynamic class combo2 extends Sound {
}
}//package sound
Section 54
//combo3 (sound.combo3)
package sound {
import flash.media.*;
public dynamic class combo3 extends Sound {
}
}//package sound
Section 55
//combo4 (sound.combo4)
package sound {
import flash.media.*;
public dynamic class combo4 extends Sound {
}
}//package sound
Section 56
//combo5 (sound.combo5)
package sound {
import flash.media.*;
public dynamic class combo5 extends Sound {
}
}//package sound
Section 57
//intro (sound.intro)
package sound {
import flash.media.*;
public dynamic class intro extends Sound {
}
}//package sound
Section 58
//knock (sound.knock)
package sound {
import flash.media.*;
public dynamic class knock extends Sound {
}
}//package sound
Section 59
//levelCompleted (sound.levelCompleted)
package sound {
import flash.media.*;
public dynamic class levelCompleted extends Sound {
}
}//package sound
Section 60
//levelStart (sound.levelStart)
package sound {
import flash.media.*;
public dynamic class levelStart extends Sound {
}
}//package sound
Section 61
//lineBlast (sound.lineBlast)
package sound {
import flash.media.*;
public dynamic class lineBlast extends Sound {
}
}//package sound
Section 62
//loop (sound.loop)
package sound {
import flash.media.*;
public dynamic class loop extends Sound {
}
}//package sound
Section 63
//outro (sound.outro)
package sound {
import flash.media.*;
public dynamic class outro extends Sound {
}
}//package sound
Section 64
//splash (sound.splash)
package sound {
import flash.media.*;
public dynamic class splash extends Sound {
}
}//package sound
Section 65
//switch (sound.switch)
package sound {
import flash.media.*;
public dynamic class switch extends Sound {
}
}//package sound
Section 66
//warning (sound.warning)
package sound {
import flash.media.*;
public dynamic class warning extends Sound {
}
}//package sound
Section 67
//Communicator (src.comm.Communicator)
package src.comm {
import flash.system.*;
public class Communicator {
private var hasSentGameStart;// = false
private var hasSentGameEnd;// = false
private var hasSentGameOver;// = false
private var hasSentLastTick;// = false
private static var CMD_START_ROUND = 101;
private static var CMD_SHOOT_BALL = 102;
private static var CMD_SWITCH_BALLS = 103;
private static var CMD_COMPARE_SCORE = 104;
private static var CMD_SEND_RANDOMS = 105;
private static var CMD_SEND_SOUND = 106;
private static var CMD_LAST_TICK = 107;
private static var CMD_END_PRESSED = 108;
public function gameStarted(){
trace("GAME START");
if (!hasSentGameStart){
hasSentGameStart = true;
fscommand("gameStart");
};
}
public function signup(){
fscommand("gameSignup", "");
}
public function gameQuit(){
trace("GAME QUIT");
if (!hasSentGameOver){
hasSentGameOver = true;
fscommand("gameQuit");
};
}
public function gameEnd(_arg1){
trace("GAME ENDS");
if (!hasSentGameEnd){
hasSentGameEnd = true;
fscommand("gameEnd", _arg1);
};
}
public function startRound(_arg1){
fscommand("playData", ((CMD_START_ROUND + ",") + _arg1));
}
public function shootBall(_arg1, _arg2){
fscommand("playData", ((((CMD_SHOOT_BALL + ",") + _arg1) + " ") + _arg2));
}
public function switchBalls(_arg1){
fscommand("playData", ((CMD_SWITCH_BALLS + ",") + _arg1));
}
public function sendScore(_arg1, _arg2, _arg3, _arg4){
fscommand("playData", ((((((((CMD_COMPARE_SCORE + ",") + _arg1) + " ") + _arg2) + " ") + _arg3) + " ") + _arg4));
}
public function sendRandoms(_arg1, _arg2, _arg3){
fscommand("playData", ((((((CMD_SEND_RANDOMS + ",") + _arg1) + " ") + _arg2) + " ") + _arg3));
}
public function soundStates(_arg1, _arg2){
fscommand("playData", ((((CMD_SEND_SOUND + ",") + _arg1) + " ") + _arg2));
}
public function lastTick(_arg1, _arg2, _arg3){
fscommand("playData", ((((((CMD_LAST_TICK + ",") + _arg1) + " ") + _arg2) + " ") + _arg3));
}
public function endPressed(_arg1, _arg2, _arg3){
fscommand("playData", ((((((CMD_END_PRESSED + ",") + _arg1) + " ") + _arg2) + " ") + _arg3));
}
}
}//package src.comm
Section 68
//GameDataParser (src.comm.GameDataParser)
package src.comm {
import flash.xml.*;
public class GameDataParser {
public static var textMappings:Object;
public static var records:Object;
public static var sounds:Object;
public static function parseGameData(_arg1:String):Object{
var _local2:Object = new Object();
var _local3:XMLDocument = new XMLDocument(_arg1);
textMappings = new Object();
_local2.textMappings = textMappings;
var _local4:* = _local3.firstChild.childNodes;
records = new Object();
_local2.records = records;
sounds = new Object();
_local2.sounds = sounds;
var _local5 = (_local3.firstChild.attributes.relaxMode == "true");
var _local6:int = parseInt(_local3.firstChild.attributes.randomseed);
var _local7:* = _local3.firstChild.attributes.lang;
var _local8:* = _local3.firstChild.attributes.partner;
_local2.randomSeed = _local6;
_local2.relaxMode = _local5;
_local2.partnerId = _local8;
_local2.country = _local7;
var _local9:* = 0;
while (_local9 < _local4.length) {
if (_local4[_local9].nodeName == "id"){
};
if (_local4[_local9].nodeName == "game"){
_local2.gameType = new String(_local4[_local9].attributes.type);
};
if (_local4[_local9].nodeName == "userType"){
_local2.userType = new String(_local4[_local9].firstChild.nodeValue);
};
if (_local4[_local9].nodeName == "text"){
if ((((_local4[_local9].firstChild == null)) || ((_local4[_local9].firstChild == undefined)))){
textMappings[_local4[_local9].attributes.id] = (("[" + _local4[_local9].attributes.id) + "]");
} else {
textMappings[_local4[_local9].attributes.id] = new String(_local4[_local9].firstChild.nodeValue);
};
};
if (_local4[_local9].nodeName == "records"){
if ((((_local4[_local9].firstChild == null)) || ((_local4[_local9].firstChild == undefined)))){
records[_local4[_local9].attributes.id] = (("[" + _local4[_local9].attributes.id) + "]");
} else {
records[_local4[_local9].attributes.id] = new String(_local4[_local9].firstChild.nodeValue);
};
};
if (_local4[_local9].nodeName == "sounds"){
if ((((_local4[_local9].firstChild == null)) || ((_local4[_local9].firstChild == undefined)))){
sounds[_local4[_local9].attributes.id] = (("[" + _local4[_local9].attributes.id) + "]");
} else {
sounds[_local4[_local9].attributes.id] = new String(_local4[_local9].firstChild.nodeValue);
};
};
_local9++;
};
return (_local2);
}
}
}//package src.comm
Section 69
//MtRandom (src.math.MtRandom)
package src.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 src.math
Section 70
//ManagedSound (src.sound.ManagedSound)
package src.sound {
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{
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 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:Number):void{
var _local3:int;
while (_local3 < activeSounds.length) {
activeSounds[_local3].fadeTo(_arg1, _arg2);
_local3++;
};
}
public function fadeToAndStop(_arg1:Number, _arg2:Number):void{
var _local3:int;
while (_local3 < activeSounds.length) {
activeSounds[_local3].fadeToAndStop(_arg1, _arg2);
_local3++;
};
}
public function panTo(_arg1:Number, _arg2:Number):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 src.sound
Section 71
//ManagedSoundChannel (src.sound.ManagedSoundChannel)
package src.sound {
import flash.events.*;
import flash.utils.*;
import flash.media.*;
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:Number;// = -1
private var fadeEndTime:Number;// = -1
private var fadeStartVolume:Number;// = -1
private var fadeEndVolume:Number;// = -1
private var panStartTime:Number;// = -1
private var panEndTime:Number;// = -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 src.sound
Section 72
//SoundManager (src.sound.SoundManager)
package src.sound {
import flash.utils.*;
public class SoundManager {
private var managedSoundMap:Object;
private var managedSounds:Array;
private var lastTime:Number;// = -1
public var volume:Number;// = 1
private var fadeStartTime:Number;// = -1
private var fadeEndTime:Number;// = -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 " + _arg1)));
};
managedSoundMap[_arg1] = new ManagedSound(this, _local2);
managedSounds.push(managedSoundMap[_arg1]);
};
return (managedSoundMap[_arg1]);
}
public function fadeTo(_arg1:Number, _arg2:Number):void{
fadeStartVolume = Math.sqrt(volume);
fadeEndVolume = Math.sqrt(_arg1);
fadeStartTime = getTimer();
fadeEndTime = (getTimer() + _arg2);
}
public function setVolume(_arg1:Number):void{
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:Number = getTimer();
if (lastTime < 0){
lastTime = _local1;
};
if (fadeStartTime >= 0){
_local3 = ((getTimer() - 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 src.sound
Section 73
//IFloat (src.timing.IFloat)
package src.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 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 src.timing
Section 74
//Timeable (src.timing.Timeable)
package src.timing {
public interface Timeable {
function tick(_arg1:Number):void;
function render(_arg1:Number, _arg2:Number):void;
}
}//package src.timing
Section 75
//Timer (src.timing.Timer)
package src.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 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);
timeable.render(tick, _local3);
}
}
}//package src.timing
Section 76
//Aztec (src.Aztec)
package src {
import flash.display.*;
import src.comm.*;
import src.timing.*;
import src.math.*;
import src.sound.*;
import flash.external.*;
import flash.system.*;
import flash.text.*;
import flash.events.*;
import flash.net.*;
import flash.utils.*;
import flash.filters.*;
public class Aztec extends MovieClip implements Timeable {
public var mcRelaxGameOver:RelaxGameOver;
public var mcBetweenRounds:MovieClip;
public var mcTopFG:MovieClip;
public var mcGame:Game;
public var txtFPS:TextField;
public var mcIntroScreen:MovieClip;
public var mcBG:MovieClip;
public var mcQuit:MovieClip;
public var mcFG:MovieClip;
public var foodLeftTxt:TextField;
public var mcSFX:MovieClip;
public var mcWater:MovieClip;
public var mcRelaxModeMeter:MovieClip;
public var mcLogo:MovieClip;
public var mcMusic:MovieClip;
public var parsedGameData:Object;// = null
public var gameState;
public var userType;
public var waterEffect;// = true
public var partner:String;
public var lang:String;
public var musicManager:SoundManager;
public var sfxManager:SoundManager;
private var communicator;
private var m_mainTimer;
private var random;
private var levelRandom;
private var currentTick;
private var gameData;
private var ticksLeft;
private var level;// = 0
private var noOfRandom;// = 0
private var noOfLevelRandom;// = 0
private var signAnimAt;// = 0
private var FPSavg;
private var FPSavgCount;// = 0
private var playG_;
private var tArr;
private var egp;// = false
private var cbs;// = false
private var sfxOn;// = true
private var musicOn;// = true
private var relaxMode;// = false
private var totalBB;
private var totalES;
private var totalLR;
private var mcGameOver;
private var mcSignup;
private var noOfRend;// = 0
private var startTime;
private static const STATE_WAIT_FOR_GAMEDATA:int = 0;
private static const STATE_SHOW_INFO_SCREEN:int = 1;
private static const STATE_PLAY_GAME:int = 2;
private static const STATE_BETWEEN_ROUNDS:int = 3;
private static const STATE_END_GAME:int = 4;
private static const STATE_SIGNUP:int = 5;
private static const TICKS_PER_SEC:int = 25;
private static const BUILD_CBS_STANDALONE:Boolean = false;
private static const CBS_DATA:String = ((((((((((((((((((((((((((((((((((("<gamedata relaxMode=\"false\" partner=\"cbs\" randomseed=\"" + (0 | (Math.random() * 524288))) + "\" lang=\"en_US\">") + "<text id=\"txtTrophy1Exp\">Clear 500 levels to unlock this trophy!</text>") + "<text id=\"txtRelaxIntro\">Drop blocks to create groups of four or more of the same kind to remove them. Your goal is to make sure no blocks are above the water surface. Use space bar to switch blocks. Collect animals to keep your meter filled or the game will end.</text>") + "<text id=\"txtRegister\">Register to play the full game</text>") + "<text id=\"txtIntroHeader\">Instructions:</text>") + "<text id=\"game_starts_in\">The game starts in [0] seconds!</text>") + "<text id=\"txtLevelsLabel\">Levels Cleared:</text>") + "<text id=\"txtTrophy2Exp\">Destroy 500 black blocks to unlock this trophy!</text>") + "<text id=\"txtFish\">Fish, Seahorse and Crab: Save them by getting them into the water for extra points!</text>") + "<text id=\"txtEmptySpacesLabel\">Empty rows:</text>") + "<text id=\"game_next_screen\">Next info screen in [0] seconds!</text>") + "<text id=\"game_ends\">Game ends in [0] seconds!</text>") + "<text id=\"txtClickToCont\">Click to continue</text>") + "<text id=\"txtBlackBallsLabel\">Black blocks:</text>") + "<text id=\"txtGameOverHeader\">Game Over!</text>") + "<text id=\"txtLineBlast\">Line Blast: Destroys a complete row.</text>") + "<text id=\"txtTrophyRecieved\">Trophy Received!</text>") + "<text id=\"txtRelaxFish\">Fish, Seahorse and Crab: Save them by getting them into the water, you need this to survive!</text>") + "<text id=\"txtScoreLabel\">Score:</text>") + "<text id=\"txtBonusHeader\">Bonus objects:</text>") + "<text id=\"txtTrophy3Exp\">Get a bonus score for 1000 empty rows to unlock this trophy!</text>") + "<text id=\"txtBlack\">Black blocks cannot create combos</text>") + "<text id=\"txtIntro\">Drop blocks to create groups of four or more of the same kind to remove them. Your goal is to make sure no blocks are above the water surface. Use space bar to switch blocks.</text>") + "<text id=\"txtIntroSpeed\">SPEED_INTRO.</text>") + "<text id=\"txtBomb\">Destroys all blocks of the same colour</text>") + "<text id=\"txtTotal\">Total</text>") + "<text id=\"txtNextLevel\">You made it to the next level!</text>") + "<sounds id=\"sfxOn\">0</sounds>") + "<sounds id=\"musicOn\">0</sounds>") + "<records id=\"totalBB\">0</records>") + "<records id=\"totalES\">0</records>") + "<records id=\"totalLR\">0</records>") + "<userType id=\"0\">1</userType>") + "</gamedata>");
private static const DEBUG_MODE = false;
private static const DEBUG_GAME_DATA = ((((((((((((((((((((((((((((((((((("<gamedata relaxMode=\"false\" partner=\"cbs\" randomseed=\"" + (0 | (Math.random() * 524288))) + "\" lang=\"en_US\">") + "<text id=\"txtTrophy1Exp\">Clear 500 levels to unlock this trophy!</text>") + "<text id=\"txtRelaxIntro\">Drop blocks to create groups of four or more of the same kind to remove them. Your goal is to make sure no blocks are above the water surface. Use space bar to switch blocks. Collect animals to keep your meter filled or the game will end.</text>") + "<text id=\"txtRegister\">Register to play the full game</text>") + "<text id=\"txtIntroHeader\">Instructions:</text>") + "<text id=\"game_starts_in\">The game starts in [0] seconds!</text>") + "<text id=\"txtLevelsLabel\">Levels Cleared:</text>") + "<text id=\"txtTrophy2Exp\">Destroy 500 black blocks to unlock this trophy!</text>") + "<text id=\"txtFish\">Fish, Seahorse and Crab: Save them by getting them into the water for extra points!</text>") + "<text id=\"txtEmptySpacesLabel\">Empty rows:</text>") + "<text id=\"game_next_screen\">Next info screen in [0] seconds!</text>") + "<text id=\"game_ends\">Game ends in [0] seconds!</text>") + "<text id=\"txtClickToCont\">Click to continue</text>") + "<text id=\"txtBlackBallsLabel\">Black blocks:</text>") + "<text id=\"txtGameOverHeader\">Game Over!</text>") + "<text id=\"txtLineBlast\">Line Blast: Destroys a complete row.</text>") + "<text id=\"txtTrophyRecieved\">Trophy Received!</text>") + "<text id=\"txtRelaxFish\">Fish, Seahorse and Crab: Save them by getting them into the water, you need this to survive!</text>") + "<text id=\"txtScoreLabel\">Score:</text>") + "<text id=\"txtBonusHeader\">Bonus objects:</text>") + "<text id=\"txtTrophy3Exp\">Get a bonus score for 1000 empty rows to unlock this trophy!</text>") + "<text id=\"txtBlack\">Black blocks cannot create combos</text>") + "<text id=\"txtIntro\">Drop blocks to create groups of four or more of the same kind to remove them. Your goal is to make sure no blocks are above the water surface. Use space bar to switch blocks.</text>") + "<text id=\"txtIntroSpeed\">SPEED_INTRO.</text>") + "<text id=\"txtBomb\">Destroys all blocks of the same colour</text>") + "<text id=\"txtTotal\">Total</text>") + "<text id=\"txtNextLevel\">You made it to the next level!</text>") + "<sounds id=\"sfxOn\">0</sounds>") + "<sounds id=\"musicOn\">0</sounds>") + "<records id=\"totalBB\">0</records>") + "<records id=\"totalES\">0</records>") + "<records id=\"totalLR\">0</records>") + "<userType id=\"0\">1</userType>") + "</gamedata>");
public function Aztec(){
var _local1:*;
var _local2:Object;
var _local3:String;
musicManager = new SoundManager();
sfxManager = new SoundManager();
super();
mcGameOver = new GameOverScreen();
m_mainTimer = new Timer(this, TICKS_PER_SEC);
addEventListener("enterFrame", drive);
communicator = new Communicator();
mcBetweenRounds.visible = false;
mcGameOver.visible = false;
mcLogo.visible = false;
mcBetweenRounds.addEventListener(MouseEvent.CLICK, clearTicksLeft);
mcIntroScreen.addEventListener(MouseEvent.CLICK, clearTicksLeft);
mcGameOver.addEventListener(MouseEvent.CLICK, clearTicksLeft);
mcGameOver.mcTrophies.mcTrophy1.addEventListener(MouseEvent.ROLL_OVER, trophy1Exp);
mcGameOver.mcTrophies.mcTrophy2.addEventListener(MouseEvent.ROLL_OVER, trophy2Exp);
mcGameOver.mcTrophies.mcTrophy3.addEventListener(MouseEvent.ROLL_OVER, trophy3Exp);
mcGameOver.mcTrophies.mcTrophy1.addEventListener(MouseEvent.ROLL_OUT, clearTrophyExp);
mcGameOver.mcTrophies.mcTrophy2.addEventListener(MouseEvent.ROLL_OUT, clearTrophyExp);
mcGameOver.mcTrophies.mcTrophy3.addEventListener(MouseEvent.ROLL_OUT, clearTrophyExp);
mcQuit.addEventListener(MouseEvent.CLICK, endGamePressed);
mcSFX.addEventListener(MouseEvent.CLICK, sfxButtonClicked);
mcMusic.addEventListener(MouseEvent.CLICK, musicButtonClicked);
mcTopFG.mouseEnabled = false;
playG_ = new Play();
playG_.x = 455;
playG_.y = 500;
addChild(playG_);
playG_.addEventListener(MouseEvent.CLICK, clearTicksLeft);
if (BUILD_CBS_STANDALONE){
mcSignup = new SignupScreen();
_local1 = mcSignup.mcInner;
_local1.mcCheckbox.gotoAndStop(2);
_local1.mcClickSignup.buttonMode = true;
_local1.mcClickSignup.useHandCursor = true;
_local1.mcClickSignup.mouseChildren = false;
_local1.mcClickSignup.addEventListener(MouseEvent.CLICK, doSignup);
_local1.mcClickCheckBox.buttonMode = true;
_local1.mcClickCheckBox.useHandCursor = true;
_local1.mcClickCheckBox.mouseChildren = false;
_local1.mcClickCheckBox.addEventListener(MouseEvent.CLICK, flipSignupCheckBox);
_local1.mcClickPlayAgain.buttonMode = true;
_local1.mcClickPlayAgain.useHandCursor = true;
_local1.mcClickPlayAgain.mouseChildren = false;
_local1.mcClickPlayAgain.addEventListener(MouseEvent.CLICK, clearTicksLeft);
_local2 = new Object();
_local2.message = CBS_DATA;
_local2.success = true;
} else {
if (DEBUG_MODE){
_local2 = new Object();
_local2.message = DEBUG_GAME_DATA;
_local2.success = true;
} else {
_local2 = ExternalInterface.call("getGameData");
};
};
if ((((_local2 == null)) || (!(_local2.success)))){
trace(("oa felade " + _local2));
} else {
_local3 = _local2.message;
parsedGameData = GameDataParser.parseGameData(_local3);
random = new MtRandom(parsedGameData.randomSeed);
relaxMode = parsedGameData.relaxMode;
mcGame.relaxMode = parsedGameData.relaxMode;
partner = parsedGameData.partnerId;
lang = parsedGameData.country;
levelRandom = new MtRandom(parsedGameData.randomSeed);
mcIntroScreen.mcIntroText1.txtIntro.text = parsedGameData.textMappings[(relaxMode) ? "txtRelaxIntro" : "txtIntro"];
mcIntroScreen.mcIntroText1.txtIntroHeader.text = parsedGameData.textMappings["txtIntroHeader"];
mcIntroScreen.mcIntroText2.txtBonusHeader.text = parsedGameData.textMappings["txtBonusHeader"];
mcIntroScreen.mcIntroText2.txtBlack.text = parsedGameData.textMappings["txtBlack"];
mcIntroScreen.mcIntroText2.txtBomb.text = parsedGameData.textMappings["txtBomb"];
mcIntroScreen.mcIntroText2.txtLineBlast.text = parsedGameData.textMappings["txtLineBlast"];
mcIntroScreen.mcIntroText2.txtFish.text = parsedGameData.textMappings[(relaxMode) ? "txtRelaxFish" : "txtFish"];
mcGameOver.txtGameOverHeader.text = parsedGameData.textMappings["txtGameOverHeader"];
mcGameOver.mcScoreTextLabel.txtScoreLabel.text = parsedGameData.textMappings["txtScoreLabel"];
mcGameOver.mcScoreTextLabel.txtLevelsLabel.text = parsedGameData.textMappings["txtLevelsLabel"];
mcGameOver.mcScoreTextLabel.txtBlackBallsLabel.text = parsedGameData.textMappings["txtBlackBallsLabel"];
mcGameOver.mcScoreTextLabel.txtEmptySpacesLabel.text = parsedGameData.textMappings["txtEmptySpacesLabel"];
mcBetweenRounds.mcInfoText.txtNextLevel.text = parsedGameData.textMappings["txtNextLevel"];
mcBetweenRounds.mcInfoText.txtScoreLabel.text = parsedGameData.textMappings["txtScoreLabel"];
mcBetweenRounds.mcInfoText.txtClickToCont.text = parsedGameData.textMappings["txtClickToCont"];
totalBB = parsedGameData.records["totalBB"];
totalES = parsedGameData.records["totalES"];
totalLR = parsedGameData.records["totalLR"];
if (Number(parsedGameData.sounds["sfxOn"]) == 1){
mcSFX.gotoAndStop(10);
sfxOn = false;
mcGame.sfxOn = false;
sfxManager.setVolume(0);
};
if (Number(parsedGameData.sounds["musicOn"]) == 1){
mcMusic.gotoAndStop(10);
musicOn = false;
mcGame.musicOn = false;
musicManager.setVolume(0);
};
userType = parsedGameData.userType;
if (lang == "en_US"){
cbs = true;
mcIntroScreen.mcLogo.gotoAndStop(2);
mcLogo.visible = true;
};
showInfoScreen();
};
}
public function flipSignupCheckBox(_arg1:MouseEvent):void{
var _local2:* = mcSignup.mcInner.mcCheckbox;
_local2.gotoAndStop(((_local2.currentFrame == 1)) ? 2 : 1);
}
public function doSignup(_arg1:MouseEvent):void{
if (mcSignup.mcInner.mcCheckbox.currentFrame == 2){
communicator.signup();
};
}
public function trophy1Exp(_arg1:Event){
mcGameOver.mcTrophies.txtTrophyExp.text = parsedGameData.textMappings["txtTrophy1Exp"];
}
public function trophy2Exp(_arg1:Event){
mcGameOver.mcTrophies.txtTrophyExp.text = parsedGameData.textMappings["txtTrophy2Exp"];
}
public function trophy3Exp(_arg1:Event){
mcGameOver.mcTrophies.txtTrophyExp.text = parsedGameData.textMappings["txtTrophy3Exp"];
}
public function clearTrophyExp(_arg1:Event){
mcGameOver.mcTrophies.txtTrophyExp.text = "";
}
private function drive(_arg1:Event){
m_mainTimer.advanceTime2();
}
public function tick(_arg1:Number):void{
currentTick = _arg1;
switch (gameState){
case STATE_SHOW_INFO_SCREEN:
ticksLeft = (ticksLeft - 1);
signAnimAt++;
if (ticksLeft <= 0){
startRound();
if (!DEBUG_MODE){
communicator.gameStarted();
};
};
break;
case STATE_PLAY_GAME:
mcGame.tick(_arg1, TICKS_PER_SEC);
break;
case STATE_BETWEEN_ROUNDS:
ticksLeft--;
signAnimAt++;
if (ticksLeft == 0){
startRound();
};
break;
case STATE_END_GAME:
ticksLeft--;
signAnimAt++;
if (ticksLeft == 0){
if (BUILD_CBS_STANDALONE){
gameState = STATE_SIGNUP;
signAnimAt = 1;
ticksLeft = (TICKS_PER_SEC * 30);
addChild(mcSignup);
} else {
gameQuit();
};
};
break;
case STATE_SIGNUP:
ticksLeft--;
signAnimAt++;
if (ticksLeft == 0){
gameQuit();
};
break;
};
}
public function render(_arg1:Number, _arg2:Number):void{
var _local4:*;
musicManager.update();
sfxManager.update();
if (noOfRend == 0){
startTime = getTimer();
};
noOfRend++;
var _local3:* = (getTimer() - startTime);
if (_local3 > 2000){
_local4 = Math.round(((noOfRend * 1000) / _local3));
noOfRend = 0;
if (FPSavg == undefined){
FPSavg = _local4;
FPSavgCount = 1;
} else {
FPSavg = (FPSavg + _local4);
FPSavgCount++;
};
if (FPSavgCount == 5){
if ((FPSavg / 5) < 10){
waterEffect = false;
};
FPSavg = 0;
FPSavgCount = 0;
};
};
switch (gameState){
case STATE_SHOW_INFO_SCREEN:
mcIntroScreen.gotoAndStop(signAnimAt);
break;
case STATE_PLAY_GAME:
mcGame.render(_arg1, _arg2);
break;
case STATE_BETWEEN_ROUNDS:
mcBetweenRounds.gotoAndStop(signAnimAt);
break;
case STATE_END_GAME:
if (signAnimAt < 21){
mcGameOver.gotoAndStop(signAnimAt);
} else {
if (tArr.length > 0){
if (tArr[0] == 1){
mcGameOver.mcTrophies.mcTrophy1.gotoAndPlay(2);
};
if (tArr[1] == 1){
mcGameOver.mcTrophies.mcTrophy2.gotoAndPlay(2);
};
if (tArr[2] == 1){
mcGameOver.mcTrophies.mcTrophy3.gotoAndPlay(2);
};
tArr = [];
};
};
break;
case STATE_SIGNUP:
if (signAnimAt < 19){
mcSignup.gotoAndStop(signAnimAt);
};
break;
};
}
public function clearTicksLeft(_arg1:Event){
switch (gameState){
case STATE_BETWEEN_ROUNDS:
if ((((signAnimAt > 49)) && ((signAnimAt < 100)))){
ticksLeft = 29;
signAnimAt = 100;
};
break;
case STATE_END_GAME:
if (ticksLeft < 225){
ticksLeft = 1;
};
break;
default:
ticksLeft = 1;
};
}
public function showInfoScreen(){
musicManager.get("intro").play(1);
signAnimAt = 1;
ticksLeft = 560;
gameState = STATE_SHOW_INFO_SCREEN;
}
public function startRound(){
if (level == 0){
removeChild(playG_);
removeChild(mcIntroScreen);
stage.focus = this;
musicManager.get("intro").stop();
} else {
musicManager.get("levelCompleted").stop();
};
musicManager.get("loop").loop(0).fadeTo(0.4, 1000);
musicManager.get("levelStart").play();
level++;
mcBetweenRounds.visible = false;
gameState = STATE_PLAY_GAME;
var _local1:Array = getGameArr();
mcGame.startRound(level, this, currentTick, _local1, communicator);
}
public function getGameArr(){
var _local1:Array = new Array();
var _local2:Array = new Array();
var _local3:Array = new Array();
_local3.push((((((((((((((("0,0,0,0,0,0,0,0,0,0,0-" + "0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0-") + "0,0,1,1,1,1,1,1,1,0,0-") + "0,0,1,1,1,1,1,1,1,0,0-") + "0,0,1,1,1,1,1,1,1,0,0-") + "0,0,1,1,1,1,1,1,1,0,0-") + "0,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,0-") + "1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1"));
_local3.push((((((((((((((("0,0,0,0,0,0,0,0,0,0,0,0,0-" + "0,0,0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0,0,0-") + "0,1,0,0,0,0,0,0,0,0,0,1,0-") + "0,1,0,0,0,0,0,0,0,0,0,1,0-") + "0,1,0,0,0,0,0,0,0,0,0,1,0-") + "0,1,0,1,1,1,1,1,1,1,0,1,0-") + "0,1,1,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,1,1,0-") + "1,1,1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1,1,1"));
_local3.push((((((((((((((("0,0,0,0,0,0,0,0,0,0,0,0,0-" + "0,0,0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,1,1,1,0,0,0,0,0-") + "0,0,0,0,0,1,1,1,0,0,0,0,0-") + "0,0,0,0,0,1,1,1,0,0,0,0,0-") + "0,0,0,0,0,1,1,1,0,0,0,0,0-") + "1,1,1,0,0,1,1,1,0,0,1,1,1-") + "1,1,1,0,0,1,1,1,0,0,1,1,1-") + "1,1,1,0,0,1,1,1,0,0,1,1,1-") + "1,1,1,0,0,1,1,1,0,0,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1,1,1"));
_local3.push((((((((((((((("0,0,0,0,0,0,0,0,0,0,0,0,0-" + "0,0,0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,1,1,1,1,1,0,0,0,0-") + "0,0,0,0,1,1,1,1,1,0,0,0,0-") + "0,0,0,0,1,1,1,1,1,0,0,0,0-") + "0,0,0,1,1,1,1,1,1,1,0,0,0-") + "0,0,0,1,1,1,1,1,1,1,0,0,0-") + "0,0,0,1,1,1,1,1,1,1,0,0,0-") + "0,0,0,1,1,1,1,1,1,1,0,0,0-") + "0,0,0,1,1,1,1,1,1,1,0,0,0-") + "0,0,0,1,1,1,1,1,1,1,0,0,0-") + "0,0,0,1,1,1,1,1,1,1,0,0,0-") + "1,1,1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1,1,1"));
_local3.push((((((((((((((("0,0,0,0,0,0,0,0,0,0,0-" + "0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0-") + "0,1,1,0,0,0,0,0,1,1,0-") + "0,1,1,0,0,0,0,0,1,1,0-") + "0,1,1,0,0,0,0,0,1,1,0-") + "0,1,1,0,0,0,0,0,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,0"));
_local3.push((((((((((((((("0,0,0,0,0,0,0,0,0,0,0,0,0-" + "0,0,0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0,0,0-") + "1,0,0,0,0,0,0,0,0,0,0,0,1-") + "1,0,1,1,1,0,0,0,1,1,1,0,1-") + "1,0,1,1,1,0,0,0,1,1,1,0,1-") + "1,0,1,1,1,0,0,0,1,1,1,0,1-") + "1,0,1,1,1,0,0,0,1,1,1,0,1-") + "1,0,1,1,1,0,0,0,1,1,1,0,1-") + "1,0,1,1,1,0,0,0,1,1,1,0,1-") + "1,1,1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1,1,1"));
_local3.push((((((((((((((("0,0,0,0,0,0,0,0,0,0,0,0,0-" + "0,0,0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0,0,0-") + "1,0,0,0,0,0,0,0,0,0,0,0,1-") + "1,1,0,0,0,0,0,0,0,0,0,1,1-") + "1,1,1,0,0,0,0,0,0,0,1,1,1-") + "1,1,1,1,0,0,0,0,0,1,1,1,1-") + "1,1,1,1,1,0,0,0,1,1,1,1,1-") + "1,1,1,1,1,1,0,1,1,1,1,1,1-") + "1,1,1,1,1,1,0,1,1,1,1,1,1-") + "1,1,1,1,1,1,0,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1,1,1"));
_local3.push((((((((((((((("0,0,0,0,0,0,0,0,0,0,0,0,0-" + "0,0,0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,1,0,0,0,0,0,0-") + "0,0,0,0,0,1,1,1,0,0,0,0,0-") + "0,0,0,0,1,1,1,1,1,0,0,0,0-") + "0,0,0,1,1,1,1,1,1,1,0,0,0-") + "0,0,1,1,1,1,1,1,1,1,1,0,0-") + "0,0,1,1,1,1,1,1,1,1,1,0,0-") + "1,0,1,1,1,1,1,1,1,1,1,0,1-") + "1,0,1,1,1,1,1,1,1,1,1,0,1-") + "1,1,1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1,1,1"));
_local3.push((((((((((((((("0,0,0,0,0,0,0,0,0,0,0-" + "0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0-") + "0,1,1,0,0,0,0,0,1,1,0-") + "0,1,1,0,0,0,0,0,1,1,0-") + "0,1,1,0,0,0,0,0,1,1,0-") + "0,1,1,0,1,1,1,0,1,1,0-") + "0,1,1,0,1,1,1,0,1,1,0-") + "0,1,1,0,1,1,1,0,1,1,0-") + "0,1,1,0,1,1,1,0,1,1,0-") + "0,1,1,0,1,1,1,0,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,0"));
_local3.push((((((((((((((("0,0,0,0,0,0,0,0,0,0,0,0,0-" + "0,0,0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0,0,0-") + "0,1,0,0,0,0,1,0,0,0,0,1,0-") + "0,1,0,0,0,1,1,1,0,0,0,1,0-") + "0,1,0,0,1,1,1,1,1,0,0,1,0-") + "0,1,0,1,1,1,1,1,1,1,0,1,0-") + "0,1,0,1,1,1,1,1,1,1,0,1,0-") + "0,1,1,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,1,1,0"));
_local3.push((((((((((((((("0,0,0,0,0,0,0,0,0,0,0-" + "0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0-") + "0,0,1,1,1,0,1,1,1,0,0-") + "0,0,1,1,1,0,1,1,1,0,0-") + "0,0,1,1,1,0,1,1,1,0,0-") + "0,0,1,1,1,0,1,1,1,0,0-") + "0,0,1,1,1,0,1,1,1,0,0-") + "0,1,1,1,1,0,1,1,1,1,0-") + "1,1,1,1,1,0,1,1,1,1,1-") + "1,1,1,1,1,0,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1"));
_local3.push((((((((((((((("0,0,0,0,0,0,0,0,0,0,0-" + "0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0-") + "1,1,1,0,0,0,0,0,1,1,1-") + "1,1,1,0,0,0,0,0,1,1,1-") + "1,1,1,0,0,0,0,0,1,1,1-") + "1,1,1,0,0,0,0,0,1,1,1-") + "1,1,1,0,0,0,0,0,1,1,1-") + "1,1,1,0,0,0,0,0,1,1,1-") + "1,1,1,1,0,0,0,1,1,1,1-") + "1,1,1,1,1,0,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1"));
_local3.push((((((((((((((("0,0,0,0,0,0,0,0,0,0,0-" + "0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,1,0,1,0,0,0,0-") + "0,0,0,1,1,0,1,1,0,0,0-") + "0,0,1,1,1,0,1,1,1,0,0-") + "1,0,1,1,1,0,1,1,1,0,1-") + "1,0,1,1,1,1,1,1,1,0,1-") + "1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1"));
_local3.push((((((((((((((("0,0,0,0,0,0,0,0,0,0,0-" + "0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0-") + "1,0,0,0,1,0,1,0,0,0,1-") + "1,1,0,1,1,0,1,1,0,1,1-") + "1,1,1,1,1,0,1,1,1,1,1-") + "1,1,1,1,1,0,1,1,1,1,1-") + "1,1,1,1,1,0,1,1,1,1,1-") + "1,1,1,1,1,0,1,1,1,1,1-") + "1,1,1,1,1,0,1,1,1,1,1-") + "1,1,1,1,1,0,1,1,1,1,1-") + "1,1,1,1,1,0,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1"));
_local3.push((((((((((((((("0,0,0,0,0,0,0,0,0,0,0-" + "0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0-") + "0,1,0,0,0,1,0,0,0,1,0-") + "1,1,1,0,0,1,0,0,1,1,1-") + "1,1,1,0,0,1,0,0,1,1,1-") + "1,1,1,0,0,1,0,0,1,1,1-") + "1,1,1,0,0,1,0,0,1,1,1-") + "1,1,1,0,0,1,0,0,1,1,1-") + "1,1,1,1,0,1,0,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1"));
_local3.push((((((((((((((("0,0,0,0,0,0,0,0,0,0,0,0,0-" + "0,0,0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0,0,0-") + "0,1,1,0,0,0,0,0,0,0,0,0,0-") + "0,1,1,1,1,0,0,0,0,0,0,0,0-") + "0,1,1,1,1,1,0,1,0,0,0,0,0-") + "0,1,1,1,1,1,0,1,1,1,0,0,0-") + "0,1,1,1,1,1,0,1,1,1,1,1,0-") + "0,1,1,1,1,1,0,1,1,1,1,1,0-") + "0,1,1,1,1,1,0,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,1,1,0"));
_local3.push((((((((((((((("0,0,0,0,0,0,0,0,0,0,0-" + "0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,1,1-") + "0,0,0,0,0,0,1,1,0,1,1-") + "0,0,0,1,1,0,1,1,0,1,1-") + "1,1,0,1,1,0,1,1,0,1,1-") + "1,1,0,1,1,0,1,1,0,1,1-") + "1,1,0,1,1,0,1,1,0,1,1-") + "1,1,0,1,1,0,1,1,0,1,1-") + "1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1"));
_local3.push((((((((((((((("0,0,0,0,0,0,0,0,0,0,0,0,0-" + "0,0,0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,1,0,0,0,0,0,0-") + "0,0,0,0,0,1,1,1,0,0,0,0,0-") + "0,0,1,1,0,1,1,1,0,1,1,0,0-") + "0,1,1,1,0,1,1,1,0,1,1,1,0-") + "0,1,1,1,0,1,1,1,0,1,1,1,0-") + "0,1,1,1,0,1,1,1,0,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,1,1,0"));
_local3.push((((((((((((((("0,0,0,0,0,0,0,0,0,0,0-" + "0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0-") + "1,1,1,1,0,0,0,1,1,1,1-") + "1,1,1,1,0,0,0,1,1,1,1-") + "1,1,1,1,0,1,0,1,1,1,1-") + "1,1,1,1,0,1,0,1,1,1,1-") + "1,1,1,1,0,1,0,1,1,1,1-") + "1,1,1,1,0,1,0,1,1,1,1-") + "1,1,1,1,0,1,0,1,1,1,1-") + "1,1,1,1,0,1,0,1,1,1,1-") + "1,1,1,1,0,1,0,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1"));
_local3.push((((((((((((((("0,0,0,0,0,0,0,0,0-" + "0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0-") + "1,1,1,1,0,1,1,1,1-") + "1,1,1,1,0,1,1,1,1-") + "1,1,1,1,0,1,1,1,1-") + "1,1,1,1,0,1,1,1,1-") + "1,1,1,1,0,1,1,1,1-") + "1,1,1,1,0,1,1,1,1-") + "1,1,1,1,0,1,1,1,1-") + "1,1,1,1,0,1,1,1,1-") + "1,1,1,1,0,1,1,1,1-") + "1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1"));
_local3.push((((((((((((((("0,0,0,0,0,0,0,0,0,0,0-" + "0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,1,1,0,1,1,0,0,0-") + "0,0,0,1,1,0,1,1,0,0,0-") + "0,0,0,1,1,0,1,1,0,0,0-") + "0,0,0,1,1,0,1,1,0,0,0-") + "0,0,0,1,1,0,1,1,0,0,0-") + "1,0,1,1,1,0,1,1,1,0,1-") + "1,0,1,1,1,0,1,1,1,0,1-") + "1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1"));
_local3.push((((((((((((((("0,0,0,0,0,0,0,0,0,0,0-" + "0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0-") + "0,1,0,1,1,0,1,1,0,1,0-") + "0,1,0,1,1,0,1,1,0,1,0-") + "0,1,1,1,1,0,1,1,1,1,0-") + "0,1,1,1,1,0,1,1,1,1,0-") + "0,1,1,1,1,0,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,0"));
_local3.push((((((((((((((("0,0,0,0,0,0,0,0,0,0,0,0,0-" + "0,0,0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0,0,0-") + "0,1,1,1,0,0,0,0,0,1,1,1,0-") + "0,1,1,1,0,0,0,0,0,1,1,1,0-") + "0,1,1,1,0,0,0,0,0,1,1,1,0-") + "0,1,1,1,0,0,0,0,0,1,1,1,0-") + "0,1,1,1,1,0,1,0,1,1,1,1,0-") + "0,1,1,1,1,0,1,0,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,1,1,0-") + "0,1,1,1,1,1,1,1,1,1,1,1,0"));
_local3.push((((((((((((((("0,0,0,0,0,0,0,0,0,0,0-" + "0,0,0,0,0,0,0,0,0,0,0-") + "0,0,0,0,0,0,0,0,0,0,0-") + "0,1,1,0,0,0,0,0,1,1,0-") + "0,1,1,0,0,0,0,0,1,1,0-") + "1,1,1,0,0,0,0,0,1,1,1-") + "1,1,1,1,1,0,1,1,1,1,1-") + "1,1,1,1,1,0,1,1,1,1,1-") + "1,1,1,1,1,0,1,1,1,1,1-") + "1,1,1,1,1,0,1,1,1,1,1-") + "1,1,1,1,1,0,1,1,1,1,1-") + "1,1,1,1,1,0,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1-") + "1,1,1,1,1,1,1,1,1,1,1"));
var _local4:Array = _local3[getLevelRandom(_local3.length)].split("-");
var _local5:* = 0;
while (_local5 < _local4.length) {
_local1 = _local4[_local5].split(",");
_local2.push(_local1);
_local5++;
};
return (_local2);
}
public function endRound(_arg1, _arg2, _arg3, _arg4){
musicManager.get("loop").stop();
if (_arg1){
musicManager.get("levelCompleted").play();
betweenRounds(_arg2);
} else {
musicManager.get("outro").play();
endGame(_arg2, _arg3, _arg4);
};
}
public function betweenRounds(_arg1){
signAnimAt = 1;
mcBetweenRounds.visible = true;
ticksLeft = (5 * TICKS_PER_SEC);
mcBetweenRounds.mcInfoText.txtScore.text = _arg1;
gameState = STATE_BETWEEN_ROUNDS;
}
public function endGame(_arg1, _arg2, _arg3){
var _local4:* = 1;
var _local5:* = 1;
if (sfxOn){
_local4 = 0;
};
if (musicOn){
_local5 = 0;
};
communicator.soundStates(_local5, _local4);
if (!egp){
communicator.lastTick((currentTick + 1), noOfRandom, noOfLevelRandom);
};
communicator.gameEnd(_arg1);
signAnimAt = 1;
ticksLeft = 275;
mcGameOver.visible = true;
mcGameOver.mcScoreText.txtScore.text = _arg1;
var _local6:Number = (Number(totalLR) + Number((level - 1)));
var _local7:Number = (Number(totalBB) + Number(_arg2));
var _local8:Number = (Number(totalES) + Number(_arg3));
mcGameOver.mcScoreText.txtLevels.text = (((((level - 1) + "/ ") + parsedGameData.textMappings["txtTotal"]) + " ") + _local6);
mcGameOver.mcScoreText.txtBlackBalls.text = ((((_arg2 + "/ ") + parsedGameData.textMappings["txtTotal"]) + " ") + _local7);
mcGameOver.mcScoreText.txtEmptySpaces.text = ((((_arg3 + "/ ") + parsedGameData.textMappings["txtTotal"]) + " ") + _local8);
mcGameOver.x = 378;
mcGameOver.y = 283;
addChild(mcGameOver);
tArr = new Array(0, 0, 0);
if (((level - 1) + Number(totalLR)) > 499){
tArr[0] = 1;
mcGameOver.mcTrophies.mcTrophy1.gotoAndPlay(2);
if (Number(totalLR) < 500){
mcGameOver.mcTrophies.txtTrophyRecieved.text = parsedGameData.textMappings["txtTrophyRecieved"];
addGlow(mcGameOver.mcScoreText.txtLevels);
addGlow(mcGameOver.mcTrophies.txtTrophyRecieved);
};
};
if ((_arg2 + Number(totalBB)) > 499){
tArr[1] = 1;
mcGameOver.mcTrophies.mcTrophy2.gotoAndPlay(2);
if (Number(totalBB) < 500){
mcGameOver.mcTrophies.txtTrophyRecieved.text = parsedGameData.textMappings["txtTrophyRecieved"];
addGlow(mcGameOver.mcScoreText.txtBlackBalls);
addGlow(mcGameOver.mcTrophies.txtTrophyRecieved);
};
};
if ((_arg3 + Number(totalES)) > 999){
tArr[2] = 1;
mcGameOver.mcTrophies.mcTrophy3.gotoAndPlay(2);
if (Number(totalES) < 1000){
mcGameOver.mcTrophies.txtTrophyRecieved.text = parsedGameData.textMappings["txtTrophyRecieved"];
addGlow(mcGameOver.mcScoreText.txtEmptySpaces);
addGlow(mcGameOver.mcTrophies.txtTrophyRecieved);
};
};
if (userType == 0){
mcGameOver.mcTrophies.txtTrophyRecieved.text = parsedGameData.textMappings["txtRegister"];
};
gameState = STATE_END_GAME;
}
public function addGlow(_arg1){
var _local2:GlowFilter = new GlowFilter();
_local2.color = 16777164;
_local2.blurY = 8;
_local2.blurX = 8;
_local2.strength = 3;
_local2.quality = 2;
_arg1.filters = [_local2];
}
public function gameQuit(){
trace("It's easier than you think!");
url = "index.php?act=Arcade&do=newscore";
request = new URLRequest(url);
variables = new URLVariables();
variables.gname = "AmazonSurvivorAS3v2DOT";
variables.gscore = mcGameOver.mcScoreText.txtScore.text;
request.data = variables;
request.method = URLRequestMethod.POST;
navigateToURL(request, "_self");
communicator.gameQuit();
}
public function sfxButtonClicked(_arg1:Event){
if (sfxOn){
sfxManager.fadeTo(0, 500);
mcSFX.gotoAndStop(10);
sfxOn = false;
mcGame.sfxOn = false;
} else {
sfxManager.fadeTo(1, 500);
mcSFX.gotoAndStop(1);
sfxOn = true;
mcGame.sfxOn = true;
};
}
public function musicButtonClicked(_arg1:Event){
if (musicOn){
musicManager.fadeTo(0, 500);
mcMusic.gotoAndStop(10);
musicOn = false;
mcGame.musicOn = false;
} else {
musicManager.fadeTo(1, 500);
mcMusic.gotoAndStop(1);
musicOn = true;
mcGame.musicOn = true;
};
}
public function endGamePressed(_arg1:Event){
egp = true;
communicator.endPressed((currentTick + 1), noOfRandom, noOfLevelRandom);
mcGame.endRound(false, 0);
}
public function getRandom(_arg1:Number){
noOfRandom++;
return (random.nextInt(_arg1));
}
public function getLevelRandom(_arg1:Number){
noOfLevelRandom++;
return (levelRandom.nextInt(_arg1));
}
}
}//package src
Section 77
//BubbleAnim (src.BubbleAnim)
package src {
import flash.display.*;
import src.comm.*;
import src.timing.*;
import src.math.*;
import flash.external.*;
import flash.system.*;
import flash.text.*;
public class BubbleAnim extends MovieClip {
public var mcBubble:MovieClip;
public var animLength;// = 21
public var animAt;// = 1
public function BubbleAnim(){
x = Math.round((Math.random() * 750));
y = 560;
alpha = 0.8;
var _local1:* = Math.random();
mcBubble.mcInnerBubble.scaleX = Math.max(_local1, 0.4);
mcBubble.mcInnerBubble.scaleY = Math.max(_local1, 0.4);
}
}
}//package src
Section 78
//ClearLevel (src.ClearLevel)
package src {
import flash.display.*;
public dynamic class ClearLevel extends MovieClip {
}
}//package src
Section 79
//DustAnim (src.DustAnim)
package src {
import flash.display.*;
public class DustAnim extends MovieClip {
public var animLength;// = 13
public var animAt;// = 1
public function DustAnim(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package src
Section 80
//Explosion (src.Explosion)
package src {
import flash.display.*;
public class Explosion extends MovieClip {
public var mcRed:MovieClip;
public var mcLineBlastExplosion:MovieClip;
public var mcRegularExplosion:MovieClip;
public var mcGreen:MovieClip;
public var mcYellow:MovieClip;
public var mcBlue:MovieClip;
public var animLength;// = 11
public var animAt;// = 1
public var delay;
public var scaleVal;// = 1
public var target;
public function Explosion(_arg1, _arg2, _arg3, _arg4){
x = _arg1;
y = _arg2;
this.delay = _arg3;
mcRegularExplosion.visible = false;
mcLineBlastExplosion.visible = false;
mcBlue.visible = false;
mcYellow.visible = false;
mcGreen.visible = false;
mcRed.visible = false;
switch (_arg4){
case 0:
animLength = 16;
mcBlue.visible = true;
target = mcBlue;
break;
case 1:
animLength = 16;
mcYellow.visible = true;
target = mcYellow;
break;
case 2:
animLength = 16;
mcGreen.visible = true;
target = mcGreen;
break;
case 3:
animLength = 16;
mcRed.visible = true;
target = mcRed;
break;
case 10:
animLength = 11;
mcRegularExplosion.visible = true;
target = mcRegularExplosion;
break;
case 20:
animLength = 13;
mcLineBlastExplosion.visible = true;
target = mcLineBlastExplosion;
break;
};
}
}
}//package src
Section 81
//Game (src.Game)
package src {
import flash.display.*;
import src.comm.*;
import src.timing.*;
import src.math.*;
import src.sound.*;
import flash.external.*;
import flash.system.*;
import flash.text.*;
import flash.events.*;
import flash.utils.*;
import flash.filters.*;
import flash.geom.*;
public class Game extends MovieClip {
public var mcTimeNum2:MovieClip;
public var mcTimeNum4:MovieClip;
public var mcTimeDiv:MovieClip;
public var mcTimeNum3:MovieClip;
private var food:int;// = 0
private var endDelay:int;// = 0
public var relaxMode:Boolean;// = false
private var startTime;
private var communicator;
private var gameState;
private var random;
private var currentTick;
private var level;
private var gameRoot;
private var noOfTypes;
private var gameGridObj:Array;
private var splashArr;
private var floatYArr:Array;
private var visualExplArr:Array;
private var waveArr;
private var dustArr;
private var slider;
private var sliderFloat;
private var rotFloat;
private var pieceStack;
private var nextPiece;// = null
private var switchPiece;// = null
private var explArr;
private var collapsing;
private var scoreArr;
private var score;// = 0
private var clearLevel;
private var consecutive;
public var timeLeft;// = 6000
private var cleared_;
private var bonusScore_;
private var sliderMod;// = 1
private var rotSpeed;// = 0
private var waveSpeed;// = 1
private var explodeCounter;// = 0
private var stone1;
private var stone2;
private var pieceXMod;// = 0
private var shotSound;// = false
private var doBubbles;// = true
private var levelNumArr;
private var scoreNumArr;
private var bubbleAnimArr;
private var waterBaseBitmap:Bitmap;
private var waterBaseBitmapData:BitmapData;
private var distortFilter:BitmapFilter;
private var musicManager:SoundManager;
private var sfxManager:SoundManager;
private var theme;
public var sfxOn;// = true
public var musicOn;// = true
private var allLanded;// = 0
private var nextPieceFloatX;
private var nextPieceFloatY;
private var nextPieceFloatScaleX;
private var nextPieceFloatScaleY;
private var switchPieceFloatX;
private var switchPieceFloatY;
private var switchPieceFloatScaleX;
private var switchPieceFloatScaleY;
private var numBlack;// = 0
private var numEmptyRows;// = 0
private var makeLineBlast_;// = false
private var bonusShown;
private var distortBitmap:BitmapData;
private var boardMatchNum;
private static const FOOD_INCREASE:int = 5;
private static const FOOD_LIMIT:int = 35;
private static const FOOD_START:int = int((FOOD_LIMIT / 2));
private static var STATE_RUNNING = 0;
private static var STATE_NOT_RUNNING = 1;
private static var STATE_END_ANIMS = 2;
private static var LEVEL_CLEARANCE = 10;
public function Game(){
levelNumArr = new Array();
scoreNumArr = new Array();
super();
this.addEventListener(MouseEvent.MOUSE_DOWN, shootBall);
stage.addEventListener(KeyboardEvent.KEY_DOWN, switchBalls);
distortBitmap = new BitmapData(755, 200);
distortFilter = new DisplacementMapFilter(distortBitmap, new Point(0, 0), BitmapDataChannel.RED, BitmapDataChannel.GREEN, 4, 4, "wrap");
}
public function tick(_arg1:Number, _arg2:Number):void{
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
currentTick = _arg1;
switch (gameState){
case STATE_RUNNING:
if (doBubbles){
if ((Math.random() * 100) < 5){
createBubbleAnim();
};
};
explodeCounter = Math.max((explodeCounter - 1), 0);
waveSpeed = ((waveSpeed % 28) + 1);
if (!relaxMode){
if (allLanded == 0){
timeLeft--;
if ((((gameRoot.userType == 0)) && ((level == 2)))){
openUserEnd();
break;
};
};
if (timeLeft == 0){
if (collapsing > 0){
timeLeft++;
} else {
endRound(false, 0);
break;
};
};
if (timeLeft == 250){
sfxManager.get("warning").play(0.7);
};
};
_local3 = ((mouseX - slider.theX) / 2);
slider.theX = (slider.theX + _local3);
slider.theX = Math.min((((gameGridObj[0].length - 1) * 32) + pieceXMod), slider.theX);
slider.theX = Math.max(pieceXMod, slider.theX);
_local4 = Math.max((((375 - slider.theX) / 100) * 2), ((((375 - slider.theX) / 100) * 2) * -1));
slider.theY = (37 - _local4);
sliderFloat.set(slider.theX);
rotSpeed = (rotSpeed - (_local3 / 2));
rotSpeed = Math.min(rotSpeed, 15);
rotSpeed = Math.max(rotSpeed, -15);
if (rotSpeed > 0){
rotSpeed = Math.max((rotSpeed - 0.5), 0);
} else {
rotSpeed = Math.min((rotSpeed + 0.5), 0);
};
rotFloat.set(rotSpeed);
if (slider.animAt > 1){
reloadAnim(slider.animAt, sliderMod);
slider.animAt = (slider.animAt + sliderMod);
if (slider.animAt == 8){
sliderMod = -1;
} else {
if (slider.animAt == 1){
sliderMod = 1;
createPieceRolling();
};
};
};
if (slider.switchAnimAt > 1){
switchBallsAnim(slider.switchAnimAt);
slider.switchAnimAt = (slider.switchAnimAt + 1);
};
if (nextPiece.isBomb){
nextPiece.bombAnim = ((nextPiece.bombAnim % nextPiece.bombAnimLength) + 1);
};
if (nextPiece.isLineBlast){
nextPiece.lineBlastAnim = ((nextPiece.lineBlastAnim % nextPiece.lineBlastAnimLength) + 1);
};
if (switchPiece.isBomb){
switchPiece.bombAnim = ((switchPiece.bombAnim % switchPiece.bombAnimLength) + 1);
};
if (switchPiece.isLineBlast){
switchPiece.lineBlastAnim = ((switchPiece.lineBlastAnim % switchPiece.lineBlastAnimLength) + 1);
};
_local5 = 0;
while (_local5 < gameGridObj.length) {
_local6 = 0;
while (_local6 < gameGridObj[_local5].length) {
if (gameGridObj[_local5][_local6] != null){
if (gameGridObj[_local5][_local6].isCoin){
gameGridObj[_local5][_local6].animAt = ((gameGridObj[_local5][_local6].animAt % 20) + 1);
};
if (gameGridObj[_local5][_local6].isBomb){
gameGridObj[_local5][_local6].bombAnim = ((gameGridObj[_local5][_local6].bombAnim % gameGridObj[_local5][_local6].bombAnimLength) + 1);
};
if (gameGridObj[_local5][_local6].isLineBlast){
gameGridObj[_local5][_local6].lineBlastAnim = ((gameGridObj[_local5][_local6].lineBlastAnim % gameGridObj[_local5][_local6].lineBlastAnimLength) + 1);
};
if (explodeCounter == 0){
if (gameGridObj[_local5][_local6].theY != gameGridObj[_local5][_local6].gotoY){
if (gameGridObj[_local5][_local6].delay == 0){
if ((((((gameGridObj[_local5][_local6].theY < ((LEVEL_CLEARANCE * 32) + 100))) && ((Math.min((gameGridObj[_local5][_local6].theY + gameGridObj[_local5][_local6].getSpeed()), gameGridObj[_local5][_local6].gotoY) > ((LEVEL_CLEARANCE * 32) + 100))))) && ((allLanded == 0)))){
sfxManager.get("splash").play(0.7);
};
gameGridObj[_local5][_local6].updateSpeed();
gameGridObj[_local5][_local6].theY = Math.min((gameGridObj[_local5][_local6].theY + gameGridObj[_local5][_local6].getSpeed()), gameGridObj[_local5][_local6].gotoY);
floatYArr[_local5][_local6].set(gameGridObj[_local5][_local6].theY);
gameGridObj[_local5][_local6].animAt = ((gameGridObj[_local5][_local6].animAt + gameGridObj[_local5][_local6].animSpeed) % gameGridObj[_local5][_local6].animLength);
if (gameGridObj[_local5][_local6].theY == gameGridObj[_local5][_local6].gotoY){
floatYArr[_local5][_local6].set(gameGridObj[_local5][_local6].theY);
if (((!(gameGridObj[_local5][_local6].firstLand)) && ((allLanded == 0)))){
createDust(gameGridObj[_local5][_local6]);
};
gameGridObj[_local5][_local6].land();
allLanded = Math.max((allLanded - 1), 0);
if (gameGridObj[_local5][_local6].targetID > 0){
gameGridObj[_local5][_local6].rotDeg = (Math.round(((gameGridObj[_local5][_local6].rotation / 360) * 4)) * 90);
gameGridObj[_local5][_local6].animAt = ((Number(((Math.round((((gameGridObj[_local5][_local6].animAt % 20) / 20) * 4)) * 5) + 1)) % 20) * 3);
};
if (gameGridObj[_local5][_local6].running){
checkForExplosion(gameGridObj[_local5][_local6]);
} else {
gameGridObj[_local5][_local6].running = true;
};
collapsing--;
if (shotSound){
sfxManager.get("knock").play(0.1);
shotSound = false;
};
if (collapsing == 0){
if (collapsing == 0){
consecutive = 0;
checkForCoin();
if (checkForCleared()){
endAnims(true);
};
};
};
};
} else {
gameGridObj[_local5][_local6].delay--;
};
};
};
};
_local6++;
};
_local5++;
};
_local5 = 0;
while (_local5 < scoreArr.length) {
if (scoreArr[_local5].delay == 0){
scoreArr[_local5].animAt++;
if (scoreArr[_local5].animAt == scoreArr[_local5].animLength){
removeChild(scoreArr[_local5]);
scoreArr.splice(_local5, 1);
_local5--;
};
} else {
scoreArr[_local5].delay--;
};
_local5++;
};
_local5 = 0;
while (_local5 < splashArr.length) {
splashArr[_local5].animAt++;
if (splashArr[_local5].animAt == 18){
removeChild(splashArr[_local5]);
splashArr.splice(_local5, 1);
_local5--;
};
_local5++;
};
_local5 = 0;
while (_local5 < dustArr.length) {
dustArr[_local5].animAt++;
if (dustArr[_local5].animAt == dustArr[_local5].animLength){
removeChild(dustArr[_local5]);
dustArr.splice(_local5, 1);
_local5--;
};
_local5++;
};
_local5 = 0;
while (_local5 < visualExplArr.length) {
if (visualExplArr[_local5].delay > 0){
visualExplArr[_local5].delay--;
} else {
visualExplArr[_local5].animAt++;
if (visualExplArr[_local5].animAt >= visualExplArr[_local5].animLength){
removeChild(visualExplArr[_local5]);
visualExplArr.splice(_local5, 1);
_local5--;
};
};
_local5++;
};
_local5 = 0;
while (_local5 < bubbleAnimArr.length) {
bubbleAnimArr[_local5].animAt++;
if (bubbleAnimArr[_local5].animAt == bubbleAnimArr[_local5].animLength){
removeChild(bubbleAnimArr[_local5]);
bubbleAnimArr.splice(_local5, 1);
_local5--;
};
_local5++;
};
break;
case STATE_END_ANIMS:
_local7 = true;
_local5 = 0;
while (_local5 < gameGridObj.length) {
_local6 = 0;
while (_local6 < gameGridObj[_local5].length) {
if (gameGridObj[_local5][_local6] != null){
if (gameGridObj[_local5][_local6].isCoin){
gameGridObj[_local5][_local6].animAt = ((gameGridObj[_local5][_local6].animAt % 20) + 1);
};
if (gameGridObj[_local5][_local6].isBomb){
gameGridObj[_local5][_local6].bombAnim = ((gameGridObj[_local5][_local6].bombAnim % gameGridObj[_local5][_local6].bombAnimLength) + 1);
};
if (gameGridObj[_local5][_local6].isLineBlast){
gameGridObj[_local5][_local6].lineBlastAnim = ((gameGridObj[_local5][_local6].lineBlastAnim % gameGridObj[_local5][_local6].lineBlastAnimLength) + 1);
};
if (explodeCounter == 0){
if (gameGridObj[_local5][_local6].theY != gameGridObj[_local5][_local6].gotoY){
_local7 = false;
if (gameGridObj[_local5][_local6].delay == 0){
if ((((((gameGridObj[_local5][_local6].theY < ((LEVEL_CLEARANCE * 32) + 100))) && ((Math.min((gameGridObj[_local5][_local6].theY + gameGridObj[_local5][_local6].getSpeed()), gameGridObj[_local5][_local6].gotoY) > ((LEVEL_CLEARANCE * 32) + 100))))) && ((allLanded == 0)))){
sfxManager.get("splash").play(0.7);
};
gameGridObj[_local5][_local6].updateSpeed();
gameGridObj[_local5][_local6].theY = Math.min((gameGridObj[_local5][_local6].theY + gameGridObj[_local5][_local6].getSpeed()), gameGridObj[_local5][_local6].gotoY);
floatYArr[_local5][_local6].set(gameGridObj[_local5][_local6].theY);
gameGridObj[_local5][_local6].animAt = ((gameGridObj[_local5][_local6].animAt + gameGridObj[_local5][_local6].animSpeed) % gameGridObj[_local5][_local6].animLength);
if (gameGridObj[_local5][_local6].theY == gameGridObj[_local5][_local6].gotoY){
floatYArr[_local5][_local6].set(gameGridObj[_local5][_local6].theY);
if (((!(gameGridObj[_local5][_local6].firstLand)) && ((allLanded == 0)))){
createDust(gameGridObj[_local5][_local6]);
};
gameGridObj[_local5][_local6].land();
allLanded = Math.max((allLanded - 1), 0);
if (gameGridObj[_local5][_local6].targetID > 0){
gameGridObj[_local5][_local6].rotDeg = (Math.round(((gameGridObj[_local5][_local6].rotation / 360) * 4)) * 90);
gameGridObj[_local5][_local6].animAt = ((Number(((Math.round((((gameGridObj[_local5][_local6].animAt % 20) / 20) * 4)) * 5) + 1)) % 20) * 3);
};
if (gameGridObj[_local5][_local6].running){
checkForExplosion(gameGridObj[_local5][_local6]);
} else {
gameGridObj[_local5][_local6].running = true;
};
collapsing--;
if (shotSound){
sfxManager.get("knock").play(0.1);
shotSound = false;
};
if (collapsing == 0){
if (collapsing == 0){
consecutive = 0;
checkForCoin();
if (checkForCleared()){
endAnims(true);
};
};
};
};
} else {
gameGridObj[_local5][_local6].delay--;
_local7 = false;
};
};
};
};
_local6++;
};
_local5++;
};
_local5 = 0;
while (_local5 < scoreArr.length) {
_local7 = false;
if (scoreArr[_local5].delay == 0){
scoreArr[_local5].animAt++;
if (scoreArr[_local5].animAt == scoreArr[_local5].animLength){
removeChild(scoreArr[_local5]);
scoreArr.splice(_local5, 1);
_local5--;
};
} else {
scoreArr[_local5].delay--;
if ((((scoreArr[_local5].delay == 0)) && (scoreArr[_local5].endScore))){
sfxManager.get("bonusScore").play(0.3);
};
};
_local5++;
};
_local5 = 0;
while (_local5 < splashArr.length) {
_local7 = false;
splashArr[_local5].animAt++;
if (splashArr[_local5].animAt == 18){
removeChild(splashArr[_local5]);
splashArr.splice(_local5, 1);
_local5--;
};
_local5++;
};
_local5 = 0;
while (_local5 < dustArr.length) {
_local7 = false;
dustArr[_local5].animAt++;
if (dustArr[_local5].animAt == dustArr[_local5].animLength){
removeChild(dustArr[_local5]);
dustArr.splice(_local5, 1);
_local5--;
};
_local5++;
};
_local5 = 0;
while (_local5 < visualExplArr.length) {
_local7 = false;
if (visualExplArr[_local5].delay > 0){
visualExplArr[_local5].delay--;
} else {
visualExplArr[_local5].animAt++;
if (visualExplArr[_local5].animAt >= visualExplArr[_local5].animLength){
removeChild(visualExplArr[_local5]);
visualExplArr.splice(_local5, 1);
_local5--;
};
};
_local5++;
};
_local5 = 0;
while (_local5 < bubbleAnimArr.length) {
bubbleAnimArr[_local5].animAt++;
if (bubbleAnimArr[_local5].animAt == bubbleAnimArr[_local5].animLength){
removeChild(bubbleAnimArr[_local5]);
bubbleAnimArr.splice(_local5, 1);
_local5--;
};
_local5++;
};
if (_local7){
gameRoot.mcQuit.visible = false;
if (checkForCleared()){
if (bonusShown){
endRound(cleared_, bonusScore_);
} else {
bonusScorePops();
};
bonusShown = true;
} else {
endRound(false, 0);
};
};
break;
case STATE_NOT_RUNNING:
break;
};
if (relaxMode){
if ((((((food == 0)) && ((collapsing == 0)))) && ((explodeCounter == 0)))){
if (!gameRoot.mcRelaxGameOver.visible){
gameRoot.mcRelaxGameOver.drop();
};
if (--endDelay == 0){
endRound(false, 0);
};
};
if (food < 6){
gameRoot.foodLeftTxt.visible = true;
gameRoot.foodLeftTxt.text = ("" + food);
} else {
if (gameRoot.foodLeftTxt.visible){
gameRoot.foodLeftTxt.visible = false;
};
};
};
}
public function render(_arg1:Number, _arg2:Number):void{
var _local3:*;
var _local4:int;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
if (gameRoot.waterEffect){
updateWater(_arg1);
} else {
if (waterBaseBitmap != null){
gameRoot.mcWater.removeChild(waterBaseBitmap);
waterBaseBitmap = null;
clearLevel.alpha = 0.4;
_local3 = 0;
while (_local3 < waveArr.length) {
waveArr[_local3].alpha = 1;
_local3++;
};
doBubbles = false;
};
};
if (relaxMode){
_local4 = (0 | (28 * (1 - (Math.min(FOOD_LIMIT, food) / FOOD_LIMIT))));
gameRoot.mcRelaxModeMeter.gotoAndStop((_local4 + 1));
};
switch (gameState){
case STATE_RUNNING:
_local5 = Math.floor((timeLeft / 25));
_local6 = Math.floor((_local5 / 60));
_local7 = (_local5 - (_local6 * 60));
_local8 = "";
if (_local7 < 10){
_local8 = "0";
};
setClockNum((((("0" + _local6) + ":") + _local8) + _local7));
slider.y = slider.theY;
slider.x = sliderFloat.get(_arg2);
nextPiece.rotation = (nextPiece.rotation + rotFloat.get(_arg2));
nextPiece.x = (sliderFloat.get(_arg2) + nextPieceFloatX.get(_arg2));
nextPiece.y = (slider.y + nextPieceFloatY.get(_arg2));
nextPiece.scaleX = nextPieceFloatScaleX.get(_arg2);
nextPiece.scaleY = nextPieceFloatScaleY.get(_arg2);
switchPiece.x = ((sliderFloat.get(_arg2) + 20) + switchPieceFloatX.get(_arg2));
switchPiece.y = (slider.y + switchPieceFloatY.get(_arg2));
switchPiece.scaleX = switchPieceFloatScaleX.get(_arg2);
switchPiece.scaleY = switchPieceFloatScaleY.get(_arg2);
slider.mcLeft.gotoAndStop(slider.animAt);
slider.mcRight.gotoAndStop(slider.animAt);
if (nextPiece.isBomb){
nextPiece.target.mcBomb.gotoAndStop(nextPiece.bombAnim);
};
if (nextPiece.isLineBlast){
nextPiece.target.mcLineBlast.gotoAndStop(nextPiece.lineBlastAnim);
};
if (switchPiece.isBomb){
switchPiece.target.mcBomb.gotoAndStop(switchPiece.bombAnim);
};
if (switchPiece.isLineBlast){
switchPiece.target.mcLineBlast.gotoAndStop(switchPiece.lineBlastAnim);
};
_local3 = 0;
while (_local3 < gameGridObj.length) {
_local9 = 0;
while (_local9 < gameGridObj[_local3].length) {
if (gameGridObj[_local3][_local9] != null){
if (explodeCounter == 0){
if (gameGridObj[_local3][_local9].y != gameGridObj[_local3][_local9].gotoY){
if ((((gameGridObj[_local3][_local9].y < (115 + (32 * LEVEL_CLEARANCE)))) && ((floatYArr[_local3][_local9].get(_arg2) > (115 + (32 * LEVEL_CLEARANCE)))))){
createSplash(gameGridObj[_local3][_local9].x);
};
gameGridObj[_local3][_local9].y = floatYArr[_local3][_local9].get(_arg2);
gameGridObj[_local3][_local9].rotation = gameGridObj[_local3][_local9].rotDeg;
if (gameGridObj[_local3][_local9].target.mcBall != null){
gameGridObj[_local3][_local9].target.mcBall.gotoAndStop(Math.round((gameGridObj[_local3][_local9].animAt / 3)));
};
};
};
if (gameGridObj[_local3][_local9].isCoin){
if (gameGridObj[_local3][_local9].target.mcBall != null){
gameGridObj[_local3][_local9].target.mcBall.gotoAndStop(gameGridObj[_local3][_local9].animAt);
};
};
if (gameGridObj[_local3][_local9].isBomb){
gameGridObj[_local3][_local9].target.mcBomb.gotoAndStop(gameGridObj[_local3][_local9].bombAnim);
};
if (gameGridObj[_local3][_local9].isLineBlast){
gameGridObj[_local3][_local9].target.mcLineBlast.gotoAndStop(gameGridObj[_local3][_local9].lineBlastAnim);
};
};
_local9++;
};
_local3++;
};
_local3 = 0;
while (_local3 < scoreArr.length) {
scoreArr[_local3].gotoAndStop(scoreArr[_local3].animAt);
_local3++;
};
_local3 = 0;
while (_local3 < splashArr.length) {
splashArr[_local3].gotoAndStop(splashArr[_local3].animAt);
_local3++;
};
_local3 = 0;
while (_local3 < dustArr.length) {
dustArr[_local3].gotoAndStop(dustArr[_local3].animAt);
_local3++;
};
_local3 = 0;
while (_local3 < visualExplArr.length) {
visualExplArr[_local3].target.gotoAndStop(visualExplArr[_local3].animAt);
_local3++;
};
_local3 = 0;
while (_local3 < bubbleAnimArr.length) {
bubbleAnimArr[_local3].gotoAndStop(bubbleAnimArr[_local3].animAt);
_local3++;
};
break;
case STATE_END_ANIMS:
_local10 = true;
_local3 = 0;
while (_local3 < gameGridObj.length) {
_local9 = 0;
while (_local9 < gameGridObj[_local3].length) {
if (gameGridObj[_local3][_local9] != null){
if (explodeCounter == 0){
if (gameGridObj[_local3][_local9].y != gameGridObj[_local3][_local9].gotoY){
if ((((gameGridObj[_local3][_local9].y < (115 + (32 * LEVEL_CLEARANCE)))) && ((floatYArr[_local3][_local9].get(_arg2) > (115 + (32 * LEVEL_CLEARANCE)))))){
createSplash(gameGridObj[_local3][_local9].x);
};
gameGridObj[_local3][_local9].y = floatYArr[_local3][_local9].get(_arg2);
gameGridObj[_local3][_local9].rotation = gameGridObj[_local3][_local9].rotDeg;
if (gameGridObj[_local3][_local9].target.mcBall != null){
gameGridObj[_local3][_local9].target.mcBall.gotoAndStop(Math.round((gameGridObj[_local3][_local9].animAt / 3)));
};
};
};
if (gameGridObj[_local3][_local9].isCoin){
if (gameGridObj[_local3][_local9].target.mcBall != null){
gameGridObj[_local3][_local9].target.mcBall.gotoAndStop(gameGridObj[_local3][_local9].animAt);
};
};
if (gameGridObj[_local3][_local9].isBomb){
gameGridObj[_local3][_local9].target.mcBomb.gotoAndStop(gameGridObj[_local3][_local9].bombAnim);
};
if (gameGridObj[_local3][_local9].isLineBlast){
gameGridObj[_local3][_local9].target.mcLineBlast.gotoAndStop(gameGridObj[_local3][_local9].lineBlastAnim);
};
};
_local9++;
};
_local3++;
};
_local3 = 0;
while (_local3 < scoreArr.length) {
scoreArr[_local3].gotoAndStop(scoreArr[_local3].animAt);
_local3++;
};
_local3 = 0;
while (_local3 < splashArr.length) {
splashArr[_local3].gotoAndStop(splashArr[_local3].animAt);
_local3++;
};
_local3 = 0;
while (_local3 < dustArr.length) {
dustArr[_local3].gotoAndStop(dustArr[_local3].animAt);
_local3++;
};
_local3 = 0;
while (_local3 < visualExplArr.length) {
visualExplArr[_local3].target.gotoAndStop(visualExplArr[_local3].animAt);
_local3++;
};
_local3 = 0;
while (_local3 < bubbleAnimArr.length) {
bubbleAnimArr[_local3].gotoAndStop(bubbleAnimArr[_local3].animAt);
_local3++;
};
break;
};
}
public function updateWater(_arg1:Number){
var _local2:Number;
var _local3:int;
var _local4:Number;
var _local5:Number;
if (waterBaseBitmapData != null){
waterBaseBitmap.visible = false;
distortBitmap.draw(gameRoot, new Matrix(1, 0, 0, 1, 0, -437));
waterBaseBitmap.visible = true;
_local2 = (getTimer() / 200);
_local3 = 0;
while (_local3 < 200) {
_local4 = (Math.sin(((_local3 / 7) + _local2)) * 4);
_local4 = (_local4 + (Math.sin(((_local3 / 5) + (_local2 / 1.74))) * 2));
_local5 = (Math.sin(((_local3 / 10) + _local2)) * 2);
_local5 = (_local5 + (Math.sin(((_local3 / 17) + (_local2 / 1.4))) * 1));
waterBaseBitmapData.copyPixels(distortBitmap, new Rectangle(0, (_local3 + int((_local5 * 0.4))), 755, 1), new Point(int((_local4 * 0.4)), _local3));
_local3++;
};
};
}
public function createBubbleAnim(){
var _local1:* = new BubbleAnim();
bubbleAnimArr.push(_local1);
addChild(_local1);
}
public function switchBalls(_arg1:KeyboardEvent){
if ((((((collapsing == 0)) && ((slider.switchAnimAt == 1)))) && ((slider.animAt == 1)))){
if (_arg1.keyCode == 32){
communicator.switchBalls((currentTick + 1));
sfxManager.get("switch").play(1);
if (slider.switchAnimAt == 1){
slider.switchAnimAt = 2;
slider.animAt = 14;
};
};
};
}
public function switchBallsAnim(_arg1:Number){
var _local2:*;
var _local3:*;
var _local4:*;
switch (_arg1){
case 2:
nextPiece.theY = (nextPiece.theY + -4);
nextPiece.theX = (nextPiece.theX + 16);
nextPiece.scaleX = (nextPiece.scaleX + 0.3);
nextPiece.scaleY = (nextPiece.scaleY + 0.3);
switchPiece.theY = (switchPiece.theY + 4);
switchPiece.theX = (switchPiece.theX + -16);
break;
case 3:
nextPiece.theY = (nextPiece.theY + -4);
nextPiece.theX = (nextPiece.theX + 20);
nextPiece.scaleX = (nextPiece.scaleX + 0.3);
nextPiece.scaleY = (nextPiece.scaleY + 0.3);
switchPiece.theY = (switchPiece.theY + 4);
switchPiece.theX = (switchPiece.theX + -20);
break;
case 4:
nextPiece.theY = (nextPiece.theY + -4);
nextPiece.theX = (nextPiece.theX + 20);
nextPiece.scaleX = (nextPiece.scaleX + -0.3);
nextPiece.scaleY = (nextPiece.scaleY + -0.3);
switchPiece.theY = (switchPiece.theY + 4);
switchPiece.theX = (switchPiece.theX + -20);
break;
case 5:
slider.animAt = 1;
nextPiece.theY = 10;
nextPiece.theX = 0;
nextPiece.scaleX = (nextPiece.scaleX + -0.3);
nextPiece.scaleY = (nextPiece.scaleY + -0.3);
switchPiece.theY = -4;
switchPiece.theX = 50;
_local2 = switchPiece.type;
_local3 = switchPiece.isBomb;
_local4 = switchPiece.isLineBlast;
switchPiece.switchType(nextPiece.type, nextPiece.isBomb, nextPiece.isLineBlast);
nextPiece.switchType(_local2, _local3, _local4);
switchPieceFloatX.set(switchPiece.theX);
switchPieceFloatY.set(switchPiece.theY);
nextPieceFloatX.set(nextPiece.theX);
nextPieceFloatY.set(nextPiece.theY);
slider.switchAnimAt = 0;
break;
};
switchPieceFloatX.set(switchPiece.theX);
switchPieceFloatY.set(switchPiece.theY);
nextPieceFloatX.set(nextPiece.theX);
nextPieceFloatY.set(nextPiece.theY);
}
public function reloadAnim(_arg1:Number, _arg2){
switchPiece.rotation = (switchPiece.rotation - 25);
if (_arg2 > 0){
switch (_arg1){
case 1:
switchPiece.theY = (switchPiece.theY + -5);
switchPiece.theX = (switchPiece.theX + -1);
break;
case 2:
switchPiece.theY = (switchPiece.theY + -5);
switchPiece.theX = (switchPiece.theX + -1);
break;
case 3:
switchPiece.theY = (switchPiece.theY + -4);
switchPiece.theX = (switchPiece.theX + -1);
break;
case 4:
switchPiece.theY = (switchPiece.theY + -4);
switchPiece.theX = (switchPiece.theX + -1);
break;
case 5:
switchPiece.theY = (switchPiece.theY + -4);
switchPiece.theX = (switchPiece.theX + -1);
break;
case 6:
switchPiece.theY = (switchPiece.theY + -4);
switchPiece.theX = (switchPiece.theX + -5);
break;
case 7:
switchPiece.theY = (switchPiece.theY + -4);
switchPiece.theX = (switchPiece.theX + -7);
break;
};
} else {
switch (_arg1){
case 8:
switchPiece.theY = (switchPiece.theY + 0);
switchPiece.theX = (switchPiece.theX + -9);
break;
case 7:
switchPiece.theY = (switchPiece.theY + 0);
switchPiece.theX = (switchPiece.theX + -10);
break;
case 6:
switchPiece.theY = (switchPiece.theY + 2);
switchPiece.theX = (switchPiece.theX + -9);
break;
case 5:
switchPiece.theY = (switchPiece.theY + 4);
switchPiece.theX = (switchPiece.theX + -9);
break;
case 4:
switchPiece.theY = (switchPiece.theY + 10);
switchPiece.theX = (switchPiece.theX + -8);
break;
case 3:
switchPiece.theY = (switchPiece.theY + 16);
switchPiece.theX = (switchPiece.theX + -8);
break;
case 2:
switchPiece.theY = 10;
switchPiece.theX = -20;
switchPieceFloatX.set(switchPiece.theX);
switchPieceFloatY.set(switchPiece.theY);
break;
};
};
switchPieceFloatX.set(switchPiece.theX);
switchPieceFloatY.set(switchPiece.theY);
}
public function createSplash(_arg1){
var _local2:* = new Splash();
splashArr.push(_local2);
_local2.animAt = 1;
_local2.y = ((115 + (32 * LEVEL_CLEARANCE)) - 117);
_local2.x = (_arg1 - 80);
addChild(_local2);
}
public function startRound(_arg1, _arg2, _arg3, _arg4, _arg5){
var _local6:*;
var _local7:*;
communicator = _arg5;
this.level = _arg1;
gameRoot = _arg2;
currentTick = _arg3;
bonusShown = false;
endDelay = (25 * 2);
communicator.startRound((currentTick + 1));
theme = 0;
if (_arg1 > 1){
if ((startTime - timeLeft) < (25 * 25)){
theme = Math.round((Math.random() + 1));
};
};
startTime = timeLeft;
gameRoot.mcFG.gotoAndStop((theme + 1));
gameRoot.mcTopFG.gotoAndStop((theme + 1));
gameGridObj = new Array();
pieceStack = new Array();
floatYArr = new Array();
scoreArr = new Array();
waveArr = new Array();
splashArr = new Array();
visualExplArr = new Array();
bubbleAnimArr = new Array();
dustArr = new Array();
makeLineBlast_ = false;
noOfTypes = 4;
collapsing = 0;
slider = new Slider();
addChild(slider);
sliderFloat = new IFloat(slider.theX);
rotFloat = new IFloat(0);
createPieceRolling();
consecutive = 0;
cleared_ = false;
bonusScore_ = 0;
if (_arg1 == 1){
if (waterBaseBitmap != null){
gameRoot.mcWater.removeChild(waterBaseBitmap);
};
waterBaseBitmapData = new BitmapData(755, (32 * (14 - LEVEL_CLEARANCE)), true, 0);
waterBaseBitmap = new Bitmap(waterBaseBitmapData);
waterBaseBitmap.y = (117 + (32 * LEVEL_CLEARANCE));
gameRoot.mcWater.addChild(waterBaseBitmap);
clearLevel = new ClearLevel();
clearLevel.y = (115 + (32 * LEVEL_CLEARANCE));
clearLevel.x = 0;
clearLevel.alpha = 0.2;
gameRoot.mcWater.mouseEnabled = false;
clearLevel.mouseEnabled = false;
_local6 = 0;
while (_local6 < 23) {
_local7 = new WaterLevelPiece();
waveArr.push(_local7);
_local7.y = (115 + (32 * LEVEL_CLEARANCE));
_local7.x = (_local6 * 34);
_local7.alpha = 0.5;
gameRoot.mcWater.addChild(_local7);
_local7.gotoAndStop(3);
_local7.mouseEnabled = false;
_local6++;
};
gameRoot.mcWater.addChild(clearLevel);
musicManager = gameRoot.musicManager;
sfxManager = gameRoot.sfxManager;
gameRoot.mcRelaxModeMeter.visible = relaxMode;
food = FOOD_START;
if (relaxMode){
mcTimeNum2.visible = false;
mcTimeNum3.visible = false;
mcTimeNum4.visible = false;
mcTimeDiv.visible = false;
};
};
pieceXMod = (250 - ((_arg4[0].length - 10) * 16));
createBoard(_arg4);
if (stone1 == null){
stone1 = new Stone1();
stone2 = new Stone2();
addChild(stone1);
addChild(stone2);
};
stone1.x = (pieceXMod - 32);
stone1.y = 548;
stone2.x = ((((gameGridObj[0].length - 1) * 32) + pieceXMod) + 32);
stone2.y = 548;
setLevelNum();
setScoreNum();
if (timeLeft < 250){
sfxManager.get("warning").stop();
sfxManager.get("warning").play(0.7);
};
gameState = STATE_RUNNING;
}
public function setLevelNum(){
var _local1:*;
var _local4:*;
_local1 = 0;
while (_local1 < levelNumArr.length) {
removeChild(levelNumArr[_local1]);
_local1++;
};
levelNumArr = new Array();
var _local2:* = level.toString();
var _local3:* = _local2.split("");
_local1 = 0;
while (_local1 < _local3.length) {
_local4 = new LevelNumbers();
_local4.y = 130;
_local4.x = (10 + ((_local4.width - 13) * _local1));
addChild(_local4);
_local4.gotoAndStop((Number(_local3[_local1]) + 1));
levelNumArr.push(_local4);
_local1++;
};
}
public function setScoreNum(){
var _local1:*;
var _local4:*;
_local1 = 0;
while (_local1 < scoreNumArr.length) {
removeChild(scoreNumArr[_local1]);
_local1++;
};
scoreNumArr = new Array();
var _local2:* = score.toString();
var _local3:* = _local2.split("");
_local1 = 0;
while (_local1 < _local3.length) {
_local4 = new ScoreNumbers();
_local4.y = (70 + _local1);
_local4.x = (5 + ((_local4.width - 7) * _local1));
addChild(_local4);
_local4.gotoAndStop((Number(_local3[_local1]) + 1));
scoreNumArr.push(_local4);
_local1++;
};
}
public function setClockNum(_arg1){
var _local2:* = _arg1.split("");
mcTimeNum2.gotoAndStop((Number(_local2[1]) + 1));
mcTimeNum3.gotoAndStop((Number(_local2[3]) + 1));
mcTimeNum4.gotoAndStop((Number(_local2[4]) + 1));
}
public function createPieceRolling(){
var _local1:* = 999;
var _local2:* = false;
var _local3:* = false;
if (nextPiece != null){
_local1 = switchPiece.type;
_local2 = switchPiece.isBomb;
_local3 = switchPiece.isLineBlast;
removeChild(switchPiece);
};
if (_local1 == 999){
_local1 = getRandom(noOfTypes);
};
if (makeLineBlast_){
makeLineBlast_ = false;
if (!_local2){
_local3 = true;
};
};
var _local4:* = new PieceRolling(slider.theY, slider.theX, _local1, false, theme);
if (_local2){
_local4.makeBomb();
};
if (_local3){
_local4.makeLineBlast();
};
addChild(_local4);
nextPiece = _local4;
var _local5:* = new PieceRolling(slider.theY, slider.theX, getRandom(noOfTypes), true, theme);
addChild(_local5);
switchPiece = _local5;
nextPieceFloatX = new IFloat(nextPiece.theX);
nextPieceFloatY = new IFloat(nextPiece.theY);
nextPieceFloatScaleX = new IFloat(1);
nextPieceFloatScaleY = new IFloat(1);
switchPieceFloatX = new IFloat(switchPiece.theX);
switchPieceFloatY = new IFloat(switchPiece.theY);
switchPieceFloatScaleX = new IFloat(1);
switchPieceFloatScaleY = new IFloat(1);
}
public function createBoard(_arg1:Array){
var _local2:*;
var _local4:Array;
var _local7:*;
var _local8:Array;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:*;
var _local13:*;
var _local14:Array;
var _local15:*;
var _local3:* = false;
while (!(_local3)) {
_local2 = 0;
_local4 = new Array();
_local7 = 0;
while (_local7 < _arg1.length) {
_local8 = new Array();
_local9 = 0;
while (_local9 < _arg1[_local7].length) {
if (_arg1[_local7][_local9] == 1){
if ((((level > 2)) && ((getLevelRandom(100) < level)))){
_local10 = 9;
} else {
_local10 = getLevelRandom(noOfTypes);
};
_local8.push(_local10);
_local2++;
} else {
_local8.push(null);
};
_local9++;
};
_local4.push(_local8);
_local7++;
};
_local3 = true;
};
var _local5:* = (getLevelRandom(3) + 1);
var _local6:* = new Array();
_local7 = 0;
while (_local7 < _local5) {
_local11 = false;
_local12 = getLevelRandom(_local4[0].length);
_local9 = 0;
while (_local9 < _local6.length) {
if (_local6[_local9] == _local12){
_local11 = true;
};
_local9++;
};
if (!_local11){
_local13 = 0;
while (_local13 < _local4.length) {
if (_local4[_local13][_local12] != null){
if (_local13 > LEVEL_CLEARANCE){
_local7--;
_local13 = (_local4.length + 1);
} else {
_local6.push(_local12);
_local4[_local13][_local12] = 10;
_local13 = (_local4.length + 1);
};
};
_local13++;
};
} else {
_local7--;
};
_local7++;
};
_local7 = 0;
while (_local7 < _local4.length) {
_local8 = new Array();
_local14 = new Array();
_local9 = 0;
while (_local9 < _local4[_local7].length) {
if (_local4[_local7][_local9] != null){
allLanded++;
_local15 = createPiece(_local7, _local9, _local4[_local7][_local9], false, false, false, 0);
_local15.delay = _local2;
addChild(_local15);
_local14.push(new IFloat(_local15.theY));
_local2--;
collapsing++;
_local8.push(_local15);
} else {
_local8.push(null);
_local14.push(null);
};
_local9++;
};
floatYArr.push(_local14);
gameGridObj.push(_local8);
_local7++;
};
}
public function testBoardPlace(_arg1:Array, _arg2, _arg3:Number, _arg4:Number, _arg5:Number){
var _local6:*;
if ((((_arg3 > 0)) && (!((_arg5 == 0))))){
_local6 = _arg1[(_arg3 - 1)][_arg4];
if (((!((_local6 == null))) && ((_local6 == _arg2)))){
boardMatchNum++;
if (boardMatchNum < 3){
testBoardPlace(_arg1, _local6, (_arg3 - 1), _arg4, 1);
};
};
};
if ((((_arg3 < (_arg1.length - 1))) && (!((_arg5 == 1))))){
_local6 = _arg1[(_arg3 + 1)][_arg4];
if (((!((_local6 == null))) && ((_local6 == _arg2)))){
boardMatchNum++;
if (boardMatchNum < 3){
testBoardPlace(_arg1, _local6, (_arg3 + 1), _arg4, 0);
};
};
};
if ((((_arg4 > 0)) && (!((_arg5 == 2))))){
_local6 = _arg1[_arg3][(_arg4 - 1)];
if (((!((_local6 == null))) && ((_local6 == _arg2)))){
boardMatchNum++;
if (boardMatchNum < 3){
testBoardPlace(_arg1, _local6, _arg3, (_arg4 - 1), 3);
};
};
};
if ((((_arg4 < (_arg1[_arg3].length - 1))) && (!((_arg5 == 3))))){
_local6 = _arg1[_arg3][(_arg4 + 1)];
if (((!((_local6 == null))) && ((_local6 == _arg2)))){
boardMatchNum++;
if (boardMatchNum < 3){
testBoardPlace(_arg1, _local6, _arg3, (_arg4 + 1), 2);
};
};
};
}
public function testBoard(_arg1:Array){
var _local3:*;
var _local2:* = 0;
while (_local2 < _arg1.length) {
_local3 = 0;
while (_local3 < _arg1[_local2].length) {
if (_arg1[_local2][_local3] != null){
boardMatchNum = 0;
testBoardPlace(_arg1, _arg1[_local2][_local3], _local2, _local3, 9999);
if (boardMatchNum > 2){
return (false);
};
};
_local3++;
};
_local2++;
};
return (true);
}
public function checkForExplosion(_arg1:Piece){
var _local4:*;
var _local2:* = false;
if (_arg1 != null){
if (!_arg1.cfe){
explArr = new Array();
testPiece(_arg1);
if (explArr.length > 3){
_local2 = true;
calcScore(explArr);
explodeBoard(explArr, 10);
consecutive++;
if (consecutive < 5){
sfxManager.get(("combo" + consecutive)).play(0.5);
} else {
sfxManager.get("combo5").play(0.5);
};
if (consecutive == 3){
makeBomb();
};
};
};
};
var _local3:* = 0;
while (_local3 < gameGridObj.length) {
_local4 = 0;
while (_local4 < gameGridObj[_local3].length) {
if (gameGridObj[_local3][_local4] != null){
gameGridObj[_local3][_local4].cfe = false;
};
_local4++;
};
_local3++;
};
if (_local2){
collapseBoard();
};
}
public function testPiece(_arg1:Piece){
var _local2:*;
if (_arg1.type < 9){
explArr.push(_arg1);
_arg1.cfe = true;
if (_arg1.yPos > 0){
_local2 = gameGridObj[(_arg1.yPos - 1)][_arg1.xPos];
if (((((!((_local2 == null))) && (!(_local2.cfe)))) && ((_local2.type == _arg1.type)))){
testPiece(_local2);
};
};
if (_arg1.yPos < (gameGridObj.length - 1)){
_local2 = gameGridObj[(_arg1.yPos + 1)][_arg1.xPos];
if (((((!((_local2 == null))) && (!(_local2.cfe)))) && ((_local2.type == _arg1.type)))){
testPiece(_local2);
};
};
if (_arg1.xPos > 0){
_local2 = gameGridObj[_arg1.yPos][(_arg1.xPos - 1)];
if (((((!((_local2 == null))) && (!(_local2.cfe)))) && ((_local2.type == _arg1.type)))){
testPiece(_local2);
};
};
if (_arg1.xPos < (gameGridObj[_arg1.yPos].length - 1)){
_local2 = gameGridObj[_arg1.yPos][(_arg1.xPos + 1)];
if (((((!((_local2 == null))) && (!(_local2.cfe)))) && ((_local2.type == _arg1.type)))){
testPiece(_local2);
};
};
};
}
public function explodeBoard(_arg1, _arg2){
if (_arg1.length > 5){
makeLineBlast();
};
var _local3:* = 999;
var _local4:* = false;
var _local5:* = 0;
while (_local5 < _arg1.length) {
if (_arg1[_local5].collapsing){
collapsing--;
};
if (_arg1[_local5].isBomb){
_local3 = _arg1[_local5].type;
score = (score + 200);
createScorePop(200, _arg1[_local5].theY, _arg1[_local5].x, 0, 0, false);
};
if (_arg1[_local5].isLineBlast){
lineBlast(_arg1[_local5].yPos, _arg1[_local5].xPos, _arg1);
};
createExplosion(_arg1[_local5], _arg2);
gameGridObj[_arg1[_local5].yPos][_arg1[_local5].xPos] = null;
floatYArr[_arg1[_local5].yPos][_arg1[_local5].xPos] = null;
removeChild(_arg1[_local5]);
_local5++;
};
if (_local3 != 999){
colorBomb(_local3);
};
}
public function createExplosion(_arg1, _arg2){
var _local3:* = new Explosion(_arg1.x, _arg1.theY, 0, _arg2);
visualExplArr.push(_local3);
addChild(_local3);
}
public function createLineExplosion(_arg1, _arg2, _arg3){
sfxManager.get("lineBlast").play(0.2);
var _local4:* = new Explosion(_arg2, _arg1, _arg3, 20);
visualExplArr.push(_local4);
addChild(_local4);
}
public function colorBomb(_arg1:Number){
var _local4:*;
sfxManager.get("colorBomb").play(0.6);
var _local2:* = new Array();
var _local3:* = 0;
while (_local3 < gameGridObj.length) {
_local4 = 0;
while (_local4 < gameGridObj[_local3].length) {
if (((!((gameGridObj[_local3][_local4] == null))) && ((gameGridObj[_local3][_local4].type == _arg1)))){
_local2.push(gameGridObj[_local3][_local4]);
};
_local4++;
};
_local3++;
};
explodeBoard(_local2, _arg1);
}
public function lineBlast(_arg1:Number, _arg2:Number, _arg3:Array){
var _local5:*;
var _local6:*;
var _local7:*;
var _local4:* = 0;
_local5 = (_arg2 + 1);
while (_local5 < gameGridObj[_arg1].length) {
_local4++;
createLineExplosion(((_arg1 * 32) + 100), ((_local5 * 32) + pieceXMod), _local4);
if (((!((gameGridObj[_arg1][_local5] == null))) && ((gameGridObj[_arg1][_local5].type == 9)))){
numBlack++;
score = (score + 300);
createScorePop(300, gameGridObj[_arg1][_local5].theY, gameGridObj[_arg1][_local5].x, 1, 0, false);
} else {
if (gameGridObj[_arg1][_local5] != null){
score = (score + 150);
createScorePop(150, gameGridObj[_arg1][_local5].theY, gameGridObj[_arg1][_local5].x, 0, 0, false);
};
};
_local5++;
};
_local4 = 0;
_local5 = (_arg2 - 1);
while (_local5 >= 0) {
_local4++;
createLineExplosion(((_arg1 * 32) + 100), ((_local5 * 32) + pieceXMod), _local4);
if (((!((gameGridObj[_arg1][_local5] == null))) && ((gameGridObj[_arg1][_local5].type == 9)))){
numBlack++;
score = (score + 300);
createScorePop(300, gameGridObj[_arg1][_local5].theY, gameGridObj[_arg1][_local5].x, 1, 0, false);
} else {
if (gameGridObj[_arg1][_local5] != null){
score = (score + 150);
createScorePop(150, gameGridObj[_arg1][_local5].theY, gameGridObj[_arg1][_local5].x, 0, 0, false);
};
};
_local5--;
};
_local5 = 0;
while (_local5 < gameGridObj[_arg1].length) {
if (gameGridObj[_arg1][_local5] != null){
_local6 = false;
_local7 = 0;
while (_local7 < _arg3.length) {
if (_arg3[_local7] == gameGridObj[_arg1][_local5]){
_local6 = true;
};
_local7++;
};
if (!_local6){
if (gameGridObj[_arg1][_local5].collapsing){
collapsing--;
};
removeChild(gameGridObj[_arg1][_local5]);
gameGridObj[_arg1][_local5] = null;
};
};
_local5++;
};
setScoreNum();
}
public function collapseBoard(){
var _local3:*;
var _local4:*;
var _local1:* = 0;
var _local2:* = (gameGridObj.length - 1);
while (_local2 >= 0) {
_local3 = 0;
while (_local3 < gameGridObj[_local2].length) {
if (gameGridObj[_local2][_local3] == null){
_local4 = (_local2 - 1);
while (_local4 >= 0) {
if (gameGridObj[_local4][_local3] != null){
gameGridObj[_local2][_local3] = gameGridObj[_local4][_local3];
gameGridObj[_local2][_local3].updatePos(_local2, _local3);
gameGridObj[_local4][_local3] = null;
floatYArr[_local2][_local3] = floatYArr[_local4][_local3];
floatYArr[_local4][_local3] = null;
gameGridObj[_local2][_local3].delay = 0;
if (!gameGridObj[_local2][_local3].collapsing){
collapsing++;
};
gameGridObj[_local2][_local3].collapsing = true;
_local4 = -1;
};
_local4--;
};
};
_local3++;
};
_local2--;
};
}
public function calcScore(_arg1){
var _local2:* = (1 + (consecutive * 0.5));
var _local3:* = (Math.min((100 + ((_arg1.length - 4) * 50)), 250) * _arg1.length);
_local3 = (_local3 * _local2);
_local3 = Math.round(((1 + ((level - 1) / 10)) * _local3));
createScorePop(_local3, _arg1[0].theY, _arg1[0].x, 0, 0, false);
score = (score + _local3);
setScoreNum();
communicator.sendScore(currentTick, score, _local3, _arg1.length);
}
public function createScorePop(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6){
var _local7:* = new ScorePop(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
addChild(_local7);
scoreArr.push(_local7);
}
public function shootBall(_arg1:Event){
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
if (gameState == STATE_RUNNING){
if ((((((collapsing == 0)) && ((slider.switchAnimAt == 1)))) && ((slider.animAt == 1)))){
shotSound = true;
if (food == 0){
return;
};
if (relaxMode){
food--;
if (food < 0){
food = 0;
};
};
_local2 = Math.min(Math.round(((slider.theX - pieceXMod) / 32)), 15);
communicator.shootBall((currentTick + 1), _local2);
_local4 = (gameGridObj.length - 1);
while (_local4 >= 0) {
if (gameGridObj[_local4][_local2] == null){
_local3 = _local4;
_local4 = -1;
};
_local4--;
};
if ((((gameState == STATE_RUNNING)) && ((gameGridObj[0][_local2] == null)))){
_local5 = createPiece(_local3, _local2, nextPiece.type, nextPiece.isBomb, nextPiece.isLineBlast, true, nextPiece.rotation);
addChild(_local5);
gameGridObj[_local3][_local2] = _local5;
floatYArr[_local3][_local2] = new IFloat(_local5.theY);
collapsing++;
removeChild(nextPiece);
slider.animAt = 2;
reloadAnim(1, 1);
};
};
};
}
public function makeBomb(){
if (((!(nextPiece.isBomb)) && (!(nextPiece.isLineBlast)))){
nextPiece.makeBomb();
} else {
switchPiece.makeBomb();
};
}
public function makeLineBlast(){
if (((!(nextPiece.isBomb)) && (!(nextPiece.isLineBlast)))){
if (slider.animAt != 1){
makeLineBlast_ = true;
} else {
nextPiece.makeLineBlast();
};
} else {
if (((!(switchPiece.isBomb)) && (!(switchPiece.isLineBlast)))){
switchPiece.makeLineBlast();
};
};
}
public function createPiece(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7){
if (_arg3 == undefined){
trace("its undefed");
_arg3 = getLevelRandom(noOfTypes);
};
var _local8:* = new Piece(_arg3, _arg1, _arg2, _arg4, _arg5, _arg6, _arg7, pieceXMod, theme);
return (_local8);
}
public function createDust(_arg1){
var _local2:* = new DustAnim();
dustArr.push(_local2);
_local2.x = _arg1.theX;
_local2.y = _arg1.theY;
addChild(_local2);
}
public function checkForCoin(){
var _local3:*;
var _local1:* = false;
var _local2:* = (LEVEL_CLEARANCE + 1);
while (_local2 < gameGridObj.length) {
_local3 = 0;
while (_local3 < gameGridObj[_local2].length) {
if (gameGridObj[_local2][_local3] != null){
if (gameGridObj[_local2][_local3].isCoin){
score = (score + 1000);
if (relaxMode){
food = (food + FOOD_INCREASE);
if (food > FOOD_LIMIT){
food = FOOD_LIMIT;
};
};
createScorePop(1000, gameGridObj[_local2][_local3].theY, gameGridObj[_local2][_local3].x, 2, 0, false);
removeChild(gameGridObj[_local2][_local3]);
gameGridObj[_local2][_local3] = null;
_local1 = true;
};
};
_local3++;
};
_local2++;
};
if (_local1){
collapseBoard();
};
setScoreNum();
}
public function checkForCleared():Boolean{
var _local4:*;
var _local1:* = 0;
var _local2:* = true;
var _local3:* = 0;
while (_local3 < gameGridObj.length) {
_local4 = 0;
while (_local4 < gameGridObj[_local3].length) {
if (_local3 <= LEVEL_CLEARANCE){
if (gameGridObj[_local3][_local4] != null){
_local2 = false;
};
};
_local4++;
};
_local3++;
};
return (_local2);
}
public function endAnims(_arg1:Boolean){
cleared_ = _arg1;
gameState = STATE_END_ANIMS;
}
public function bonusScorePops(){
var _local4:*;
var _local5:*;
var _local6:*;
var _local1:* = 0;
var _local2:* = 0;
var _local3:* = (LEVEL_CLEARANCE + 1);
while (_local3 < gameGridObj.length) {
_local4 = true;
_local5 = 0;
while (_local5 < gameGridObj[_local3].length) {
if (gameGridObj[_local3][_local5] == null){
_local6 = (50 * (_local3 - LEVEL_CLEARANCE));
_local1 = (_local1 + _local6);
var _temp1 = _local2;
_local2 = (_local2 + 1);
createScorePop(_local6, ((_local3 * 32) + 100), ((_local5 * 32) + pieceXMod), 0, _temp1, true);
} else {
_local4 = false;
};
_local5++;
};
if (_local4){
trace("numEmptyRows++");
numEmptyRows++;
};
_local3++;
};
bonusScore_ = _local1;
}
public function endRound(_arg1:Boolean, _arg2:Number){
gameRoot.mcQuit.visible = true;
sfxManager.get("warning").stop();
score = (score + _arg2);
setScoreNum();
if (gameRoot.gameState == 2){
clearBoard();
};
gameState = STATE_NOT_RUNNING;
gameRoot.endRound(_arg1, score, numBlack, numEmptyRows);
}
public function openUserEnd(){
sfxManager.get("warning").stop();
clearBoard();
gameState = STATE_NOT_RUNNING;
gameRoot.endRound(false, score, numBlack, numEmptyRows);
}
public function clearBoard(){
var _local1:*;
var _local2:*;
_local1 = 0;
while (_local1 < gameGridObj.length) {
_local2 = 0;
while (_local2 < gameGridObj[_local1].length) {
if (gameGridObj[_local1][_local2] != null){
removeChild(gameGridObj[_local1][_local2]);
};
_local2++;
};
_local1++;
};
_local1 = 0;
while (_local1 < scoreArr.length) {
removeChild(scoreArr[_local1]);
_local1++;
};
_local1 = 0;
while (_local1 < visualExplArr.length) {
removeChild(visualExplArr[_local1]);
_local1++;
};
_local1 = 0;
while (_local1 < splashArr.length) {
removeChild(splashArr[_local1]);
_local1++;
};
_local1 = 0;
while (_local1 < bubbleAnimArr.length) {
removeChild(bubbleAnimArr[_local1]);
_local1++;
};
_local1 = 0;
while (_local1 < dustArr.length) {
removeChild(dustArr[_local1]);
_local1++;
};
removeChild(stone1);
removeChild(stone2);
stone1 = null;
stone2 = null;
if (contains(nextPiece)){
removeChild(nextPiece);
};
removeChild(slider);
removeChild(switchPiece);
nextPiece = null;
switchPiece = null;
if (gameRoot.waterEffect){
updateWater((currentTick + 1));
};
}
public function getRandom(_arg1:Number){
return (gameRoot.getRandom(_arg1));
}
public function getLevelRandom(_arg1:Number){
return (gameRoot.getLevelRandom(_arg1));
}
}
}//package src
Section 82
//Piece (src.Piece)
package src {
import flash.display.*;
import src.comm.*;
import src.timing.*;
import src.math.*;
import flash.external.*;
import flash.system.*;
import flash.text.*;
public class Piece extends MovieClip {
public var mcBone:MovieClip;
public var mcWood:MovieClip;
public var mcRock:MovieClip;
public var type;
public var yPos;
public var xPos;
public var gotoY;
public var gotoX;
public var theY;
public var theX;
public var delay;// = 0
public var speed;// = 1
public var collapsing;// = true
public var cfe;// = false
public var isBomb;
public var isLineBlast;
public var isCoin;// = false
public var running;// = false
public var animAt;// = 1
public var animLength;// = 60
public var animSpeed;// = 1
public var bombAnim;// = 1
public var bombAnimLength;// = 20
public var lineBlastAnim;// = 1
public var lineBlastAnimLength;// = 10
public var target;
public var rotDeg;
public var targetID;
public var firstLand;// = false
private static var WIDTH = 32;
private static var HEIGHT = 32;
public function Piece(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9){
this.type = _arg1;
this.yPos = _arg2;
this.xPos = _arg3;
this.running = _arg6;
targetID = _arg9;
switch (targetID){
case 0:
target = mcWood;
removeChild(mcRock);
removeChild(mcBone);
break;
case 1:
target = mcRock;
removeChild(mcWood);
removeChild(mcBone);
break;
case 2:
target = mcBone;
removeChild(mcRock);
removeChild(mcWood);
break;
};
isBomb = _arg4;
isLineBlast = _arg5;
if (!isBomb){
target.mcBomb.visible = false;
};
if (!isLineBlast){
target.mcLineBlast.visible = false;
};
if (_arg1 == 10){
isCoin = true;
};
animSpeed = (Math.round((Math.random() * 3)) + 1);
var _local10:* = 0;
if (!_arg6){
_local10 = -60;
};
gotoY = ((_arg2 * HEIGHT) + 100);
gotoX = ((_arg3 * WIDTH) + _arg8);
theY = (40 + _local10);
theX = gotoX;
y = theY;
x = theX;
rotation = (rotDeg = _arg7);
this.delay = delay;
target.gotoAndStop((_arg1 + 1));
}
public function tick(_arg1:Number, _arg2:Number):void{
}
public function render(_arg1:Number, _arg2:Number):void{
}
public function getSpeed(){
return (speed);
}
public function updateSpeed(){
speed = Math.min((speed + 3), 40);
}
public function land(){
speed = 1;
collapsing = false;
firstLand = true;
}
public function updatePos(_arg1, _arg2){
yPos = _arg1;
xPos = _arg2;
gotoY = ((yPos * HEIGHT) + 100);
gotoX = ((xPos * WIDTH) + 250);
}
}
}//package src
Section 83
//PieceRolling (src.PieceRolling)
package src {
import flash.display.*;
import src.comm.*;
import src.timing.*;
import src.math.*;
import flash.external.*;
import flash.system.*;
import flash.text.*;
public class PieceRolling extends MovieClip {
public var mcBone:MovieClip;
public var mcWood:MovieClip;
public var mcRock:MovieClip;
public var type;
public var isBomb;// = false
public var isLineBlast;// = false
public var theY;// = 0
public var theX;// = 0
public var gotoY;
public var gotoX;
public var bombAnim;// = 1
public var bombAnimLength;// = 20
public var lineBlastAnim;// = 1
public var lineBlastAnimLength;// = 10
public var target;
public var targetID;
private static var WIDTH = 32;
private static var HEIGHT = 32;
public function PieceRolling(_arg1, _arg2, _arg3, _arg4, _arg5){
targetID = _arg5;
switch (targetID){
case 0:
target = mcWood;
removeChild(mcRock);
removeChild(mcBone);
break;
case 1:
target = mcRock;
removeChild(mcWood);
removeChild(mcBone);
break;
case 2:
target = mcBone;
removeChild(mcRock);
removeChild(mcWood);
break;
};
if (_arg4){
this.theX = 50;
this.theY = -4;
} else {
this.theY = 10;
this.theX = 0;
};
x = _arg2;
y = _arg1;
gotoX = x;
gotoY = y;
this.type = _arg3;
target.mcBomb.visible = false;
target.mcLineBlast.visible = false;
target.gotoAndStop((_arg3 + 1));
}
public function switchType(_arg1:Number, _arg2:Boolean, _arg3:Boolean){
type = _arg1;
isBomb = _arg2;
isLineBlast = _arg3;
target.mcBomb.visible = isBomb;
target.mcLineBlast.visible = isLineBlast;
target.gotoAndStop((type + 1));
}
public function makeBomb(){
isBomb = true;
target.mcBomb.visible = true;
isLineBlast = false;
target.mcLineBlast.visible = false;
}
public function makeLineBlast(){
isLineBlast = true;
target.mcLineBlast.visible = true;
isBomb = false;
target.mcBomb.visible = false;
}
}
}//package src
Section 84
//RelaxGameOver (src.RelaxGameOver)
package src {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class RelaxGameOver extends MovieClip {
private var dropTime:int;
public function RelaxGameOver(){
visible = false;
}
public function drop(){
if (!visible){
y = -213;
visible = true;
dropTime = -1;
addEventListener(Event.ENTER_FRAME, enterFrame);
};
}
public function enterFrame(_arg1:Event):void{
var _local2:*;
if (!visible){
removeEventListener(Event.ENTER_FRAME, enterFrame);
return;
};
_local2 = getTimer();
if (dropTime == -1){
dropTime = _local2;
};
var _local3:* = (_local2 - dropTime);
if (_local3 < 200){
y = (-213 + ((_local3 / 200) * 213));
} else {
y = 0;
};
rotation = (((180 / Math.PI) * Math.sin((_local2 / 300))) * 0.2);
}
}
}//package src
Section 85
//ScorePop (src.ScorePop)
package src {
import flash.display.*;
import src.comm.*;
import src.timing.*;
import src.math.*;
import flash.external.*;
import flash.system.*;
import flash.text.*;
public class ScorePop extends MovieClip {
public var mcScorePop:MovieClip;
public var animLength;// = 20
public var animAt;// = 1
private var min;// = 50
private var max;// = 1500
public var delay;
public var endScore;
public function ScorePop(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6){
x = _arg3;
y = _arg2;
this.endScore = _arg6;
this.delay = _arg5;
mcScorePop.mcScorePop.mcScore.txtScore.text = _arg1;
var _local7:* = (Math.min(_arg1, max) / max);
this.scaleX = Math.max(_local7, 0.4);
this.scaleY = Math.max(_local7, 0.4);
mcScorePop.mcScorePop.mcScorePopBG.gotoAndStop((_arg4 + 1));
}
}
}//package src
Section 86
//Slider (src.Slider)
package src {
import flash.display.*;
public class Slider extends MovieClip {
public var mcRight:MovieClip;
public var mcLeft:MovieClip;
public var theX;// = 380
public var theY;// = 37
public var animAt;// = 1
public var switchAnimAt;// = 1
public function Slider(){
x = theX;
y = theY;
}
}
}//package src
Section 87
//DM (DM)
package {
import flash.display.*;
public dynamic class DM extends MovieClip {
}
}//package
Section 88
//GameOverScreen (GameOverScreen)
package {
import flash.display.*;
import flash.text.*;
public dynamic class GameOverScreen extends MovieClip {
public var txtGameOverHeader:TextField;
public var mcScoreText:MovieClip;
public var mcScoreTextLabel:MovieClip;
public var mcTrophies:MovieClip;
public function GameOverScreen(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 89
//LevelNumbers (LevelNumbers)
package {
import flash.display.*;
public dynamic class LevelNumbers extends MovieClip {
public function LevelNumbers(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 90
//Play (Play)
package {
import flash.display.*;
public dynamic class Play extends MovieClip {
}
}//package
Section 91
//ScoreNumbers (ScoreNumbers)
package {
import flash.display.*;
public dynamic class ScoreNumbers extends MovieClip {
public function ScoreNumbers(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 92
//SignupScreen (SignupScreen)
package {
import flash.display.*;
public dynamic class SignupScreen extends MovieClip {
public var mcInner:MovieClip;
public function SignupScreen(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 93
//Splash (Splash)
package {
import flash.display.*;
public dynamic class Splash extends MovieClip {
public function Splash(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 94
//Stone1 (Stone1)
package {
import flash.display.*;
public dynamic class Stone1 extends MovieClip {
}
}//package
Section 95
//Stone2 (Stone2)
package {
import flash.display.*;
public dynamic class Stone2 extends MovieClip {
}
}//package
Section 96
//WaterLevelPiece (WaterLevelPiece)
package {
import flash.display.*;
public dynamic class WaterLevelPiece extends MovieClip {
public function WaterLevelPiece(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package