Section 1
//BandanaBomb_344 (bompbomp_fla.BandanaBomb_344)
package bompbomp_fla {
import flash.display.*;
public dynamic class BandanaBomb_344 extends MovieClip {
public function BandanaBomb_344(){
addFrameScript(9, frame10, 19, frame20);
}
function frame10(){
gotoAndPlay(1);
}
function frame20(){
gotoAndPlay(1);
}
}
}//package bompbomp_fla
Section 2
//bandanaguy_343 (bompbomp_fla.bandanaguy_343)
package bompbomp_fla {
import flash.display.*;
public dynamic class bandanaguy_343 extends MovieClip {
public var mcBomb:MovieClip;
public function bandanaguy_343(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package bompbomp_fla
Section 3
//button_exitgame_265 (bompbomp_fla.button_exitgame_265)
package bompbomp_fla {
import flash.display.*;
public dynamic class button_exitgame_265 extends MovieClip {
public function button_exitgame_265(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package bompbomp_fla
Section 4
//button_music_onoff_266 (bompbomp_fla.button_music_onoff_266)
package bompbomp_fla {
import flash.display.*;
public dynamic class button_music_onoff_266 extends MovieClip {
public function button_music_onoff_266(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package bompbomp_fla
Section 5
//button_soundfx_onoff_267 (bompbomp_fla.button_soundfx_onoff_267)
package bompbomp_fla {
import flash.display.*;
public dynamic class button_soundfx_onoff_267 extends MovieClip {
public function button_soundfx_onoff_267(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package bompbomp_fla
Section 6
//CapBomb_342 (bompbomp_fla.CapBomb_342)
package bompbomp_fla {
import flash.display.*;
public dynamic class CapBomb_342 extends MovieClip {
public function CapBomb_342(){
addFrameScript(9, frame10, 19, frame20);
}
function frame10(){
gotoAndPlay(1);
}
function frame20(){
gotoAndPlay(1);
}
}
}//package bompbomp_fla
Section 7
//capguy_341 (bompbomp_fla.capguy_341)
package bompbomp_fla {
import flash.display.*;
public dynamic class capguy_341 extends MovieClip {
public var mcBomb:MovieClip;
public function capguy_341(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package bompbomp_fla
Section 8
//HatBomb_336 (bompbomp_fla.HatBomb_336)
package bompbomp_fla {
import flash.display.*;
public dynamic class HatBomb_336 extends MovieClip {
public function HatBomb_336(){
addFrameScript(9, frame10, 19, frame20);
}
function frame10(){
gotoAndPlay(1);
}
function frame20(){
gotoAndPlay(1);
}
}
}//package bompbomp_fla
Section 9
//hatguy_335 (bompbomp_fla.hatguy_335)
package bompbomp_fla {
import flash.display.*;
public dynamic class hatguy_335 extends MovieClip {
public var mcBomb:MovieClip;
public function hatguy_335(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package bompbomp_fla
Section 10
//KangolBomb_340 (bompbomp_fla.KangolBomb_340)
package bompbomp_fla {
import flash.display.*;
public dynamic class KangolBomb_340 extends MovieClip {
public function KangolBomb_340(){
addFrameScript(9, frame10, 19, frame20);
}
function frame10(){
gotoAndPlay(1);
}
function frame20(){
gotoAndPlay(1);
}
}
}//package bompbomp_fla
Section 11
//kangolguy_339 (bompbomp_fla.kangolguy_339)
package bompbomp_fla {
import flash.display.*;
public dynamic class kangolguy_339 extends MovieClip {
public var mcBomb:MovieClip;
public function kangolguy_339(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package bompbomp_fla
Section 12
//kingkong_279 (bompbomp_fla.kingkong_279)
package bompbomp_fla {
import flash.display.*;
public dynamic class kingkong_279 extends MovieClip {
public function kingkong_279(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package bompbomp_fla
Section 13
//KnitBomb_334 (bompbomp_fla.KnitBomb_334)
package bompbomp_fla {
import flash.display.*;
public dynamic class KnitBomb_334 extends MovieClip {
public function KnitBomb_334(){
addFrameScript(9, frame10, 19, frame20);
}
function frame10(){
gotoAndPlay(1);
}
function frame20(){
gotoAndPlay(1);
}
}
}//package bompbomp_fla
Section 14
//knitguy_333 (bompbomp_fla.knitguy_333)
package bompbomp_fla {
import flash.display.*;
public dynamic class knitguy_333 extends MovieClip {
public var mcBomb:MovieClip;
public function knitguy_333(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package bompbomp_fla
Section 15
//logo_anim_319 (bompbomp_fla.logo_anim_319)
package bompbomp_fla {
import flash.display.*;
public dynamic class logo_anim_319 extends MovieClip {
public function logo_anim_319(){
addFrameScript(14, frame15);
}
function frame15(){
stop();
}
}
}//package bompbomp_fla
Section 16
//PhoneBomb_331 (bompbomp_fla.PhoneBomb_331)
package bompbomp_fla {
import flash.display.*;
public dynamic class PhoneBomb_331 extends MovieClip {
public function PhoneBomb_331(){
addFrameScript(9, frame10, 19, frame20);
}
function frame10(){
gotoAndPlay(1);
}
function frame20(){
gotoAndPlay(1);
}
}
}//package bompbomp_fla
Section 17
//phoneguy_330 (bompbomp_fla.phoneguy_330)
package bompbomp_fla {
import flash.display.*;
public dynamic class phoneguy_330 extends MovieClip {
public var mcBomb:MovieClip;
public function phoneguy_330(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package bompbomp_fla
Section 18
//quit_button_247 (bompbomp_fla.quit_button_247)
package bompbomp_fla {
import flash.display.*;
import flash.text.*;
public dynamic class quit_button_247 extends MovieClip {
public var txtQuit:TextField;
public function quit_button_247(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package bompbomp_fla
Section 19
//rewind_blink_253 (bompbomp_fla.rewind_blink_253)
package bompbomp_fla {
import flash.display.*;
public dynamic class rewind_blink_253 extends MovieClip {
public function rewind_blink_253(){
addFrameScript(13, frame14);
}
function frame14(){
gotoAndPlay(2);
}
}
}//package bompbomp_fla
Section 20
//rewindbutton_251 (bompbomp_fla.rewindbutton_251)
package bompbomp_fla {
import flash.display.*;
public dynamic class rewindbutton_251 extends MovieClip {
public var mcBlink:MovieClip;
public function rewindbutton_251(){
addFrameScript(0, frame1, 9, frame10);
}
function frame1(){
stop();
}
function frame10(){
gotoAndStop(1);
}
}
}//package bompbomp_fla
Section 21
//rewinddevice_249 (bompbomp_fla.rewinddevice_249)
package bompbomp_fla {
import flash.display.*;
public dynamic class rewinddevice_249 extends MovieClip {
public function rewinddevice_249(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package bompbomp_fla
Section 22
//shadeguy_337 (bompbomp_fla.shadeguy_337)
package bompbomp_fla {
import flash.display.*;
public dynamic class shadeguy_337 extends MovieClip {
public var mcBomb:MovieClip;
public function shadeguy_337(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package bompbomp_fla
Section 23
//ShadesBomb_338 (bompbomp_fla.ShadesBomb_338)
package bompbomp_fla {
import flash.display.*;
public dynamic class ShadesBomb_338 extends MovieClip {
public function ShadesBomb_338(){
addFrameScript(9, frame10, 19, frame20);
}
function frame10(){
gotoAndPlay(1);
}
function frame20(){
gotoAndPlay(1);
}
}
}//package bompbomp_fla
Section 24
//spraypop_323 (bompbomp_fla.spraypop_323)
package bompbomp_fla {
import flash.display.*;
public dynamic class spraypop_323 extends MovieClip {
public function spraypop_323(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package bompbomp_fla
Section 25
//starspray_4 (bompbomp_fla.starspray_4)
package bompbomp_fla {
import flash.display.*;
public dynamic class starspray_4 extends MovieClip {
public function starspray_4(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package bompbomp_fla
Section 26
//sticker_bubble_anim_92 (bompbomp_fla.sticker_bubble_anim_92)
package bompbomp_fla {
import flash.display.*;
public dynamic class sticker_bubble_anim_92 extends MovieClip {
public var mcGray:MovieClip;
public var mcYellow:MovieClip;
public function sticker_bubble_anim_92(){
addFrameScript(20, frame21);
}
function frame21(){
gotoAndPlay(6);
}
}
}//package bompbomp_fla
Section 27
//sticker_bubble_anim_leftup_150 (bompbomp_fla.sticker_bubble_anim_leftup_150)
package bompbomp_fla {
import flash.display.*;
public dynamic class sticker_bubble_anim_leftup_150 extends MovieClip {
public var mcGray:MovieClip;
public var mcYellow:MovieClip;
public function sticker_bubble_anim_leftup_150(){
addFrameScript(20, frame21);
}
function frame21(){
gotoAndPlay(6);
}
}
}//package bompbomp_fla
Section 28
//sticker_bubble_anim_rightdown_159 (bompbomp_fla.sticker_bubble_anim_rightdown_159)
package bompbomp_fla {
import flash.display.*;
public dynamic class sticker_bubble_anim_rightdown_159 extends MovieClip {
public var mcGray:MovieClip;
public var mcYellow:MovieClip;
public function sticker_bubble_anim_rightdown_159(){
addFrameScript(20, frame21);
}
function frame21(){
gotoAndPlay(6);
}
}
}//package bompbomp_fla
Section 29
//time_warning_anim_353 (bompbomp_fla.time_warning_anim_353)
package bompbomp_fla {
import flash.display.*;
public dynamic class time_warning_anim_353 extends MovieClip {
public function time_warning_anim_353(){
addFrameScript(0, frame1, 20, frame21);
}
function frame1(){
stop();
}
function frame21(){
gotoAndPlay(2);
}
}
}//package bompbomp_fla
Section 30
//colorBomb (sound.colorBomb)
package sound {
import flash.media.*;
public dynamic class colorBomb extends Sound {
}
}//package sound
Section 31
//combo0 (sound.combo0)
package sound {
import flash.media.*;
public dynamic class combo0 extends Sound {
}
}//package sound
Section 32
//combo1 (sound.combo1)
package sound {
import flash.media.*;
public dynamic class combo1 extends Sound {
}
}//package sound
Section 33
//combo2 (sound.combo2)
package sound {
import flash.media.*;
public dynamic class combo2 extends Sound {
}
}//package sound
Section 34
//combo3 (sound.combo3)
package sound {
import flash.media.*;
public dynamic class combo3 extends Sound {
}
}//package sound
Section 35
//combo4 (sound.combo4)
package sound {
import flash.media.*;
public dynamic class combo4 extends Sound {
}
}//package sound
Section 36
//explosion (sound.explosion)
package sound {
import flash.media.*;
public dynamic class explosion extends Sound {
}
}//package sound
Section 37
//intro (sound.intro)
package sound {
import flash.media.*;
public dynamic class intro extends Sound {
}
}//package sound
Section 38
//loop1 (sound.loop1)
package sound {
import flash.media.*;
public dynamic class loop1 extends Sound {
}
}//package sound
Section 39
//loop2 (sound.loop2)
package sound {
import flash.media.*;
public dynamic class loop2 extends Sound {
}
}//package sound
Section 40
//outro (sound.outro)
package sound {
import flash.media.*;
public dynamic class outro extends Sound {
}
}//package sound
Section 41
//Rewind (sound.Rewind)
package sound {
import flash.media.*;
public dynamic class Rewind extends Sound {
}
}//package sound
Section 42
//spray (sound.spray)
package sound {
import flash.media.*;
public dynamic class spray extends Sound {
}
}//package sound
Section 43
//starCombo (sound.starCombo)
package sound {
import flash.media.*;
public dynamic class starCombo extends Sound {
}
}//package sound
Section 44
//switch (sound.switch)
package sound {
import flash.media.*;
public dynamic class switch extends Sound {
}
}//package sound
Section 45
//timer (sound.timer)
package sound {
import flash.media.*;
public dynamic class timer extends Sound {
}
}//package sound
Section 46
//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_GAME = 579;
private static var CMD_PIECE_CLICKED = 846;
private static var CMD_REWIND_CLICKED = 126;
private static var CMD_UPDATE_SCORE = 228;
private static var CMD_LAST_TICK = 369;
private static var CMD_QUIT_BUTTON_CLICKED = 844;
public function gameStarted(){
trace("GAME START");
if (!hasSentGameStart){
hasSentGameStart = true;
fscommand("gameStart");
};
}
public function gameEnd(_arg1){
trace("GAME ENDS");
if (!hasSentGameEnd){
hasSentGameEnd = true;
fscommand("gameEnd", _arg1);
};
}
public function gameQuit(){
if (!hasSentGameOver){
trace("GAME QUIT");
hasSentGameOver = true;
fscommand("gameQuit");
};
}
public function startGame(_arg1, _arg2){
fscommand("playData", ((((CMD_START_GAME + ",") + _arg1) + " ") + _arg2));
}
public function pieceClicked(_arg1, _arg2, _arg3){
fscommand("playData", ((((((CMD_PIECE_CLICKED + ",") + _arg1) + " ") + _arg2) + " ") + _arg3));
}
public function rewindClicked(_arg1){
fscommand("playData", ((CMD_REWIND_CLICKED + ",") + _arg1));
}
public function updateScore(_arg1, _arg2){
fscommand("playData", ((((CMD_UPDATE_SCORE + ",") + _arg1) + " ") + _arg2));
}
public function lastTick(_arg1, _arg2, _arg3, _arg4){
fscommand("playData", ((((((((CMD_LAST_TICK + ",") + _arg1) + " ") + _arg2) + " ") + _arg3) + " ") + _arg4));
}
public function quitButtonClicked(_arg1){
fscommand("playData", ((CMD_QUIT_BUTTON_CLICKED + ",") + _arg1));
}
}
}//package src.comm
Section 47
//GameDataParser (src.comm.GameDataParser)
package src.comm {
import flash.xml.*;
public class GameDataParser {
public static var textMappings:Object;
public static var levelData: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();
records = new Object();
levelData = new Object();
_local2.textMappings = textMappings;
_local2.records = records;
_local2.levelData = levelData;
var _local4:* = _local3.firstChild.childNodes;
records = new Object();
_local2.records = records;
sounds = new Object();
var _local5:int = parseInt(_local3.firstChild.attributes.randomseed);
_local2.randomSeed = _local5;
var _local6 = "";
var _local7:* = 0;
while (_local7 < _local4.length) {
if (_local4[_local7].nodeName == "id"){
};
if (_local4[_local7].nodeName == "game"){
_local2.gameType = new String(_local4[_local7].attributes.type);
};
if (_local4[_local7].nodeName == "userType"){
_local2.userType = new String(_local4[_local7].firstChild.nodeValue);
};
if (_local4[_local7].nodeName == "text"){
if ((((_local4[_local7].firstChild == null)) || ((_local4[_local7].firstChild == undefined)))){
textMappings[_local4[_local7].attributes.id] = (("[" + _local4[_local7].attributes.id) + "]");
} else {
textMappings[_local4[_local7].attributes.id] = new String(_local4[_local7].firstChild.nodeValue);
};
};
if (_local4[_local7].nodeName == "record"){
if ((((_local4[_local7].firstChild == null)) || ((_local4[_local7].firstChild == undefined)))){
records[_local4[_local7].attributes.id] = (("[" + _local4[_local7].attributes.id) + "]");
} else {
records[_local4[_local7].attributes.id] = new Number(_local4[_local7].firstChild.nodeValue);
};
};
if (_local4[_local7].nodeName == "sounds"){
if ((((_local4[_local7].firstChild == null)) || ((_local4[_local7].firstChild == undefined)))){
sounds[_local4[_local7].attributes.id] = (("[" + _local4[_local7].attributes.id) + "]");
} else {
sounds[_local4[_local7].attributes.id] = new String(_local4[_local7].firstChild.nodeValue);
};
};
if (_local4[_local7].nodeName == "unlock"){
_local6 = (_local6 + (((new String(_local4[_local7].attributes.id) + ",") + new String(_local4[_local7].firstChild.nodeValue)) + "-"));
};
_local7++;
};
_local2.sounds = sounds;
_local2.animationData = _local6;
return (_local2);
}
}
}//package src.comm
Section 48
//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 49
//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 50
//ManagedSoundChannel (src.sound.ManagedSoundChannel)
package src.sound {
import flash.media.*;
import flash.events.*;
import flash.utils.*;
public class ManagedSoundChannel {
private var sound:ManagedSound;
private var channel:SoundChannel;
private var manager:SoundManager;
private var targetVolume:Number;
private var targetPan:Number;
private var fadeStartTime: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 51
//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 52
//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 53
//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 54
//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 55
//AnimationHandler (src.AnimationHandler)
package src {
import flash.display.*;
import src.timing.*;
import flash.events.*;
import src.comm.*;
import src.math.*;
import flash.utils.*;
import flash.external.*;
public class AnimationHandler {
private var animationArr:Array;
public function AnimationHandler(){
animationArr = new Array();
}
public function tick():void{
var _local1:* = 0;
while (_local1 < animationArr.length) {
if (animationArr[_local1].mc != null){
if (animationArr[_local1].delay == 0){
animationArr[_local1].animationTo = Math.min((animationArr[_local1].animationTo + 1), animationArr[_local1].mc.totalFrames);
} else {
animationArr[_local1].delay--;
if (animationArr[_local1].delay == 0){
animationArr[_local1].mc.visible = true;
};
};
};
_local1++;
};
animationArr = animationArr.filter(isDone);
}
public function render():void{
var _local1:* = 0;
while (_local1 < animationArr.length) {
if (animationArr[_local1].mc != null){
if (animationArr[_local1].mc.currentFrame != animationArr[_local1].animationTo){
animationArr[_local1].mc.gotoAndStop(animationArr[_local1].animationTo);
};
};
_local1++;
};
}
public function addAnimation(_arg1:MovieClip, _arg2:Number, _arg3:Boolean, _arg4:Number):void{
var _local5:* = new Object();
_local5.mc = _arg1;
_local5.animationTo = _arg4;
_local5.delay = _arg2;
_local5.loop = _arg3;
if (_arg2 == 0){
_local5.mc.visible = true;
};
animationArr.push(_local5);
}
public function isDone(_arg1, _arg2:int, _arg3:Array):Boolean{
if (_arg1.mc.parent == null){
return (false);
};
if (_arg1.loop){
if (_arg1.mc.currentFrame == _arg1.mc.totalFrames){
_arg1.animationTo = 1;
};
return (true);
};
if ((((_arg1.mc.currentFrame == _arg1.mc.totalFrames)) || ((((_arg1.animationTo == _arg1.mc.totalFrames)) && ((_arg1.mc.currentFrame == 1)))))){
return (false);
};
return (true);
}
}
}//package src
Section 56
//BompBomp (src.BompBomp)
package src {
import src.sound.*;
import flash.display.*;
import src.timing.*;
import flash.events.*;
import src.comm.*;
import src.math.*;
import flash.utils.*;
import flash.external.*;
public class BompBomp extends MovieClip implements Timeable {
private var m_mainTimer;
private var random:MtRandom;
private var communicator:Communicator;
public var parsedGameData:Object;// = null
private var gameState;
private var game_:Game;
private var timeLeft:Number;
private var startAnims:StartAnims;
private var animationHandler:AnimationHandler;
private var scoreSign:ScoreSign;
private var clock:Clock;
private var buttons:Buttons;
private var sfxOn;// = true
private var musicOn;// = true
private var intro:Intro;
private var info1:Info1;
private var info2:Info2;
private var stickersAnims:StickersAnims;
private var bompsCleared:Number;
private var chainCombosMade:Number;
private var colorBombsDetonated:Number;
private var topScored:Number;
private var starBombsDetonated:Number;
private var monsterCombo:Number;
private var helicopterCombo:Number;
private var blueBompTimer:Number;
private var quadStarCombo:Number;
private var tripsColorBomb:Number;
private var clientStarBombsDetonated:Number;
private var clientColorBombsDetonated:Number;
private var clientBompsCleared:Number;
private var clientChainCombosMade:Number;
private var clientTopScored:Number;
private var clientMonsterCombo:Number;
private var clientHelicopterCombo:Number;
private var clientBlueBompTimer:Number;
private var clientQuadStarCombo:Number;
private var clientTripsColorBomb:Number;
private var startAnimsArr:Array;
private var gameOver:GameOver;
private var noOfRandoms:Number;// = 0
public var musicManager:SoundManager;
public var sfxManager:SoundManager;
public var playTimeLeft;
private var runClock:Boolean;// = false
private var currentTick:Number;// = 0
private var clientVersion;// = "1.1"
private var userType_:Number;
private static var STATE_SHOW_INTRO_SCREEN = 0;
private static var STATE_SHOW_INFO_SCREEN = 1;
private static var STATE_SHOW_STICKERS_SCREEN = 2;
private static var STATE_PLAY_GAME = 3;
private static var STATE_END_GAME = 4;
private static var TICKS_PER_SEC = 25;
private static var DEBUG_MODE = false;
private static var DEBUG_GAME_DATA = (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((("<gamedata randomseed=\"" + Math.round((Math.random() * 5000))) + "\" timelimit=\"660\" lang=\"de\">") + "<text id=\"game_starts_in\">The game starts in [0] seconds!</text>") + "<text id=\"score\">Score:</text>") + "<text id=\"bonus\">Bonus:</text>") + "<text id=\"info_header\">Instructions</text>") + "<text id=\"info1\">Info 1</text>") + "<text id=\"info2\">Info 2</text>") + "<text id=\"info3\">Info 3</text>") + "<text id=\"info4\">Info 4</text>") + "<text id=\"info5\">Info 5</text>") + "<text id=\"info6\">Info 6</text>") + "<text id=\"new\">new!</text>") + "<text id=\"quit\">Quit</text>") + "<text id=\"open_game_end\">Register, n00blar!</text>") + "<text id=\"colorBomb\">Color Bomb!</text>") + "<text id=\"Sticker_mc10000_Label\">mc10000 Label</text>") + "<text id=\"Sticker_Cassette_Label\">Cassette Label</text>") + "<text id=\"Sticker_Needle_Label\">Needle Label</text>") + "<text id=\"Sticker_MusicNote_Label\">MusicNote Label</text>") + "<text id=\"Sticker_Prism_Label\">Prism Label</text>") + "<text id=\"Sticker_PotOGold_Label\">PotOGold Label</text>") + "<text id=\"Sticker_Glasses_Label\">Glasses Label</text>") + "<text id=\"Sticker_Rainbow_Label\">Rainbow Label</text>") + "<text id=\"Sticker_Monsters_Label\">Monsters Label</text>") + "<text id=\"Sticker_mc1000_Label\">mc1000 Label</text>") + "<text id=\"Sticker_mc100000_Label\">mc100000 Label</text>") + "<text id=\"Sticker_VinylSaw_Label\">VinylSaw Label</text>") + "<text id=\"Sticker_Chain_Label\">Chain Label</text>") + "<text id=\"Sticker_ChainGuy_Label\">ChainGuy Label</text>") + "<text id=\"Sticker_Star_Label\">Star Label</text>") + "<text id=\"Sticker_Trophy_Label\">Trophy Label</text>") + "<text id=\"Sticker_Crown_Label\">Crown Label</text>") + "<text id=\"Sticker_Sneaker_Label\">Sneaker Label</text>") + "<text id=\"Sticker_Hamburger_Label\">Hamburger Label</text>") + "<text id=\"Sticker_Diamond_Label\">Diamond Label</text>") + "<text id=\"Sticker_Flash_Label\">Flash Label</text>") + "<text id=\"Sticker_Planet_Label\">Planet Label</text>") + "<text id=\"Sticker_mc10000\">mc10000 description</text>") + "<text id=\"Sticker_Cassette\">Cassette description</text>") + "<text id=\"Sticker_Needle\">Needle description</text>") + "<text id=\"Sticker_MusicNote\">MusicNote description</text>") + "<text id=\"Sticker_Prism\">Prism description</text>") + "<text id=\"Sticker_PotOGold\">PotOGold description</text>") + "<text id=\"Sticker_Glasses\">Glasses description</text>") + "<text id=\"Sticker_Rainbow\">Rainbow description</text>") + "<text id=\"Sticker_Monsters\">Monsters description</text>") + "<text id=\"Sticker_mc1000\">mc1000 description</text>") + "<text id=\"Sticker_mc100000\">mc100000 description</text>") + "<text id=\"Sticker_VinylSaw\">VinylSaw description</text>") + "<text id=\"Sticker_Chain\">Chain description</text>") + "<text id=\"Sticker_ChainGuy\">ChainGuy description</text>") + "<text id=\"Sticker_Star\">Star description</text>") + "<text id=\"Sticker_Trophy\">Trophy description</text>") + "<text id=\"Sticker_Crown\">Crown description</text>") + "<text id=\"Sticker_Sneaker\">Sneaker description</text>") + "<text id=\"Sticker_Hamburger\">Hamburger description</text>") + "<text id=\"Sticker_Diamond\">Diamond description</text>") + "<text id=\"Sticker_Flash\">Flash description</text>") + "<text id=\"Sticker_Planet\">Planet description</text>") + "<text id=\"progress\">Progress</text>") + "<text id=\"record\">Record</text>") + "<sounds id=\"sfxOn\">1</sounds>") + "<sounds id=\"musicOn\">1</sounds>") + "<record id=\"starBombsDetonated\">3734</record>") + "<record id=\"colorBombsDetonated\">832</record>") + "<record id=\"bompsCleared\">27343</record>") + "<record id=\"chainCombosMade\">12344</record>") + "<record id=\"topScored\">301823</record>") + "<record id=\"helicopterCombo\">33832</record>") + "<record id=\"monsterCombo\">49848</record>") + "<record id=\"blueBompTimer\">44</record>") + "<record id=\"quadStarCombo\">33</record>") + "<record id=\"tripsColorBomb\">43</record>") + "<userType id=\"0\">1</userType>") + "</gamedata>");
public function BompBomp(){
var _local1:Object;
var _local3:String;
startAnimsArr = new Array();
musicManager = new SoundManager();
sfxManager = new SoundManager();
playTimeLeft = (TICKS_PER_SEC * 240);
super();
m_mainTimer = new Timer(this, TICKS_PER_SEC);
addEventListener("enterFrame", drive);
communicator = new Communicator();
if (DEBUG_MODE){
_local1 = new Object();
_local1.message = DEBUG_GAME_DATA;
_local1.success = true;
} else {
_local1 = ExternalInterface.call("getGameData");
};
if ((((_local1 == null)) || (!(_local1.success)))){
trace(("oa kuka ur " + _local1));
} else {
_local3 = _local1.message;
parsedGameData = GameDataParser.parseGameData(_local3);
random = new MtRandom(parsedGameData.randomSeed);
starBombsDetonated = Number(parsedGameData.records["starBombsDetonated"]);
colorBombsDetonated = Number(parsedGameData.records["colorBombsDetonated"]);
bompsCleared = Number(parsedGameData.records["bompsCleared"]);
chainCombosMade = Number(parsedGameData.records["chainCombosMade"]);
topScored = Number(parsedGameData.records["topScored"]);
monsterCombo = Number(parsedGameData.records["monsterCombo"]);
helicopterCombo = Number(parsedGameData.records["helicopterCombo"]);
blueBompTimer = Number(parsedGameData.records["blueBompTimer"]);
quadStarCombo = Number(parsedGameData.records["quadStarCombo"]);
tripsColorBomb = Number(parsedGameData.records["tripsColorBomb"]);
clientStarBombsDetonated = Number(parsedGameData.records["starBombsDetonated"]);
clientColorBombsDetonated = Number(parsedGameData.records["colorBombsDetonated"]);
clientBompsCleared = Number(parsedGameData.records["bompsCleared"]);
clientChainCombosMade = Number(parsedGameData.records["chainCombosMade"]);
clientTopScored = Number(parsedGameData.records["topScored"]);
clientHelicopterCombo = Number(parsedGameData.records["helicopterCombo"]);
clientMonsterCombo = Number(parsedGameData.records["monsterCombo"]);
clientBlueBompTimer = Number(parsedGameData.records["blueBompTimer"]);
clientQuadStarCombo = Number(parsedGameData.records["quadStarCombo"]);
clientTripsColorBomb = Number(parsedGameData.records["tripsColorBomb"]);
userType_ = parsedGameData.userType;
if (userType_ == 0){
playTimeLeft = (TICKS_PER_SEC * 60);
};
};
var _local2:* = new BackGround();
addChild(_local2);
animationHandler = new AnimationHandler();
buttons = new Buttons(this);
addChild(buttons);
if (Number(parsedGameData.sounds["sfxOn"]) == 1){
buttons.mcSoundButton.gotoAndStop(3);
sfxOn = false;
sfxManager.setVolume(0);
};
if (Number(parsedGameData.sounds["musicOn"]) == 1){
buttons.mcMusicButton.gotoAndStop(3);
musicOn = false;
musicManager.setVolume(0);
};
showIntroScreen();
}
private function drive(_arg1:Event){
m_mainTimer.advanceTime2();
}
public function startClock():void{
runClock = true;
}
public function tick(_arg1:Number):void{
currentTick = _arg1;
animationHandler.tick();
switch (gameState){
case STATE_SHOW_INTRO_SCREEN:
timeLeft--;
if (timeLeft == 0){
trace("aa");
intro.removeEventListener(MouseEvent.MOUSE_DOWN, resetTimeLeft);
removeChild(intro);
showInfoScreen1();
};
break;
case STATE_SHOW_INFO_SCREEN:
timeLeft--;
if (timeLeft == 250){
info1.removeEventListener(MouseEvent.MOUSE_DOWN, resetTimeLeft);
removeChild(info1);
showInfoScreen2();
};
if (timeLeft == 0){
info2.removeEventListener(MouseEvent.MOUSE_DOWN, resetTimeLeft);
removeChild(info2);
startGame();
};
break;
case STATE_PLAY_GAME:
game_.tick(_arg1);
if (runClock){
playTimeLeft--;
};
if (playTimeLeft == 375){
sfxManager.get("timer").loop();
clock.mcFlash.gotoAndPlay(2);
};
if (playTimeLeft == 0){
game_.timeUp();
};
updateClock();
break;
case STATE_END_GAME:
timeLeft--;
if (timeLeft == 0){
if (userType_ == 0){
gameQuit();
} else {
gameOver.removeEventListener(MouseEvent.MOUSE_DOWN, resetTimeLeft);
removeChild(gameOver);
showStickersScreen();
};
};
break;
case STATE_SHOW_STICKERS_SCREEN:
timeLeft--;
if (timeLeft == 0){
gameQuit();
};
break;
};
}
public function render(_arg1:Number, _arg2:Number):void{
musicManager.update();
sfxManager.update();
animationHandler.render();
switch (gameState){
case STATE_SHOW_INTRO_SCREEN:
break;
case STATE_PLAY_GAME:
game_.render(_arg1, _arg2);
break;
case STATE_SHOW_STICKERS_SCREEN:
stickersAnims.mcQuit.txtQuit.text = ((parsedGameData.textMappings["quit"] + " ") + Math.max(Math.round((timeLeft / TICKS_PER_SEC)), 0));
break;
};
}
public function addAnimation(_arg1:MovieClip, _arg2:Number, _arg3:Boolean, _arg4:Number):void{
animationHandler.addAnimation(_arg1, _arg2, _arg3, _arg4);
}
public function resetTimeLeft(_arg1:Event):void{
if (timeLeft > 251){
timeLeft = 251;
} else {
timeLeft = 1;
};
}
public function showIntroScreen():void{
musicManager.get("intro").play();
intro = new Intro();
addChild(intro);
setChildIndex(buttons, (numChildren - 1));
intro.x = 378;
intro.y = 300;
animationHandler.addAnimation(intro, 0, false, 1);
intro.addEventListener(MouseEvent.MOUSE_DOWN, resetTimeLeft);
timeLeft = 100;
gameState = STATE_SHOW_INTRO_SCREEN;
}
public function showInfoScreen1():void{
info1 = new Info1();
addChild(info1);
setChildIndex(buttons, (numChildren - 1));
info1.x = 378;
info1.y = 300;
animationHandler.addAnimation(info1, 0, true, 1);
info1.addEventListener(MouseEvent.MOUSE_DOWN, resetTimeLeft, false, 0, true);
info1.txtInfo1.text = parsedGameData.textMappings["info1"];
info1.txtInfo2.text = parsedGameData.textMappings["info2"];
info1.txtInfo3.text = parsedGameData.textMappings["info3"];
info1.txtInfoHeader.text = parsedGameData.textMappings["info_header"];
timeLeft = 500;
gameState = STATE_SHOW_INFO_SCREEN;
}
public function showInfoScreen2():void{
info2 = new Info2();
addChild(info2);
setChildIndex(buttons, (numChildren - 1));
info2.x = 378;
info2.y = 300;
animationHandler.addAnimation(info2, 0, true, 1);
info2.addEventListener(MouseEvent.MOUSE_DOWN, resetTimeLeft);
info2.txtInfo1.text = parsedGameData.textMappings["info4"];
info2.txtInfo2.text = parsedGameData.textMappings["info5"];
info2.txtInfo3.text = parsedGameData.textMappings["info6"];
info2.txtInfoHeader.text = parsedGameData.textMappings["info_header"];
gameState = STATE_SHOW_INFO_SCREEN;
}
public function showStickersScreen():void{
stickersAnims = new StickersAnims(createUnlockString(), this, startAnimsArr);
addChild(stickersAnims);
stickersAnims.mcQuit.addEventListener(MouseEvent.CLICK, gameQuitPressed);
stickersAnims.mcQuit.addEventListener(MouseEvent.MOUSE_OVER, onQuitButton);
stickersAnims.mcQuit.addEventListener(MouseEvent.MOUSE_OUT, offQuitButton);
timeLeft = 375;
gameState = STATE_SHOW_STICKERS_SCREEN;
}
public function startGame():void{
communicator.gameStarted();
communicator.startGame((currentTick + 1), clientVersion);
musicManager.get("intro").fadeToAndStop(0, 500);
if (starBombsDetonated >= 100){
musicManager.get("loop2").loop(0.3);
} else {
musicManager.get("loop1").loop(0.3);
};
startAnimsArr = createUnlockString();
startAnims = new StartAnims(startAnimsArr, this);
addChild(startAnims);
scoreSign = new ScoreSign();
scoreSign.x = 251;
scoreSign.y = 513;
addChild(scoreSign);
clock = new Clock();
clock.x = 376;
clock.y = 513;
addChild(clock);
game_ = new Game(this, musicManager, sfxManager, clientStarBombsDetonated, clientColorBombsDetonated, clientBompsCleared, clientChainCombosMade, clientTopScored, clientHelicopterCombo, clientMonsterCombo, clientBlueBompTimer, clientQuadStarCombo, clientTripsColorBomb, communicator, currentTick, parsedGameData.textMappings["colorBomb"]);
buttons.mcQuitButton.visible = true;
addChild(game_);
setChildIndex(buttons, (numChildren - 1));
gameState = STATE_PLAY_GAME;
}
public function endGame(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number, _arg10:Number, _arg11:Number, _arg12:Number):void{
var _local13:Number;
var _local14:*;
var _local15:*;
var _local16:*;
if (userType_ == 0){
_local13 = (_arg1 + _arg2);
communicator.gameEnd(_local13);
_local14 = new OpenGameEnd();
_local14.x = 375;
_local14.y = 300;
addChild(_local14);
_local14.txtOpenGame.text = parsedGameData.textMappings["open_game_end"];
timeLeft = (5 * TICKS_PER_SEC);
_local14.addEventListener(MouseEvent.MOUSE_DOWN, resetTimeLeft);
gameState = STATE_END_GAME;
} else {
if (gameOver == null){
_local15 = 1;
if (musicOn){
_local15 = 0;
};
_local16 = 1;
if (sfxOn){
_local16 = 0;
};
communicator.lastTick((currentTick + 1), noOfRandoms, _local15, _local16);
sfxManager.get("timer").stop();
musicManager.get("loop1").stop();
musicManager.get("loop2").stop();
musicManager.get("outro").play();
gameOver = new GameOver();
addChild(gameOver);
gameOver.x = -140;
gameOver.y = -100;
_local13 = (_arg1 + _arg2);
this.clientStarBombsDetonated = _arg3;
this.clientColorBombsDetonated = _arg4;
this.clientBompsCleared = _arg5;
this.clientChainCombosMade = _arg6;
this.clientTopScored = _local13;
this.clientHelicopterCombo = _arg8;
this.clientMonsterCombo = _arg9;
this.clientBlueBompTimer = _arg10;
this.clientQuadStarCombo = _arg11;
this.clientTripsColorBomb = _arg12;
communicator.gameEnd(_local13);
gameOver.mcRecord.txtScoreLabel.text = parsedGameData.textMappings["score"];
gameOver.mcRecord.txtBonusLabel.text = parsedGameData.textMappings["bonus"];
gameOver.mcRecord.txtScore.text = _local13;
gameOver.mcRecord.txtBonus.text = _arg2;
animationHandler.addAnimation(gameOver, 0, false, 1);
timeLeft = (5 * TICKS_PER_SEC);
gameOver.addEventListener(MouseEvent.MOUSE_DOWN, resetTimeLeft);
gameState = STATE_END_GAME;
};
};
}
public function gameQuitPressed(_arg1:Event){
timeLeft = 1;
}
public function gameQuit():void{
communicator.gameQuit();
}
public function blueBomp():void{
clientBlueBompTimer = Math.floor((playTimeLeft / TICKS_PER_SEC));
}
public function createUnlockString():Array{
var _local1:* = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
if (clientStarBombsDetonated > starBombsDetonated){
starBombsDetonated = clientStarBombsDetonated;
};
if (clientColorBombsDetonated > colorBombsDetonated){
colorBombsDetonated = clientColorBombsDetonated;
};
if (clientBompsCleared > bompsCleared){
bompsCleared = clientBompsCleared;
};
if (clientChainCombosMade > chainCombosMade){
chainCombosMade = clientChainCombosMade;
};
if (clientTopScored > topScored){
topScored = clientTopScored;
};
if (clientHelicopterCombo > helicopterCombo){
helicopterCombo = clientHelicopterCombo;
};
if (bompsCleared < 10000){
helicopterCombo = 0;
};
if (clientMonsterCombo > monsterCombo){
monsterCombo = clientMonsterCombo;
};
if (bompsCleared < 100000){
monsterCombo = 0;
};
if (clientBlueBompTimer > blueBompTimer){
blueBompTimer = clientBlueBompTimer;
};
if (clientQuadStarCombo > quadStarCombo){
quadStarCombo = clientQuadStarCombo;
};
if (clientTripsColorBomb > tripsColorBomb){
tripsColorBomb = clientTripsColorBomb;
};
if (starBombsDetonated >= 100){
_local1[1] = 1;
};
if (starBombsDetonated >= 250){
_local1[2] = 1;
};
if (starBombsDetonated >= 500){
_local1[3] = 1;
};
if (starBombsDetonated >= 1000){
_local1[19] = 1;
};
if (colorBombsDetonated >= 100){
trace("col bomb det 1");
_local1[12] = 1;
_local1[18] = 1;
};
if (colorBombsDetonated >= 250){
trace("col bomb det 2");
_local1[4] = 1;
_local1[10] = 1;
};
if (colorBombsDetonated >= 500){
trace("col bomb det 3");
_local1[5] = 1;
_local1[8] = 1;
};
if (colorBombsDetonated >= 1000){
trace("col bomb det 4");
_local1[6] = 1;
_local1[9] = 1;
};
if (bompsCleared >= 1000){
_local1[16] = 1;
};
if (bompsCleared >= 10000){
_local1[0] = 1;
};
if (bompsCleared >= 100000){
_local1[17] = 1;
};
if (chainCombosMade >= 500){
_local1[20] = 1;
};
if (chainCombosMade >= 1000){
_local1[21] = 1;
};
if (topScored >= 50000){
_local1[22] = 1;
};
if (topScored >= 75000){
_local1[23] = 1;
};
if (topScored >= 100000){
_local1[24] = 1;
};
if (monsterCombo >= 100){
_local1[15] = 1;
};
if (helicopterCombo >= 70){
_local1[29] = 1;
};
if (quadStarCombo >= 50){
_local1[26] = 1;
};
if (tripsColorBomb >= 1){
_local1[27] = 1;
};
if (blueBompTimer >= 120){
_local1[25] = 1;
};
if (blueBompTimer >= 150){
_local1[28] = 1;
};
_local1[7] = 1;
_local1[11] = 1;
_local1[13] = 1;
_local1[14] = 1;
_local1[18] = 1;
return (_local1);
}
public function getCopy(_arg1:String, _arg2:Number):String{
var _local3:String = parsedGameData.textMappings[_arg1];
if (_arg2 == 0){
switch (_arg1){
case "new":
_local3 = parsedGameData.textMappings["new"];
break;
case "Sticker_mc10000":
_local3 = (_local3 + (("\n" + parsedGameData.textMappings["progress"]) + ": "));
_local3 = (_local3 + (bompsCleared + "/10000"));
break;
case "Sticker_Cassette":
_local3 = (_local3 + (("\n" + parsedGameData.textMappings["progress"]) + ": "));
_local3 = (_local3 + (starBombsDetonated + "/100"));
break;
case "Sticker_Needle":
_local3 = (_local3 + (("\n" + parsedGameData.textMappings["progress"]) + ": "));
_local3 = (_local3 + (starBombsDetonated + "/250"));
break;
case "Sticker_MusicNote":
_local3 = (_local3 + (("\n" + parsedGameData.textMappings["progress"]) + ": "));
_local3 = (_local3 + (starBombsDetonated + "/500"));
break;
case "Sticker_Prism":
_local3 = (_local3 + (("\n" + parsedGameData.textMappings["progress"]) + ": "));
_local3 = (_local3 + (colorBombsDetonated + "/250"));
break;
case "Sticker_PotOGold":
_local3 = (_local3 + (("\n" + parsedGameData.textMappings["progress"]) + ": "));
_local3 = (_local3 + (colorBombsDetonated + "/500"));
break;
case "Sticker_Glasses":
_local3 = (_local3 + (("\n" + parsedGameData.textMappings["progress"]) + ": "));
_local3 = (_local3 + (colorBombsDetonated + "/1000"));
break;
case "Sticker_Rainbow":
_local3 = (_local3 + (("\n" + parsedGameData.textMappings["progress"]) + ": "));
_local3 = (_local3 + (colorBombsDetonated + "/100"));
break;
case "Sticker_mc1000":
_local3 = (_local3 + (("\n" + parsedGameData.textMappings["progress"]) + ": "));
_local3 = (_local3 + (bompsCleared + "/1000"));
break;
case "Sticker_mc100000":
_local3 = (_local3 + (("\n" + parsedGameData.textMappings["progress"]) + ": "));
_local3 = (_local3 + (bompsCleared + "/100000"));
break;
case "Sticker_VinylSaw":
_local3 = (_local3 + (("\n" + parsedGameData.textMappings["progress"]) + ": "));
_local3 = (_local3 + (starBombsDetonated + "/1000"));
break;
case "Sticker_Chain":
_local3 = (_local3 + (("\n" + parsedGameData.textMappings["progress"]) + ": "));
_local3 = (_local3 + (chainCombosMade + "/500"));
break;
case "Sticker_ChainGuy":
_local3 = (_local3 + (("\n" + parsedGameData.textMappings["progress"]) + ": "));
_local3 = (_local3 + (chainCombosMade + "/1000"));
break;
case "Sticker_Star":
_local3 = (_local3 + (("\n" + parsedGameData.textMappings["record"]) + ": "));
_local3 = (_local3 + topScored);
break;
case "Sticker_Trophy":
_local3 = (_local3 + (("\n" + parsedGameData.textMappings["record"]) + ": "));
_local3 = (_local3 + topScored);
break;
case "Sticker_Crown":
_local3 = (_local3 + (("\n" + parsedGameData.textMappings["record"]) + ": "));
_local3 = (_local3 + topScored);
break;
case "Sticker_Sneaker":
break;
case "Sticker_Hamburger":
_local3 = (_local3 + (("\n" + parsedGameData.textMappings["progress"]) + ": "));
_local3 = (_local3 + quadStarCombo);
break;
case "Sticker_Flash":
break;
case "Sticker_Planet":
break;
case "Sticker_Monsters":
break;
};
};
return (_local3);
}
public function updateScoreSign(_arg1:Number):void{
communicator.updateScore((currentTick + 1), _arg1);
scoreSign.txtScore.text = String(_arg1);
}
public function updateClock():void{
var _local1:* = Math.max(playTimeLeft, 0);
var _local2:* = Math.round((_local1 / TICKS_PER_SEC));
var _local3:* = Math.floor((_local2 / 60));
_local2 = (_local2 - (_local3 * 60));
var _local4:* = "";
if (_local2 < 10){
_local4 = "0";
};
clock.txtClock.text = (((_local3 + ":") + _local4) + _local2);
}
public function sfxButtonClicked(){
if (sfxOn){
sfxManager.fadeTo(0, 500);
sfxOn = false;
buttons.mcSoundButton.gotoAndStop(4);
} else {
sfxManager.fadeTo(1, 500);
sfxOn = true;
buttons.mcSoundButton.gotoAndStop(2);
};
}
public function musicButtonClicked(){
if (musicOn){
musicManager.fadeTo(0, 500);
musicOn = false;
buttons.mcMusicButton.gotoAndStop(4);
} else {
musicManager.fadeTo(1, 500);
musicOn = true;
buttons.mcMusicButton.gotoAndStop(2);
};
}
public function quitButtonClicked(){
if (gameState == STATE_PLAY_GAME){
communicator.quitButtonClicked((currentTick + 1));
game_.clearBoard();
game_.realGameOver();
};
}
public function getRandom(_arg1:Number):Number{
noOfRandoms++;
return (random.nextInt(_arg1));
}
public function onQuitButton(_arg1:Event){
stickersAnims.mcQuit.gotoAndStop(2);
}
public function offQuitButton(_arg1:Event){
stickersAnims.mcQuit.gotoAndStop(1);
}
public function getPlayTimeLeft():Number{
return (playTimeLeft);
}
}
}//package src
Section 57
//Buttons (src.Buttons)
package src {
import flash.display.*;
import flash.events.*;
public class Buttons extends MovieClip {
public var mcQuitButton:MovieClip;
public var mcSoundButton:MovieClip;
public var mcMusicButton:MovieClip;
private var bompBomp:BompBomp;
public function Buttons(_arg1:BompBomp){
this.bompBomp = _arg1;
x = 27;
y = 503;
mcMusicButton.addEventListener(MouseEvent.CLICK, buttonClicked);
mcSoundButton.addEventListener(MouseEvent.CLICK, buttonClicked);
mcQuitButton.addEventListener(MouseEvent.CLICK, buttonClicked);
mcMusicButton.addEventListener(MouseEvent.MOUSE_OVER, buttonOver);
mcSoundButton.addEventListener(MouseEvent.MOUSE_OVER, buttonOver);
mcQuitButton.addEventListener(MouseEvent.MOUSE_OVER, buttonOver);
mcMusicButton.addEventListener(MouseEvent.MOUSE_OUT, buttonOut);
mcSoundButton.addEventListener(MouseEvent.MOUSE_OUT, buttonOut);
mcQuitButton.addEventListener(MouseEvent.MOUSE_OUT, buttonOut);
mcQuitButton.visible = false;
}
public function buttonClicked(_arg1:Event):void{
switch (_arg1.currentTarget){
case mcMusicButton:
bompBomp.musicButtonClicked();
break;
case mcSoundButton:
bompBomp.sfxButtonClicked();
break;
case mcQuitButton:
bompBomp.quitButtonClicked();
break;
};
}
public function buttonOver(_arg1:Event):void{
switch (_arg1.currentTarget){
case mcMusicButton:
mcMusicButton.gotoAndStop((mcMusicButton.currentFrame + 1));
break;
case mcSoundButton:
mcSoundButton.gotoAndStop((mcSoundButton.currentFrame + 1));
break;
case mcQuitButton:
mcQuitButton.gotoAndStop((mcQuitButton.currentFrame + 1));
break;
};
}
public function buttonOut(_arg1:Event):void{
switch (_arg1.currentTarget){
case mcMusicButton:
mcMusicButton.gotoAndStop((mcMusicButton.currentFrame - 1));
break;
case mcSoundButton:
mcSoundButton.gotoAndStop((mcSoundButton.currentFrame - 1));
break;
case mcQuitButton:
mcQuitButton.gotoAndStop((mcQuitButton.currentFrame - 1));
break;
};
}
}
}//package src
Section 58
//Explosion (src.Explosion)
package src {
import flash.display.*;
public class Explosion extends MovieClip {
public var mcYellow:MovieClip;
public var mcBlue:MovieClip;
public var mcPink:MovieClip;
private var xPos:Number;
private var yPos:Number;
private var animAt:Number;// = 1
private var animTo:Number;// = 1
private var animEnd:Number;
private var target:MovieClip;
private var delay:Number;
private var type:Number;
public function Explosion(_arg1:Game, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number){
this.xPos = _arg3;
this.yPos = _arg2;
this.delay = (_arg5 * 2);
this.type = _arg4;
mcPink.visible = false;
mcBlue.visible = false;
mcYellow.visible = false;
switch (_arg4){
case 0:
target = mcBlue;
break;
case 1:
target = mcPink;
break;
case 2:
target = mcYellow;
break;
};
animEnd = 30;
}
public function tick(_arg1:Number):Boolean{
if (delay > 0){
delay--;
return (false);
};
animTo = (animTo + 2);
if (animTo >= animEnd){
return (true);
};
return (false);
}
public function render(_arg1:Number, _arg2:Number):void{
if (delay == 0){
x = xPos;
y = yPos;
if (!target.visible){
target.visible = true;
};
if (animAt != animTo){
target.gotoAndStop(animTo);
animAt = animTo;
};
};
}
}
}//package src
Section 59
//Game (src.Game)
package src {
import src.sound.*;
import flash.display.*;
import src.timing.*;
import flash.events.*;
import src.comm.*;
import src.math.*;
import flash.utils.*;
import flash.external.*;
import flash.filters.*;
public class Game extends MovieClip implements Timeable {
public var bompsLayer:MovieClip;
private var gameState;
private var bompBomp_:BompBomp;
private var noOfBompTypes;
private var noOfTimes:Number;
private var bompArr:Array;
private var bombArr:Array;
private var markedPiece:Piece;// = null
private var explosionArr:Array;
private var scoreArr:Array;
private var blingArr:Array;
private var visualExplsionArr:Array;
private var noOfMoving:Number;// = 0
private var score:Number;// = 0
private var noOfBomps:Number;// = -81
private var bombTick:Boolean;// = false
private var bombTickNum:Number;
private var explosionTypeCounter:Number;// = 0
private var animationHandler:AnimationHandler;
private var sprayCan:SprayCan;
private var rewind:Rewind;
private var rewindEffect:RewindEffect;
private var rewindCounter:Number;// = 0
private var noOfCombos:Number;// = 0
private var playMatchSound:Boolean;// = true
private var matchSoundCounter:Number;// = 0
private var noOfBompsOneMove:Number;// = 0
private var noOfColorBombsOneMove:Number;// = 0
private var switching;// = false
private var clientStarBombsDetonated:Number;
private var clientColorBombsDetonated:Number;
private var clientBompsCleared:Number;
private var clientChainCombosMade:Number;
private var clientTopScored:Number;
private var clientMonsterCombo:Number;
private var clientHelicopterCombo:Number;
private var clientBlueBompTimer:Number;
private var clientQuadStarCombo:Number;
private var clientTripsColorBomb:Number;
private var gameOverCounter:Number;// = 0
private var starBombAnimArr:Array;
private var communicator:Communicator;
private var currentTick:Number;
private var timeIsUp:Boolean;// = false
public var musicManager:SoundManager;
public var sfxManager:SoundManager;
private var allowMove;// = true
private var colorBombText:String;
private static var STATE_RUNNING = 0;
private static var STATE_OUTRO = 1;
private static var GRID_SIZE = 9;
private static var BASE_NUMBER_OF_BOMP_TYPES = 3;
private static var TICKS_PER_SEC = 25;
private static var BOMB_PERCENT:Array = new Array(4, 4, 5, 6, 7, 8);
private static var STAR_PERCENT:Array = new Array(8, 8, 10, 10, 10, 10);
private static var NUM_SYMBOLS:Number = 1200;
private static var SERIES_LENGTH:Number = 200;
public function Game(_arg1:BompBomp, _arg2:SoundManager, _arg3:SoundManager, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number, _arg10:Number, _arg11:Number, _arg12:Number, _arg13:Number, _arg14:Communicator, _arg15:Number, _arg16:String){
noOfBompTypes = BASE_NUMBER_OF_BOMP_TYPES;
scoreArr = new Array();
blingArr = new Array();
visualExplsionArr = new Array();
starBombAnimArr = new Array();
super();
this.clientStarBombsDetonated = _arg4;
this.clientColorBombsDetonated = _arg5;
this.clientBompsCleared = _arg6;
this.clientChainCombosMade = _arg7;
this.clientTopScored = _arg8;
this.clientHelicopterCombo = _arg9;
this.clientMonsterCombo = _arg10;
this.clientBlueBompTimer = _arg11;
this.clientQuadStarCombo = _arg12;
this.clientTripsColorBomb = _arg13;
this.communicator = _arg14;
this.currentTick = _arg15;
this.colorBombText = _arg16;
bompBomp_ = _arg1;
animationHandler = new AnimationHandler();
noOfTimes = 0;
bombArr = new Array();
rewind = new Rewind();
addChild(rewind);
rewind.mouseEnabled = false;
rewind.mcRewindBox.mouseEnabled = false;
rewind.x = 616;
rewind.y = 432;
rewind.mcRewindButton.addEventListener(MouseEvent.MOUSE_DOWN, rewindClicked);
rewind.mcRewindButton.mcBlink.gotoAndStop(1);
createBoard();
this.musicManager = _arg2;
this.sfxManager = _arg3;
gameState = STATE_RUNNING;
}
public function tick(_arg1:Number):void{
var _local2:*;
var _local3:*;
currentTick = _arg1;
animationHandler.tick();
switch (gameState){
case STATE_RUNNING:
if (noOfMoving == 0){
bompBomp_.startClock();
checkForExplosion();
explosionTypeCounter = 0;
explodeBoard();
collapseBoard();
if (switching){
bombTickNum = 2;
if (explosionArr.length > 0){
bombTickNum = 1;
};
if (bombTickNum == 2){
score = Math.max((score - 11), 0);
bompBomp_.updateScoreSign(score);
};
} else {
if (((bombTick) && ((noOfMoving == 0)))){
manageBombs(bombTickNum);
};
};
if (((timeIsUp) && ((noOfMoving == 0)))){
_local2 = 0;
while (_local2 < bompArr.length) {
_local3 = 0;
while (_local3 < bompArr.length) {
bompArr[_local2][_local3].visCounter--;
if (bompArr[_local2][_local3].visCounter == 0){
bompArr[_local2][_local3].visible = false;
};
_local3++;
};
_local2++;
};
realGameOver();
};
setScore();
switching = false;
if (noOfMoving == 0){
allowMove = true;
};
};
_local2 = 0;
while (_local2 < bompArr.length) {
_local3 = 0;
while (_local3 < bompArr.length) {
if (bompArr[_local2][_local3] != null){
bompArr[_local2][_local3].tick(_arg1);
};
_local3++;
};
_local2++;
};
_local2 = 0;
while (_local2 < scoreArr.length) {
if (scoreArr[_local2].tick(_arg1)){
removeChild(scoreArr[_local2]);
scoreArr.splice(_local2, 1);
_local2--;
};
_local2++;
};
_local2 = 0;
while (_local2 < visualExplsionArr.length) {
if (visualExplsionArr[_local2].tick(_arg1)){
removeChild(visualExplsionArr[_local2]);
visualExplsionArr.splice(_local2, 1);
_local2--;
};
_local2++;
};
break;
case STATE_OUTRO:
clearBoard();
_local2 = 0;
while (_local2 < bompArr.length) {
_local3 = 0;
while (_local3 < bompArr.length) {
bompArr[_local2][_local3].visCounter--;
if (bompArr[_local2][_local3].visCounter == 0){
bompArr[_local2][_local3].visible = false;
};
_local3++;
};
_local2++;
};
gameOverCounter--;
if (gameOverCounter == 0){
realGameOver();
};
break;
};
}
public function render(_arg1:Number, _arg2:Number):void{
var _local3:*;
var _local4:*;
animationHandler.render();
if ((Math.floor((rewindCounter / 50)) + 1) != rewind.mcRewindBox.currentFrame){
rewind.mcRewindBox.gotoAndStop(Number((Math.floor((rewindCounter / 50)) + 1)));
if (Number((Math.floor((rewindCounter / 50)) + 1)) == 5){
rewind.mcRewindButton.mcBlink.gotoAndPlay(2);
};
};
if (((!((sprayCan == null))) && ((sprayCan.currentFrame == sprayCan.totalFrames)))){
removeChild(sprayCan);
sprayCan = null;
};
_local3 = 0;
while (_local3 < starBombAnimArr.length) {
if (starBombAnimArr[_local3].mcStar.currentFrame == starBombAnimArr[_local3].mcStar.totalFrames){
removeChild(starBombAnimArr[_local3]);
starBombAnimArr.splice(_local3, 1);
};
_local3++;
};
if (((!((rewindEffect == null))) && ((rewindEffect.currentFrame == rewindEffect.totalFrames)))){
removeChild(rewindEffect);
rewindEffect = null;
};
switch (gameState){
case STATE_RUNNING:
_local3 = 0;
while (_local3 < bompArr.length) {
_local4 = 0;
while (_local4 < bompArr.length) {
if (bompArr[_local3][_local4] != null){
bompArr[_local3][_local4].render(_arg1, _arg2);
};
_local4++;
};
_local3++;
};
_local3 = 0;
while (_local3 < scoreArr.length) {
scoreArr[_local3].render(_arg1, _arg2);
_local3++;
};
_local3 = 0;
while (_local3 < visualExplsionArr.length) {
visualExplsionArr[_local3].render(_arg1, _arg2);
_local3++;
};
_local3 = 0;
while (_local3 < blingArr.length) {
if (blingArr[_local3].currentFrame == blingArr[_local3].totalFrames){
removeChild(blingArr[_local3]);
blingArr.splice(_local3, 1);
};
_local3++;
};
break;
};
}
public function timeUp():void{
timeIsUp = true;
}
public function createBoard():void{
var _local3:*;
var _local4:*;
noOfTimes++;
trace("createBoard");
var _local1:* = new Array();
var _local2:* = 0;
while (_local2 < GRID_SIZE) {
_local3 = new Array();
_local4 = 0;
while (_local4 < GRID_SIZE) {
_local3.push(getRandom(noOfBompTypes));
_local4++;
};
_local1[_local2] = _local3;
_local2++;
};
if (checkStartBoard(_local1)){
createBoardObj(_local1);
} else {
createBoard();
};
}
public function checkStartBoard(_arg1:Array):Boolean{
var _local3:*;
var _local2:* = 0;
while (_local2 < GRID_SIZE) {
_local3 = 0;
while (_local3 < GRID_SIZE) {
if (_local2 < (GRID_SIZE - 2)){
if ((((_arg1[_local2][_local3] == _arg1[(_local2 + 1)][_local3])) && ((_arg1[_local2][_local3] == _arg1[(_local2 + 2)][_local3])))){
return (false);
};
};
if (_local3 < (GRID_SIZE - 2)){
if ((((_arg1[_local2][_local3] == _arg1[_local2][(_local3 + 1)])) && ((_arg1[_local2][_local3] == _arg1[_local2][(_local3 + 2)])))){
return (false);
};
};
_local3++;
};
_local2++;
};
return (true);
}
public function createBoardObj(_arg1:Array):void{
var _local4:Array;
var _local7:*;
var _local8:*;
var _local2:Number = 91;
var _local3:Number = 1;
bompArr = new Array();
var _local5:* = 0;
var _local6:* = 0;
while (_local6 < _arg1.length) {
_local4 = new Array();
if ((_local6 % 2) == 1){
_local2 = (_local2 - 10);
} else {
_local2 = (_local2 - 8);
};
_local3 = (_local3 * -1);
_local7 = 0;
while (_local7 < _arg1[_local6].length) {
_local2 = (_local2 + _local3);
_local8 = createPiece(_arg1[_local6][_local7], _local6, _local7, _local2, _local5);
bompsLayer.addChild(_local8);
_local4[_local7] = _local8;
_local5++;
_local7++;
};
bompArr[_local6] = _local4;
_local6++;
};
}
public function pieceClicked(_arg1:Number, _arg2:Number, _arg3:Number):void{
trace("pieceClicked");
if (((!(allowMove)) || (timeIsUp))){
return;
};
communicator.pieceClicked((currentTick + 1), _arg1, _arg2);
if ((((((((_arg1 < 0)) || ((_arg1 >= GRID_SIZE)))) || ((_arg2 < 0)))) || ((_arg2 >= GRID_SIZE)))){
markedPiece.unMark();
removeGlow(markedPiece);
markedPiece = null;
return;
};
var _local4:* = bompArr[_arg2][_arg1];
if (((!((markedPiece == null))) && ((_local4 == markedPiece)))){
markedPiece.unMark();
removeGlow(markedPiece);
markedPiece = null;
return;
};
if (markedPiece == null){
markedPiece = _local4;
markedPiece.mark();
addGlow(markedPiece);
return;
};
noOfCombos = 0;
noOfBompsOneMove = 0;
noOfColorBombsOneMove = 0;
if ((((((((markedPiece.getGridPosX() >= (_local4.getGridPosX() - 1))) && ((markedPiece.getGridPosX() <= (_local4.getGridPosX() + 1))))) && ((markedPiece.getGridPosY() == _local4.getGridPosY())))) || ((((((markedPiece.getGridPosY() >= (_local4.getGridPosY() - 1))) && ((markedPiece.getGridPosY() <= (_local4.getGridPosY() + 1))))) && ((markedPiece.getGridPosX() == _local4.getGridPosX())))))){
switchPieces(markedPiece, _local4);
removeGlow(markedPiece);
markedPiece = null;
bombTick = true;
} else {
markedPiece.unMark();
removeGlow(markedPiece);
markedPiece = null;
return;
};
}
public function rewindClicked(_arg1:Event):void{
var _local2:*;
if (!allowMove){
return;
};
if (rewindCounter > 199){
communicator.rewindClicked((currentTick + 1));
rewindCounter = 0;
rewind.mcRewindButton.mcBlink.gotoAndStop(1);
sfxManager.get("Rewind").play();
animationHandler.addAnimation(rewind.mcRewindButton, 0, false, 2);
_local2 = 0;
while (_local2 < bombArr.length) {
if (bombArr[_local2].getStatus("bomb")){
bombArr[_local2].resetBombTimer();
};
_local2++;
};
rewindEffect = new RewindEffect();
addChild(rewindEffect);
animationHandler.addAnimation(rewindEffect, 0, false, 1);
};
}
public function switchPieces(_arg1:Piece, _arg2:Piece):void{
trace(("BUG switch " + currentTick));
switching = true;
sfxManager.get("switch").play();
_arg1.unMark();
_arg2.unMark();
var _local3:Number = _arg1.getGridPosX();
var _local4:Number = _arg1.getGridPosY();
bompArr[_arg2.getGridPosY()][_arg2.getGridPosX()] = _arg1;
bompArr[_local4][_local3] = _arg2;
_arg1.goto(_arg2.getGridPosX(), _arg2.getGridPosY(), 0, false);
_arg2.goto(_local3, _local4, 0, false);
}
public function checkForStarExplosion():void{
var _local1:*;
var _local2:*;
var _local3:Array;
var _local4:*;
var _local5:*;
_local1 = 0;
while (_local1 < GRID_SIZE) {
_local2 = 0;
while (_local2 < GRID_SIZE) {
if (_local2 < (GRID_SIZE - 2)){
_local3 = new Array();
_local3.push(bompArr[_local1][_local2]);
_local4 = (_local2 + 1);
while (_local4 < GRID_SIZE) {
if (((((bompArr[_local1][_local2].getStatus("star")) && (bompArr[_local1][_local4].getStatus("star")))) && (!(bompArr[_local1][_local4].getHorizontalCFE())))){
_local3.push(bompArr[_local1][_local4]);
} else {
break;
};
_local4++;
};
if (_local3.length > 2){
explosionArr.push(_local3);
_local5 = 0;
while (_local5 < _local3.length) {
_local3[_local5].setHorizontalCFE();
_local3[_local5].setExplode();
_local5++;
};
};
};
if (_local1 < (GRID_SIZE - 2)){
_local3 = new Array();
_local3.push(bompArr[_local1][_local2]);
_local4 = (_local1 + 1);
while (_local4 < GRID_SIZE) {
if (((((bompArr[_local1][_local2].getStatus("star")) && (bompArr[_local4][_local2].getStatus("star")))) && (!(bompArr[_local4][_local2].getVerticalCFE())))){
_local3.push(bompArr[_local4][_local2]);
} else {
break;
};
_local4++;
};
if (_local3.length > 2){
explosionArr.push(_local3);
_local5 = 0;
while (_local5 < _local3.length) {
_local3[_local5].setVerticalCFE();
_local3[_local5].setExplode();
_local5++;
};
};
};
_local2++;
};
_local1++;
};
_local1 = 0;
while (_local1 < GRID_SIZE) {
_local2 = 0;
while (_local2 < GRID_SIZE) {
bompArr[_local1][_local2].resetHorizontalCFE();
bompArr[_local1][_local2].resetVerticalCFE();
_local2++;
};
_local1++;
};
}
public function checkForExplosion():void{
var _local1:*;
var _local2:*;
var _local3:Array;
var _local4:*;
var _local5:*;
var _local6:Boolean;
var _local7:Boolean;
var _local8:*;
var _local9:*;
playMatchSound = true;
explosionArr = new Array();
checkForStarExplosion();
_local1 = 0;
while (_local1 < GRID_SIZE) {
_local2 = 0;
while (_local2 < GRID_SIZE) {
if (_local2 < (GRID_SIZE - 2)){
_local3 = new Array();
_local3.push(bompArr[_local1][_local2]);
_local3 = new Array();
_local3.push(bompArr[_local1][_local2]);
_local4 = (_local2 + 1);
while (_local4 < GRID_SIZE) {
if ((((bompArr[_local1][_local2].getType() == bompArr[_local1][_local4].getType())) && (!(bompArr[_local1][_local4].getHorizontalCFE())))){
_local3.push(bompArr[_local1][_local4]);
} else {
break;
};
_local4++;
};
if (_local3.length > 2){
explosionArr.push(_local3);
_local5 = 0;
while (_local5 < _local3.length) {
_local3[_local5].setHorizontalCFE();
_local3[_local5].setExplode();
_local5++;
};
};
};
if (_local1 < (GRID_SIZE - 2)){
_local3 = new Array();
_local3.push(bompArr[_local1][_local2]);
_local3 = new Array();
_local3.push(bompArr[_local1][_local2]);
_local4 = (_local1 + 1);
while (_local4 < GRID_SIZE) {
if ((((bompArr[_local1][_local2].getType() == bompArr[_local4][_local2].getType())) && (!(bompArr[_local4][_local2].getVerticalCFE())))){
_local3.push(bompArr[_local4][_local2]);
} else {
break;
};
_local4++;
};
if (_local3.length > 2){
explosionArr.push(_local3);
_local5 = 0;
while (_local5 < _local3.length) {
_local3[_local5].setVerticalCFE();
_local3[_local5].setExplode();
_local5++;
};
};
};
_local2++;
};
_local1++;
};
if (explosionArr.length > 0){
_local1 = 0;
while (_local1 < explosionArr.length) {
_local2 = 0;
while (_local2 < (explosionArr[_local1].length - 2)) {
if (((((explosionArr[_local1][_local2].getStatus("star")) && (explosionArr[_local1][(_local2 + 1)].getStatus("star")))) && (explosionArr[_local1][(_local2 + 2)].getStatus("star")))){
createStarBombAnim();
clientStarBombsDetonated++;
starExplosion(explosionArr[_local1][_local2]);
starExplosion(explosionArr[_local1][(_local2 + 1)]);
starExplosion(explosionArr[_local1][(_local2 + 2)]);
};
_local2++;
};
_local6 = false;
_local7 = false;
_local2 = 0;
while (_local2 < explosionArr[_local1].length) {
if (explosionArr[_local1][_local2].getStatus("star")){
_local6 = true;
};
if (explosionArr[_local1][_local2].getStatus("bomb")){
_local7 = true;
};
_local2++;
};
if (((_local6) && (_local7))){
clientColorBombsDetonated++;
noOfColorBombsOneMove++;
if (noOfColorBombsOneMove > clientTripsColorBomb){
clientTripsColorBomb = noOfColorBombsOneMove;
};
sfxManager.get("colorBomb").play();
sfxManager.get("spray").play();
createSprayCan();
_local8 = 0;
while (_local8 < GRID_SIZE) {
_local9 = 0;
while (_local9 < GRID_SIZE) {
if (bompArr[_local8][_local9].getType() == explosionArr[_local1][0].getType()){
bompArr[_local8][_local9].setExplode();
};
_local9++;
};
_local8++;
};
};
_local1++;
};
} else {
matchSoundCounter = 0;
};
}
public function createStarBombAnim():void{
var _local2:*;
var _local3:DropShadowFilter;
trace("createStarBombAnim()");
var _local1:* = 0;
while (_local1 < 4) {
_local2 = new StarBombAnimation();
addChild(_local2);
_local2.x = (Math.random() * 150);
_local2.y = (Math.random() * 300);
_local2.gotoAndStop(Math.ceil((Math.random() * 4)));
animationHandler.addAnimation(_local2.mcStar, (_local1 * 3), false, 1);
starBombAnimArr.push(_local2);
_local3 = new DropShadowFilter();
_local3.distance = 5;
_local3.alpha = 1;
_local3.blurX = 5;
_local3.blurY = 5;
_local3.angle = 45;
_local3.strength = 0.8;
_local2.filters = [_local3];
_local1++;
};
}
public function createSprayCan():void{
if (sprayCan == null){
trace("createSprayCan");
sprayCan = new SprayCan();
addChild(sprayCan);
sprayCan.mcColorBomb.txtColorBomb.text = colorBombText.toUpperCase();
sprayCan.x = -243;
sprayCan.y = -17;
sprayCan.width = 207;
sprayCan.height = 401;
animationHandler.addAnimation(sprayCan, 0, false, 1);
};
}
public function starExplosion(_arg1:Piece):void{
var _local2:* = _arg1.getGridPosX();
var _local3:* = _arg1.getGridPosY();
var _local4:* = Math.max((_local2 - 1), 0);
var _local5:* = Math.max((_local3 - 1), 0);
var _local6:* = Math.min((_local2 + 1), (GRID_SIZE - 1));
var _local7:* = Math.min((_local3 + 1), (GRID_SIZE - 1));
bompArr[_local5][_local4].setExplode();
bompArr[_local5][_local2].setExplode();
bompArr[_local5][_local6].setExplode();
bompArr[_local3][_local4].setExplode();
bompArr[_local3][_local6].setExplode();
bompArr[_local7][_local4].setExplode();
bompArr[_local7][_local2].setExplode();
bompArr[_local7][_local6].setExplode();
}
public function setScore():void{
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:Number;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
_local1 = 0;
while (_local1 < explosionArr.length) {
_local2 = 0;
while (_local2 < explosionArr[_local1].length) {
if (!explosionArr[_local1][_local2].getStatus("star")){
break;
};
if (_local2 == (explosionArr[_local1].length - 1)){
if (explosionArr[_local1].length > 3){
clientQuadStarCombo++;
};
_local3 = (explosionArr[_local1].length * 500);
score = (score + _local3);
bompBomp_.updateScoreSign(score);
sfxManager.get("starCombo").play(0.8);
_local4 = new Bling();
addChild(_local4);
_local4.x = explosionArr[_local1][0].x;
_local4.y = explosionArr[_local1][0].y;
blingArr.push(_local4);
animationHandler.addAnimation(_local4, 0, false, 1);
createScorePop(_local3, explosionArr[_local1][0].getType(), explosionArr[_local1][Math.round((explosionArr[_local1].length / 2))].getPosX(), explosionArr[_local1][Math.round((explosionArr[_local1].length / 2))].getPosY());
explosionArr.splice(_local1, 1);
_local1--;
break;
};
_local2++;
};
_local1++;
};
_local1 = 0;
while (_local1 < explosionArr.length) {
_local2 = 0;
while (_local2 < (explosionArr[_local1].length - 2)) {
_local5 = 0;
_local5 = (_local5 + explosionArr[_local1][_local2].returnSum());
_local5 = (_local5 + explosionArr[_local1][(_local2 + 1)].returnSum());
_local5 = (_local5 + explosionArr[_local1][(_local2 + 2)].returnSum());
if (_local5 == 7){
_local6 = 0;
while (_local6 < GRID_SIZE) {
_local7 = 0;
while (_local7 < GRID_SIZE) {
if (bompArr[_local6][_local7].getType() == explosionArr[_local1][_local2].getType()){
bompArr[_local6][_local7].setExplode();
};
_local7++;
};
_local6++;
};
score = (score + 1000);
bompBomp_.updateScoreSign(score);
createScorePop(1000, explosionArr[_local1][0].getType(), explosionArr[_local1][Math.round((explosionArr[_local1].length / 2))].getPosX(), explosionArr[_local1][Math.round((explosionArr[_local1].length / 2))].getPosY());
explosionArr.splice(_local1, 1);
_local1--;
break;
};
_local2++;
};
_local1++;
};
_local1 = 0;
while (_local1 < explosionArr.length) {
trace(("BUG explode " + currentTick));
_local8 = 0;
_local9 = 0;
_local2 = 0;
while (_local2 < explosionArr[_local1].length) {
if (explosionArr[_local1][_local2].getStatus("star")){
_local8 = (_local8 + 2);
};
if (explosionArr[_local1][_local2].getStatus("bomb")){
_local9 = (_local9 + 200);
};
_local2++;
};
_local3 = ((explosionArr[_local1].length - 2) * 50);
_local3 = (_local3 + _local9);
_local3 = (_local3 * Math.max(1, _local8));
_local3 = (_local3 + (50 * noOfCombos));
score = (score + _local3);
bompBomp_.updateScoreSign(score);
createScorePop(_local3, explosionArr[_local1][0].getType(), explosionArr[_local1][Math.round((explosionArr[_local1].length / 2))].getPosX(), explosionArr[_local1][Math.round((explosionArr[_local1].length / 2))].getPosY());
noOfCombos++;
if (noOfCombos > 1){
clientChainCombosMade++;
};
_local1++;
};
}
public function createScorePop(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
if (playMatchSound){
sfxManager.get(("combo" + matchSoundCounter)).play();
matchSoundCounter = Math.min((matchSoundCounter + 1), 4);
playMatchSound = false;
};
var _local5:* = new ScorePop(_arg1, _arg2, _arg3, _arg4);
addChild(_local5);
scoreArr.push(_local5);
}
public function explodeBoard():void{
var _local2:*;
var _local1:* = 0;
while (_local1 < GRID_SIZE) {
_local2 = 0;
while (_local2 < GRID_SIZE) {
if (bompArr[_local1][_local2].getExplode()){
createExplosion(bompArr[_local1][_local2].getPosY(), bompArr[_local1][_local2].getPosX());
bompsLayer.removeChild(bompArr[_local1][_local2]);
bompArr[_local1][_local2] = null;
};
_local2++;
};
_local1++;
};
}
public function createExplosion(_arg1, _arg2):void{
clientBompsCleared++;
rewindCounter++;
explosionTypeCounter++;
noOfBompsOneMove++;
if (noOfBompsOneMove > clientHelicopterCombo){
clientHelicopterCombo = noOfBompsOneMove;
};
if (noOfBompsOneMove > clientMonsterCombo){
clientMonsterCombo = noOfBompsOneMove;
};
var _local3:* = new Explosion(this, _arg1, _arg2, (explosionTypeCounter % 3), (explosionTypeCounter % 5));
visualExplsionArr.push(_local3);
addChild(_local3);
setChildIndex(_local3, 1);
}
public function collapseBoard():void{
var _local4:*;
var _local5:*;
var _local6:*;
var _local1:* = 5;
var _local2:Number = 9999;
var _local3:* = (GRID_SIZE - 1);
while (_local3 >= 0) {
_local4 = 0;
while (_local4 < GRID_SIZE) {
if (bompArr[_local3][_local4] == null){
_local5 = _local3;
while (_local5 >= 0) {
if (bompArr[_local5][_local4] != null){
if (_local2 == 9999){
_local2 = _local4;
};
bompArr[_local3][_local4] = bompArr[_local5][_local4];
bompArr[_local3][_local4].goto(_local4, _local3, ((_local4 - _local2) + 5), true);
bompArr[_local5][_local4] = null;
_local5 = 0;
} else {
if (_local5 == 0){
if (_local2 == 9999){
_local2 = _local4;
};
_local6 = createPiece(9999, _local3, _local4, _local1, 99);
bompsLayer.addChild(_local6);
bompArr[_local3][_local4] = _local6;
_local1++;
};
};
_local5--;
};
};
_local4++;
};
_local3--;
};
}
public function createPiece(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Piece{
var _local9:*;
var _local10:*;
if (_arg1 == 9999){
_arg1 = getRandom(noOfBompTypes);
};
var _local6:Boolean;
var _local7:Boolean;
if (noOfBomps > 0){
_local9 = Math.min(Math.floor(((noOfBomps + 81) / SERIES_LENGTH)), (BOMB_PERCENT.length - 1));
_local10 = getRandom(100);
if (_local10 < BOMB_PERCENT[_local9]){
_local6 = true;
} else {
if (_local10 < (BOMB_PERCENT[_local9] + STAR_PERCENT[_local9])){
_local7 = true;
};
};
};
var _local8:* = new Piece(this, _arg1, _arg2, _arg3, _arg4, _arg5, _local7, _local6, animationHandler);
if (_local6){
bombArr.push(_local8);
};
noOfBomps++;
if (noOfBomps == 200){
bompBomp_.blueBomp();
};
return (_local8);
}
public function manageBombs(_arg1:Number):void{
bombArr = bombArr.filter(isAlive);
var _local2:* = 0;
while (_local2 < bombArr.length) {
bombArr[_local2].updateTimer(_arg1);
_local2++;
};
bombTick = false;
}
public function bombExplode(_arg1:Piece):void{
var _local3:*;
var _local4:*;
createBombExplosion(_arg1, 0);
var _local2:* = 0;
while (_local2 < bompArr.length) {
_local3 = 0;
while (_local3 < bompArr.length) {
_local4 = 0;
while (_local4 < bompArr[_local3].length) {
if ((((((((bompArr[_local3][_local4].getGridPosY() <= (_arg1.getGridPosY() + _local2))) && ((bompArr[_local3][_local4].getGridPosY() >= (_arg1.getGridPosY() - _local2))))) && ((bompArr[_local3][_local4].getGridPosX() <= (_arg1.getGridPosX() + _local2))))) && ((bompArr[_local3][_local4].getGridPosX() >= (_arg1.getGridPosX() - _local2))))){
if (!bompArr[_local3][_local4].endExpl){
createBombExplosion(bompArr[_local3][_local4], ((_local2 * 4) + 4));
bompArr[_local3][_local4].endExpl = true;
bompArr[_local3][_local4].visCounter = ((_local2 * 4) + 4);
};
};
_local4++;
};
_local3++;
};
_local2++;
};
gameOverCounter = 45;
sfxManager.get("explosion").play();
gameOver();
}
public function createBombExplosion(_arg1:Piece, _arg2:Number){
var _local3:* = new BombExplosion();
addChild(_local3);
_local3.x = (_arg1.x - 60);
_local3.y = (_arg1.y - 70);
animationHandler.addAnimation(_local3, _arg2, false, 1);
}
public function gameOver():void{
clearBoard();
gameState = STATE_OUTRO;
gameOverCounter++;
}
public function realGameOver():void{
bompBomp_.endGame(score, (noOfBomps * 3), clientStarBombsDetonated, clientColorBombsDetonated, clientBompsCleared, clientChainCombosMade, clientTopScored, clientHelicopterCombo, clientMonsterCombo, clientBlueBompTimer, clientQuadStarCombo, clientTripsColorBomb);
}
public function clearBoard(){
var _local1:* = 0;
while (_local1 < scoreArr.length) {
scoreArr[_local1].visible = false;
_local1++;
};
}
public function isAlive(_arg1, _arg2:int, _arg3:Array):Boolean{
return (_arg1.isAlive());
}
public function addMoving():void{
allowMove = false;
noOfMoving++;
}
public function removeMoving():void{
noOfMoving--;
}
public function getRandom(_arg1:Number):Number{
return (bompBomp_.getRandom(_arg1));
}
public function addGlow(_arg1:MovieClip):void{
var _local2:GlowFilter = new GlowFilter();
_local2.color = 0xFFFFFF;
_local2.blurY = 30;
_local2.blurX = 30;
_local2.strength = 5;
_local2.quality = 2;
_arg1.filters = [_local2];
}
public function removeGlow(_arg1:MovieClip):void{
_arg1.filters = [];
}
}
}//package src
Section 60
//Piece (src.Piece)
package src {
import flash.display.*;
import src.timing.*;
import flash.events.*;
import src.comm.*;
import src.math.*;
import flash.text.*;
import flash.utils.*;
import flash.external.*;
public class Piece extends MovieClip {
public var txtTimer:TextField;
public var mcFiller:MovieClip;
public var mcBomp:MovieClip;
private var game_:Game;
private var xFloat:IFloat;
private var yFloat:IFloat;
private var scaleFloat:IFloat;
private var xPos:Number;
private var yPos:Number;
private var type:Number;
private var gameState:Number;
private var xSpeed:Number;// = 1
private var ySpeed:Number;// = 1
private var gotoX:Number;
private var gotoY:Number;
private var delay:Number;
private var falling:Boolean;
private var scaleFactor:Number;// = 1
private var scaleFactorMod:Number;// = -1
private var write;// = false
private var marked:Boolean;// = false
private var drag:Boolean;// = false
private var gridPosY:Number;
private var gridPosX:Number;
private var markedX:Number;
private var markedY:Number;
public var id:Number;
private var moving:Boolean;// = false
private var verticalCFE:Boolean;// = false
private var horizontalCFE:Boolean;// = false
private var bompAnimAt;// = 1
private var bompAnimTo;// = 1
private var bompAnimMod;// = 0
private var isBomb:Boolean;// = false
private var isStar:Boolean;// = false
private var alive:Boolean;// = true
private var timer:Number;// = 9
private var explode:Boolean;// = false
private var mcBomb:MovieClip;
private var animationHandler:AnimationHandler;
public var endExpl:Boolean;// = false
public var visCounter:Number;
private var timerStarted;// = false
private static var STATE_RUNNING = 0;
private static var WIDTH = 50;
private static var HEIGHT = 50;
private static var MAX_SPEED = 40;
private static var TICKS_PER_SEC = 25;
public function Piece(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9){
addFrameScript(0, frame1);
game_ = _arg1;
xPos = ((_arg4 * WIDTH) + 300);
yPos = -30;
gotoX = ((_arg4 * WIDTH) + 300);
gotoY = ((_arg3 * HEIGHT) + 55);
xFloat = new IFloat(xPos);
yFloat = new IFloat(yPos);
scaleFloat = new IFloat(1);
this.id = _arg6;
this.gridPosX = _arg4;
this.gridPosY = _arg3;
this.type = _arg2;
this.delay = _arg5;
this.isBomb = _arg8;
this.isStar = _arg7;
this.animationHandler = _arg9;
gotoAndStop((_arg2 + 1));
visible = false;
falling = true;
if (_arg7){
bompAnimMod = 39;
bompAnimAt = 39;
bompAnimTo = 40;
};
if (_arg8){
bompAnimMod = 80;
bompAnimAt = 80;
bompAnimTo = 81;
};
if (_arg6 == 0){
write = true;
};
mcFiller.cachAsBitmap = true;
mcFiller.addEventListener(MouseEvent.MOUSE_DOWN, clicked);
mcFiller.addEventListener(MouseEvent.MOUSE_UP, noDrag);
game_.addMoving();
game_.addMoving();
moving = true;
gameState = STATE_RUNNING;
}
public function tick(_arg1:Number):void{
var _local2:*;
switch (gameState){
case STATE_RUNNING:
if (delay == 0){
if (drag){
if (mouseX < -30){
game_.pieceClicked((gridPosX - 1), gridPosY, id);
} else {
if (mouseX > 30){
game_.pieceClicked((gridPosX + 1), gridPosY, id);
} else {
if (mouseY < -30){
game_.pieceClicked(gridPosX, (gridPosY - 1), id);
} else {
if (mouseY > 30){
game_.pieceClicked(gridPosX, (gridPosY + 1), id);
};
};
};
};
};
_local2 = false;
if (yPos < gotoY){
yPos = Math.min((yPos + ySpeed), gotoY);
ySpeed = Math.min((ySpeed * 2), MAX_SPEED);
if ((((yPos == gotoY)) && (falling))){
_local2 = true;
game_.removeMoving();
};
};
if (yPos > gotoY){
yPos = Math.max((yPos - ySpeed), gotoY);
ySpeed = Math.min((ySpeed * 2), MAX_SPEED);
};
if (xPos < gotoX){
xPos = Math.min((xPos + xSpeed), gotoX);
xSpeed = Math.min((xSpeed * 2), MAX_SPEED);
if (bompAnimAt == (1 + bompAnimMod)){
bompAnimAt = (34 + bompAnimMod);
bompAnimTo = (35 + bompAnimMod);
} else {
bompAnimTo++;
bompAnimAt++;
};
};
if (xPos > gotoX){
xPos = Math.max((xPos - xSpeed), gotoX);
xSpeed = Math.min((xSpeed * 2), MAX_SPEED);
if (bompAnimAt == (1 + bompAnimMod)){
bompAnimAt = (25 + bompAnimMod);
bompAnimTo = (26 + bompAnimMod);
} else {
bompAnimTo++;
bompAnimAt++;
};
};
scaleFloat.set(scaleFactor);
if ((((scaleFactor < 1)) || (_local2))){
bompAnimTo = (bompAnimTo + 3);
bompAnimAt = Math.max((1 + bompAnimMod), (bompAnimTo - 3));
scaleFactor = (scaleFactor + (0.05 * scaleFactorMod));
yPos = (yPos + (((HEIGHT * 0.05) * scaleFactorMod) * -1));
gotoY = yPos;
if (scaleFactor <= 0.85){
scaleFactorMod = (scaleFactorMod * -1);
};
if (scaleFactor >= 1){
scaleFactor = 1;
scaleFactorMod = (scaleFactorMod * -1);
falling = false;
_local2 = false;
};
};
if ((((((((gotoY == yPos)) && ((gotoX == xPos)))) && (moving))) && ((scaleFactor == 1)))){
bompAnimTo = (1 + bompAnimMod);
moving = false;
game_.removeMoving();
};
} else {
delay--;
};
xFloat.set(xPos);
yFloat.set(yPos);
break;
};
}
public function render(_arg1:Number, _arg2:Number):void{
var _local3:*;
if (!visible){
visible = true;
};
if (x != xFloat.get(_arg2)){
x = xFloat.get(_arg2);
};
if (y != yFloat.get(_arg2)){
y = yFloat.get(_arg2);
};
if (scaleY != scaleFactor){
scaleY = scaleFloat.get(_arg2);
};
if (((!((mcBomp == null))) && (!((bompAnimAt == bompAnimTo))))){
if (bompAnimTo == (1 + bompAnimMod)){
mcBomp.gotoAndStop(Number((1 + bompAnimMod)));
bompAnimAt = (1 + bompAnimMod);
} else {
_local3 = (bompAnimAt + Math.round(((bompAnimAt - bompAnimAt) * _arg2)));
mcBomp.gotoAndStop(_local3);
if (_local3 == bompAnimTo){
bompAnimAt = bompAnimTo;
};
};
};
if (isBomb){
if (txtTimer.text != String(timer)){
txtTimer.text = String(timer);
};
};
}
public function clicked(_arg1:Event):void{
markedX = mouseX;
markedY = mouseY;
game_.pieceClicked(gridPosX, gridPosY, id);
}
public function mark():void{
marked = true;
drag = true;
}
public function unMark():void{
marked = false;
drag = false;
}
public function goto(_arg1, _arg2, _arg3, _arg4):void{
xSpeed = 4;
ySpeed = 4;
this.gridPosX = _arg1;
this.gridPosY = _arg2;
gotoX = ((gridPosX * WIDTH) + 300);
gotoY = ((gridPosY * HEIGHT) + 55);
this.delay = Math.max(_arg3, 0);
this.falling = _arg4;
moving = true;
game_.addMoving();
if (_arg4){
game_.addMoving();
};
}
public function noDrag(_arg1:Event):void{
drag = false;
}
public function getGridPosX():Number{
return (gridPosX);
}
public function getGridPosY():Number{
return (gridPosY);
}
public function getPosX():Number{
return (xPos);
}
public function getPosY():Number{
return (yPos);
}
public function getType():Number{
return (type);
}
public function getStatus(_arg1:String):Boolean{
switch (_arg1){
case "bomb":
if (isBomb){
return (true);
};
break;
case "star":
if (isStar){
return (true);
};
break;
case "normal":
if (((!(isBomb)) && (!(isStar)))){
return (true);
};
break;
};
return (false);
}
public function getRandom(_arg1:Number):Number{
return (game_.getRandom(_arg1));
}
public function getVerticalCFE():Boolean{
return (verticalCFE);
}
public function getHorizontalCFE():Boolean{
return (horizontalCFE);
}
public function setHorizontalCFE():void{
horizontalCFE = true;
}
public function setVerticalCFE():void{
verticalCFE = true;
}
public function resetHorizontalCFE():void{
horizontalCFE = false;
}
public function resetVerticalCFE():void{
verticalCFE = false;
}
public function isAlive():Boolean{
return (alive);
}
public function updateTimer(_arg1:Number):void{
if (isBomb){
if (!timerStarted){
timerStarted = true;
return;
};
if (((!((mcBomp == null))) && (!((mcBomp.mcBomb == null))))){
animationHandler.addAnimation(mcBomp.mcBomb, 0, false, 10);
};
timer = (timer - _arg1);
if (timer <= 0){
game_.bombExplode(this);
};
};
}
public function resetBombTimer(){
timer = 9;
}
public function getExplode():Boolean{
return (explode);
}
public function setExplode(){
alive = false;
explode = true;
}
public function returnSum():Number{
if (isBomb){
return (2);
};
if (isStar){
return (4);
};
return (1);
}
public function tracer(_arg1):void{
if (write){
trace(_arg1);
};
}
function frame1(){
stop();
}
}
}//package src
Section 61
//ScorePop (src.ScorePop)
package src {
import flash.display.*;
import src.timing.*;
import flash.events.*;
import src.comm.*;
import src.math.*;
import flash.utils.*;
import flash.external.*;
public class ScorePop extends MovieClip {
public var mcScore2:MovieClip;
public var mcScore3:MovieClip;
public var mcScore1:MovieClip;
private var gotoY:Number;
private var xPos:Number;
private var yPos:Number;
private var xFloat:IFloat;
private var yFloat:IFloat;
private var animAt;// = 1
private var animTo;// = 1
private var animEnd;
private var target:MovieClip;
public function ScorePop(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
this.xPos = _arg3;
this.yPos = _arg4;
mcScore1.visible = false;
mcScore2.visible = false;
mcScore3.visible = false;
if (_arg1 > 1000){
target = mcScore3;
} else {
if (_arg1 > 500){
target = mcScore2;
} else {
target = mcScore1;
};
};
target.visible = true;
target.mcScore.txtScore.text = String(_arg1);
animEnd = 36;
xFloat = new IFloat(_arg3);
yFloat = new IFloat(_arg4);
}
public function tick(_arg1:Number):Boolean{
animTo++;
if (animTo == animEnd){
return (true);
};
return (false);
}
public function render(_arg1:Number, _arg2:Number):void{
if (x != xFloat.get(_arg2)){
x = xFloat.get(_arg2);
};
if (y != yFloat.get(_arg2)){
y = yFloat.get(_arg2);
};
if (animAt != animTo){
target.gotoAndStop(animTo);
animAt = animTo;
};
}
}
}//package src
Section 62
//ScoreSign (src.ScoreSign)
package src {
import flash.display.*;
import flash.text.*;
public dynamic class ScoreSign extends MovieClip {
public var txtScore:TextField;
}
}//package src
Section 63
//StartAnims (src.StartAnims)
package src {
import flash.display.*;
import src.timing.*;
import flash.events.*;
import src.comm.*;
import src.math.*;
import flash.utils.*;
import flash.external.*;
public class StartAnims extends MovieClip {
public var Helicopter:MovieClip;
public var MerryGoRound:MovieClip;
public var City:MovieClip;
public var RecordPlayer:MovieClip;
public var BlueCloud:MovieClip;
public var SpaceWarp:MovieClip;
public var KingKong:MovieClip;
public var Rainbow_back_1:MovieClip;
public var Sphinx:MovieClip;
public var Godzilla:MovieClip;
public var Rainbow_back_2:MovieClip;
public var RainbowBigFront:MovieClip;
public var Rainbow_back_3:MovieClip;
public var Moln_1:MovieClip;
public var Arrows:MovieClip;
public var Radio:MovieClip;
public var GreenCloud:MovieClip;
public var PinkCloud:MovieClip;
public var CitySilhouette:MovieClip;
public var GhettoBlaster:MovieClip;
public var RainbowFront:MovieClip;
public var Tajmahal:MovieClip;
public var Synth:MovieClip;
private var animationArr:Array;
private var delayArr:Array;
private var stickersArr:Array;
private var delay:Number;// = 1
private var bompBomp:BompBomp;
public function StartAnims(_arg1:Array, _arg2:BompBomp){
this.bompBomp = _arg2;
x = 379;
y = 293;
animationArr = new Array(Helicopter, GhettoBlaster, RecordPlayer, Arrows, Rainbow_back_1, Rainbow_back_2, Rainbow_back_3, Moln_1, Sphinx, Tajmahal, MerryGoRound, GreenCloud, RainbowFront, PinkCloud, BlueCloud, KingKong, CitySilhouette, Godzilla, RainbowBigFront, Synth);
delayArr = new Array(30, 0, 10, 30, 0, 20, 40, 0, 40, 60, 20, 0, 0, 0, 0, 30, 0, 0, 20, 0, 40);
var _local3:* = 0;
while (_local3 < animationArr.length) {
animationArr[_local3].visible = false;
animationArr[_local3].gotoAndStop(1);
_local3++;
};
SpaceWarp.visible = false;
SpaceWarp.gotoAndStop(1);
City.visible = false;
City.gotoAndStop(1);
parseAnimationData(_arg1);
}
public function parseAnimationData(_arg1:Array):void{
var _local2:* = 0;
while (_local2 < 20) {
addAnimation(_local2, _arg1[_local2], false, 1);
_local2++;
};
}
public function addAnimation(_arg1:Number, _arg2:Number, _arg3:Boolean, _arg4:Number):void{
if (_arg2 == 1){
bompBomp.addAnimation(animationArr[_arg1], delayArr[_arg1], _arg3, _arg4);
if (_arg1 == 1){
Radio.visible = false;
};
if (_arg1 == 16){
City.visible = true;
};
} else {
if (_arg2 == 2){
if (_arg1 == 0){
};
};
};
}
}
}//package src
Section 64
//StickersAnims (src.StickersAnims)
package src {
import flash.display.*;
import src.timing.*;
import flash.events.*;
import src.comm.*;
import src.math.*;
import flash.utils.*;
import flash.external.*;
public class StickersAnims extends MovieClip {
public var Crown:MovieClip;
public var Sneaker:MovieClip;
public var Diamond:MovieClip;
public var ChainGuy:MovieClip;
public var Rainbow:MovieClip;
public var Cassette:MovieClip;
public var Prism:MovieClip;
public var mc10000:MovieClip;
public var mcQuit:MovieClip;
public var Hamburger:MovieClip;
public var DummySticker:MovieClip;
public var Needle:MovieClip;
public var Chain:MovieClip;
public var mc100000:MovieClip;
public var mc1000:MovieClip;
public var MusicNote:MovieClip;
public var PotOGold:MovieClip;
public var Planet:MovieClip;
public var Monsters:MovieClip;
public var Glasses:MovieClip;
public var Flash:MovieClip;
public var VinylSaw:MovieClip;
public var Trophy:MovieClip;
public var Star:MovieClip;
private var animationArr:Array;
private var delayArr:Array;
private var stickersArr:Array;
private var delay:Number;// = 1
private var bompBomp:BompBomp;
private var startAnimsArr:Array;
public function StickersAnims(_arg1:Array, _arg2:BompBomp, _arg3:Array){
trace(_arg1);
trace(_arg3);
this.startAnimsArr = _arg3;
this.bompBomp = _arg2;
x = 374;
y = 303;
animationArr = new Array(mc10000, Cassette, Needle, MusicNote, Prism, PotOGold, Glasses, DummySticker, DummySticker, DummySticker, DummySticker, DummySticker, Rainbow, DummySticker, DummySticker, Monsters, mc1000, mc100000, DummySticker, VinylSaw, Chain, ChainGuy, Star, Trophy, Crown, Sneaker, Hamburger, Diamond, Flash, Planet);
var _local4:* = 0;
while (_local4 < animationArr.length) {
animationArr[_local4].gotoAndStop(1);
animationArr[_local4].id = _local4;
animationArr[_local4].mouseChildren = false;
animationArr[_local4].addEventListener(MouseEvent.MOUSE_OVER, showBubble);
animationArr[_local4].addEventListener(MouseEvent.MOUSE_OUT, hideBubble);
if (animationArr[_local4] != DummySticker){
animationArr[_local4].mcText.gotoAndStop(1);
animationArr[_local4].mcText.mcYellow.visible = false;
animationArr[_local4].mcText.visible = false;
};
_local4++;
};
parseAnimationData(_arg1);
}
public function parseAnimationData(_arg1:Array):void{
var _local3:String;
var _local4:String;
var _local5:String;
var _local2:* = 0;
while (_local2 < animationArr.length) {
if (animationArr[_local2] != DummySticker){
addAnimation(_local2, _arg1[_local2], false, 1);
_local3 = bompBomp.getCopy(String((("Sticker_" + animationArr[_local2].name) + "_Label")), 1).toUpperCase();
_local4 = bompBomp.getCopy(String(("Sticker_" + animationArr[_local2].name)), _arg1[_local2]).toUpperCase();
_local5 = bompBomp.getCopy(String("new"), _arg1[_local2]).toUpperCase();
animationArr[_local2].mcText.mcYellow.mcText.txtLabel.text = _local3;
animationArr[_local2].mcText.mcYellow.mcText.txtText.text = _local4;
animationArr[_local2].mcText.mcGray.mcText.txtLabel.text = _local3;
animationArr[_local2].mcText.mcGray.mcText.txtText.text = _local4;
animationArr[_local2].mcNewSticker.mcText.txtNew.text = _local5;
animationArr[_local2].mcNewSticker.gotoAndStop(1);
};
_local2++;
};
}
public function setCopy():void{
}
public function addAnimation(_arg1:Number, _arg2:Number, _arg3:Boolean, _arg4:Number):void{
var _local5:* = true;
if ((((_arg2 > 0)) && ((_arg2 == startAnimsArr[_arg1])))){
_local5 = false;
animationArr[_arg1].gotoAndStop(animationArr[_arg1].totalFrames);
animationArr[_arg1].mcText.mcYellow.visible = true;
animationArr[_arg1].mcNewSticker.visible = false;
};
if (_arg2 == 2){
if ((((_arg1 == 1)) && (_local5))){
bompBomp.addAnimation(Planet, delay, _arg3, _arg4);
};
animationArr[_arg1].mcText.mcYellow.visible = true;
} else {
if ((((_arg2 == 1)) && (_local5))){
bompBomp.addAnimation(animationArr[_arg1], delay, _arg3, _arg4);
animationArr[_arg1].mcText.mcYellow.visible = true;
};
};
}
public function showBubble(_arg1:Event):void{
var _local2:Number = _arg1.currentTarget.id;
setChildIndex(animationArr[_local2], (numChildren - 1));
_arg1.currentTarget.mcText.visible = true;
_arg1.currentTarget.mcText.gotoAndPlay(1);
}
public function hideBubble(_arg1:Event):void{
_arg1.currentTarget.mcText.visible = false;
_arg1.currentTarget.mcText.gotoAndStop(1);
}
}
}//package src
Section 65
//BackGround (BackGround)
package {
import flash.display.*;
public dynamic class BackGround extends MovieClip {
}
}//package
Section 66
//Bling (Bling)
package {
import flash.display.*;
public dynamic class Bling extends MovieClip {
}
}//package
Section 67
//BombExplosion (BombExplosion)
package {
import flash.display.*;
public dynamic class BombExplosion extends MovieClip {
public function BombExplosion(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 68
//Clock (Clock)
package {
import flash.display.*;
import flash.text.*;
public dynamic class Clock extends MovieClip {
public var txtClock:TextField;
public var mcFlash:MovieClip;
}
}//package
Section 69
//GameEndsIn (GameEndsIn)
package {
import flash.display.*;
import flash.text.*;
public dynamic class GameEndsIn extends MovieClip {
public var txtClickToCont:TextField;
public var txtGameEndsIn:TextField;
}
}//package
Section 70
//GameOver (GameOver)
package {
import flash.display.*;
public dynamic class GameOver extends MovieClip {
public var mcRecord:MovieClip;
}
}//package
Section 71
//Info1 (Info1)
package {
import flash.display.*;
import flash.text.*;
public dynamic class Info1 extends MovieClip {
public var txtInfoHeader:TextField;
public var mcBlink:MovieClip;
public var txtInfo3:TextField;
public var txtInfo2:TextField;
public var txtInfo1:TextField;
public function Info1(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 72
//Info2 (Info2)
package {
import flash.display.*;
import flash.text.*;
public dynamic class Info2 extends MovieClip {
public var txtInfoHeader:TextField;
public var txtInfo3:TextField;
public var txtInfo2:TextField;
public var txtInfo1:TextField;
}
}//package
Section 73
//Intro (Intro)
package {
import flash.display.*;
public dynamic class Intro extends MovieClip {
public function Intro(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 74
//NewSticker (NewSticker)
package {
import flash.display.*;
public dynamic class NewSticker extends MovieClip {
public var mcText:MovieClip;
}
}//package
Section 75
//OpenGameEnd (OpenGameEnd)
package {
import flash.display.*;
import flash.text.*;
public dynamic class OpenGameEnd extends MovieClip {
public var txtOpenGame:TextField;
public function OpenGameEnd(){
addFrameScript(0, frame1, 40, frame41);
}
function frame1(){
}
function frame41(){
stop();
}
}
}//package
Section 76
//Rewind (Rewind)
package {
import flash.display.*;
public dynamic class Rewind extends MovieClip {
public var mcRewindButton:MovieClip;
public var mcRewindBox:MovieClip;
}
}//package
Section 77
//RewindEffect (RewindEffect)
package {
import flash.display.*;
public dynamic class RewindEffect extends MovieClip {
}
}//package
Section 78
//SprayCan (SprayCan)
package {
import flash.display.*;
public dynamic class SprayCan extends MovieClip {
public var mcColorBomb:MovieClip;
public function SprayCan(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 79
//StarBombAnimation (StarBombAnimation)
package {
import flash.display.*;
public dynamic class StarBombAnimation extends MovieClip {
public var mcStar:MovieClip;
public function StarBombAnimation(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 80
//TestAnim (TestAnim)
package {
import flash.display.*;
public dynamic class TestAnim extends MovieClip {
}
}//package