Section 1
//BlingStar (com.king.twistmesilly.BlingStar)
package com.king.twistmesilly {
class BlingStar {
public var clip:bling2;
private var posX:int;
private var posY:int;
private var scale:Number;
private var show:Boolean;
private var animFrame:int;
private var inactivated:Boolean;
private var hideFrames:int;
private var generate:Boolean;
public static var MAX_ANIMFRAME:int = 21;
public static var OUTER_X1:int = 0;
public static var OUTER_X2:int = 754;
public static var OUTER_Y1:int = 0;
public static var OUTER_Y2:int = 600;
public static var INNER_X1:int = 92;
public static var INNER_X2:int = 680;
public static var INNER_Y1:int = 116;
public static var INNER_Y2:int = 449;
function BlingStar(){
clip = new bling2();
clip.visible = false;
}
public function init(){
show = false;
animFrame = 1;
inactivated = false;
generate = true;
setRandom();
}
public function tick(){
if (!inactivated){
hideFrames--;
if (hideFrames < 0){
animFrame++;
if (animFrame > MAX_ANIMFRAME){
init();
} else {
if (generate){
show = true;
};
};
} else {
show = false;
};
};
}
public function render(){
clip.x = posX;
clip.y = posY;
clip.scaleX = scale;
clip.scaleY = scale;
clip.visible = show;
clip.bling_mc.gotoAndStop(animFrame);
}
public function inactivate(){
inactivated = true;
show = false;
animFrame = 1;
}
public function stopGenerate(){
generate = false;
}
private function setRandom(){
do {
posX = (OUTER_X1 + int(((Math.random() * OUTER_X2) - OUTER_X1)));
posY = (OUTER_Y1 + int(((Math.random() * OUTER_Y2) - OUTER_Y1)));
} while ((((((((posX >= INNER_X1)) && ((posX <= INNER_X2)))) && ((posY >= INNER_Y1)))) && ((posY <= INNER_Y2))));
scale = (0.8 + (Math.random() * 0.4));
hideFrames = int((Math.random() * 50));
}
}
}//package com.king.twistmesilly
Section 2
//BlingStars (com.king.twistmesilly.BlingStars)
package com.king.twistmesilly {
import flash.display.*;
import com.king.twistmesilly.*;
class BlingStars {
private var showStarMax:int;
private var blingStars:Array;
public static var MAX_NR_STARS:int = 50;
function BlingStars(_arg1:MovieClip){
var _local2:BlingStar;
super();
blingStars = new Array();
var _local3:int;
while (_local3 < MAX_NR_STARS) {
_local2 = new BlingStar();
blingStars.push(_local2);
_arg1.addChild(_local2.clip);
_local3++;
};
}
public function init(_arg1:int){
showStarMax = _arg1;
var _local2:int;
while (_local2 < blingStars.length) {
if (_local2 < showStarMax){
blingStars[_local2].init();
} else {
blingStars[_local2].inactivate();
};
_local2++;
};
}
public function tick(){
var _local1:int;
while (_local1 < blingStars.length) {
blingStars[_local1].tick();
_local1++;
};
}
public function render(){
var _local1:int;
while (_local1 < blingStars.length) {
blingStars[_local1].render();
_local1++;
};
}
public function stopGenerate(){
var _local1:int;
while (_local1 < blingStars.length) {
blingStars[_local1].stopGenerate();
_local1++;
};
}
public function inactivateAll(){
var _local1:int;
while (_local1 < blingStars.length) {
blingStars[_local1].inactivate();
_local1++;
};
}
}
}//package com.king.twistmesilly
Section 3
//Board (com.king.twistmesilly.Board)
package com.king.twistmesilly {
import com.king.twistmesilly.*;
class Board {
private var relaxOnce:Boolean;// = true
private var cols:int;
private var rows:int;
private var messageCallback:Function;
private var startCol:int;
private var startRow:int;
private var endCol:int;
private var endRow:int;
private var playFieldStart:int;
private var playFieldEnd:int;
private var boardArray:Array;
public var random:Random;
private var matchArrays:Array;
private var createBrickRow:int;
private var scramble:Boolean;
private var scramblePart:int;
private var blockScramble:Boolean;
private var bricksAreFallingThisTick:Boolean;
private var lockedThisTick:Boolean;
private var preLockedThisTick:Boolean;
private var preBricksAreFallingThisTick:Boolean;
private var bricksAreMarked:Boolean;
private var nrColors:int;
private var colorSet:int;
private var twoChains:Boolean;
private var threeChains:Boolean;
private var fourChains:Boolean;
private var makeBombs:int;
private var makeSidewayBlasts:int;
private var makeColorBlasts:int;
private var currentTick:int;
private var boardMap:BoardMap;
private var newBricks:Boolean;
private var nrBricksBlasted:int;
private var oneTickPased:Boolean;
private var brickOutRowCounter1:int;
private var brickOutColCounter1:int;
private var lastOverEven:Boolean;
private var brickOutRowCounter2:int;
private var brickOutColCounter2:int;
private var lastUnderEven:Boolean;
private var animOutDelayCounter:int;
private var counter:int;
private var showHintTickCounter:int;
private var firstTickOnLevel:Boolean;// = false
private var doingScrambling:Boolean;
private var brickStopRotation:Boolean;
private var brickEndFalling:Boolean;
public var refilling:Boolean;
private var hintMatch:Array;
private var forcedScrambleTest:Boolean;
private var oldBrickStopRotation:Boolean;
private var oldBrickEndFalling:Boolean;
private var chai:int;
private var fallingTest:Boolean;
public var alwaysMatch:Boolean;
var comboArrays:Array;
var matcedBricks:Array;
var forceRenderBrickCounter:int;// = 0
public static var BRICKS_TO_MATCH:int = 3;
public static var SHOW_HIT_AFTER_FRAMES:int = 250;
public static var SCRAMBLE_PART1:int = 1;
public static var SCRAMBLE_PART2:int = 2;
function Board(_arg1:int, _arg2:Function){
createBrickRow = 0;
random = new Random(_arg1);
boardMap = new BoardMap();
cols = 10;
rows = 10;
setColorSet(1);
this.cols = cols;
this.rows = rows;
startCol = 0;
startRow = rows;
endCol = (cols - 1);
endRow = ((2 * rows) - 1);
playFieldStart = (startRow * cols);
playFieldEnd = (((2 * rows) * cols) - 1);
scramble = false;
blockScramble = false;
boardArray = new Array((cols * (rows * 2)));
bricksAreFallingThisTick = false;
lockedThisTick = false;
preLockedThisTick = false;
preBricksAreFallingThisTick = false;
threeChains = false;
fourChains = false;
makeBombs = 0;
makeSidewayBlasts = 0;
makeColorBlasts = 0;
nrColors = 3;
this.messageCallback = _arg2;
matchArrays = new Array();
chai = 0;
alwaysMatch = false;
comboArrays = new Array();
matcedBricks = new Array();
}
public function initParts():Boolean{
if (createBricks()){
setBrickPositions();
return (true);
};
return (false);
}
public function initMap(_arg1:int){
boardMap.setMap(_arg1);
cols = boardMap.getNrCols();
rows = boardMap.getNrRows();
startCol = 0;
startRow = rows;
endCol = (cols - 1);
endRow = ((2 * rows) - 1);
playFieldStart = (startRow * cols);
playFieldEnd = (((2 * rows) * cols) - 1);
getSpecialsFromBoard();
makeReady(false);
doingScrambling = false;
hintMatch = new Array();
forcedScrambleTest = false;
oldBrickStopRotation = false;
oldBrickEndFalling = false;
fallingTest = true;
alwaysMatch = false;
}
public function addBricksToDisplay(){
var _local1:int;
while (_local1 < boardArray.length) {
boardArray[_local1].addToDisplay();
_local1++;
};
}
public function forceRender(){
var _local1:int;
while (_local1 < 10) {
if (++forceRenderBrickCounter >= boardArray.length){
forceRenderBrickCounter = 0;
};
boardArray[forceRenderBrickCounter].doForcedRender();
_local1++;
};
}
private function makeReady(_arg1:Boolean){
scramblePart = SCRAMBLE_PART1;
blockScramble = false;
initBoard();
setupHoles();
setupBoard();
createSpecilasAtStart();
newBricks = true;
oneTickPased = false;
bricksAreFallingThisTick = false;
bricksAreMarked = false;
lockedThisTick = false;
preLockedThisTick = false;
preBricksAreFallingThisTick = false;
}
private function createBricks():Boolean{
var _local1 = 10;
if (createBrickRow < (2 * _local1)){
createrBrickRows(createBrickRow);
createBrickRow++;
return (false);
};
return (true);
}
private function createrBrickRows(_arg1:int){
var _local2 = 10;
var _local3 = 10;
var _local4:int;
var _local5 = 9;
var _local6:int = _local4;
while (_local6 <= _local5) {
boardArray[((_arg1 * _local2) + _local6)] = new Brick(messageReciver);
initRandomBrick(((_arg1 * _local2) + _local6), false);
boardArray[((_arg1 * _local2) + _local6)].setType(Brick.TYPE_EMPTY);
_local6++;
};
}
public function initBoard(){
var _local2:int;
var _local1:int;
while (_local1 <= endRow) {
_local2 = startCol;
while (_local2 <= endCol) {
initRandomBrick(((_local1 * cols) + _local2), false);
if (_local1 >= startRow){
boardArray[((_local1 * cols) + _local2)].setType(Brick.TYPE_EMPTY);
};
_local2++;
};
_local1++;
};
setBrickPositions();
}
public function tick(_arg1:int){
var _local2:int;
var _local4:Boolean;
this.currentTick = _arg1;
checkBrickStates();
if ((((newBricks == false)) && ((scramble == false)))){
noMoreMoves();
if (scramble){
getSpecialsFromBoard();
};
showHintTickCounter++;
};
if (((scramble) && ((blockScramble == false)))){
fallingTest = true;
doingScrambling = true;
_local4 = false;
switch (scramblePart){
case SCRAMBLE_PART1:
checkSpecials();
messageCallback("scrambling", null);
_local2 = playFieldStart;
while (_local2 <= playFieldEnd) {
boardArray[_local2].startScrambleFall();
_local2++;
};
counter = 0;
scramblePart = SCRAMBLE_PART2;
_local4 = true;
case SCRAMBLE_PART2:
counter++;
if (counter <= 25){
_local2 = playFieldStart;
while (_local2 <= playFieldEnd) {
boardArray[_local2].fall();
boardArray[_local2].tick();
_local2++;
};
setBrickPositions();
_local4 = true;
} else {
makeReady(false);
scramblePart = SCRAMBLE_PART1;
scramble = false;
doingScrambling = false;
};
break;
};
if (_local4){
return;
};
};
brickStopRotation = false;
brickEndFalling = false;
if (fallingTest){
falling();
};
_local2 = 0;
while (_local2 < boardArray.length) {
boardArray[_local2].tick();
_local2++;
};
if (((((((((brickStopRotation) || (brickEndFalling))) || (oldBrickStopRotation))) || (oldBrickEndFalling))) || (alwaysMatch))){
matching();
};
oldBrickStopRotation = brickStopRotation;
oldBrickEndFalling = brickEndFalling;
refilling = false;
var _local3:Boolean;
if (matchArrays.length > 0){
_local3 = removeMatched();
refillBoard();
if (((_local3) && (((((((bricksAreFallingThisTick) || (lockedThisTick))) || (preLockedThisTick))) || (preBricksAreFallingThisTick))))){
chai++;
} else {
if (((!(bricksAreFallingThisTick)) && (!(lockedThisTick)))){
checkSpecials();
};
};
};
if (!fallTest()){
fallingTest = false;
};
if (_local3){
fallingTest = true;
};
if (((((((newBricks) && ((bricksAreFallingThisTick == false)))) && ((scramble == false)))) && (oneTickPased))){
newBricks = false;
messageCallback("board_ready", null);
forcedScrambleTest = true;
};
if (showHintTickCounter > SHOW_HIT_AFTER_FRAMES){
_local2 = 0;
while (_local2 < hintMatch.length) {
hintMatch[_local2].turnOnShowHint();
_local2++;
};
};
if (bricksAreFallingThisTick){
showHintTickCounter = 0;
removeHint();
};
scramble = false;
oneTickPased = true;
blockScramble = false;
}
public function render(_arg1:Number){
var _local2:int;
while (_local2 < boardArray.length) {
Brick(boardArray[_local2]).render(_arg1);
_local2++;
};
forceRender();
}
public function setBlockScramble(){
if (doingScrambling == false){
blockScramble = true;
};
}
public function startAnimOutBoard(){
brickOutRowCounter1 = 0;
brickOutColCounter1 = 0;
lastOverEven = true;
brickOutRowCounter2 = 9;
brickOutColCounter2 = 9;
lastUnderEven = true;
animOutDelayCounter = 0;
counter = 0;
}
public function updateAnimOutBoard():Boolean{
var _local3:Boolean;
var _local4:Boolean;
var _local1:Boolean;
var _local2:Boolean;
counter++;
animOutDelayCounter++;
if (animOutDelayCounter == 2){
animOutDelayCounter = 0;
do {
_local3 = false;
if (((brickOutRowCounter1 * 10) + brickOutColCounter1) < 50){
if ((((boardArray[((playFieldStart + (brickOutRowCounter1 * 10)) + brickOutColCounter1)].type == Brick.TYPE_EMPTY)) || (boardArray[((playFieldStart + (brickOutRowCounter1 * 10)) + brickOutColCounter1)].movingOut()))){
_local3 = true;
} else {
boardArray[((playFieldStart + (brickOutRowCounter1 * 10)) + brickOutColCounter1)].moveOut(true);
};
if ((brickOutRowCounter1 % 2) == 0){
if ((((brickOutColCounter1 >= 9)) && (lastOverEven))){
brickOutRowCounter1++;
} else {
brickOutColCounter1++;
};
lastOverEven = true;
} else {
if ((((brickOutColCounter1 <= 0)) && (!(lastOverEven)))){
brickOutRowCounter1++;
} else {
brickOutColCounter1--;
};
lastOverEven = false;
};
} else {
_local1 = true;
};
} while (((_local3) && ((((brickOutRowCounter1 * 10) + brickOutColCounter1) < 50))));
do {
_local4 = false;
if (((brickOutRowCounter2 * 10) + brickOutColCounter2) >= 50){
if ((((boardArray[((playFieldStart + (brickOutRowCounter2 * 10)) + brickOutColCounter2)].type == Brick.TYPE_EMPTY)) || (boardArray[((playFieldStart + (brickOutRowCounter2 * 10)) + brickOutColCounter2)].movingOut()))){
_local4 = true;
} else {
boardArray[((playFieldStart + (brickOutRowCounter2 * 10)) + brickOutColCounter2)].moveOut(false);
};
if ((brickOutRowCounter2 % 2) == 0){
if ((((brickOutColCounter2 >= 9)) && (lastUnderEven))){
brickOutRowCounter2--;
} else {
brickOutColCounter2++;
};
lastUnderEven = true;
} else {
if ((((brickOutColCounter2 <= 0)) && (!(lastUnderEven)))){
brickOutRowCounter2--;
} else {
brickOutColCounter2--;
};
lastUnderEven = false;
};
} else {
_local2 = true;
};
} while (((_local4) && ((((brickOutRowCounter2 * 10) + brickOutColCounter2) >= 50))));
};
if (((_local1) && (_local2))){
return (true);
};
return (false);
}
public function startScramble(){
chai = 0;
scramble = true;
}
public function scrambling():Boolean{
return (doingScrambling);
}
public function moveFinished():Boolean{
var _local1:Boolean;
var _local2:Boolean;
var _local3:Boolean;
var _local4:int;
while (_local4 < boardArray.length) {
if (boardArray[_local4].falling){
_local1 = true;
};
if (boardArray[_local4].marked){
_local2 = true;
};
if (boardArray[_local4].state == Brick.STATE_SWITCHING){
_local3 = true;
};
_local4++;
};
if (((((((_local1) || (_local2))) || (_local3))) || (refilling))){
return (false);
};
return (true);
}
public function moveFinishedLight():Boolean{
var _local1:Boolean;
var _local2:Boolean;
var _local3:int;
while (_local3 < boardArray.length) {
if (boardArray[_local3].falling){
_local1 = true;
};
if (boardArray[_local3].marked){
_local2 = true;
};
_local3++;
};
if (((((_local1) || (_local2))) || (refilling))){
return (false);
};
return (true);
}
public function fallTest():Boolean{
var _local1:Boolean;
var _local2:int;
while (_local2 < boardArray.length) {
if (boardArray[_local2].falling){
_local1 = true;
};
_local2++;
};
return (_local1);
}
public function messageReciver(_arg1:String, _arg2:InfoData){
if (_arg1 == "brick_stop_rotation"){
onBrickStopRotation();
};
if (_arg1 == "brick_end_fall"){
onBrickEndFall();
};
messageCallback(_arg1, _arg2);
}
private function onBrickStopRotation(){
brickStopRotation = true;
}
private function onBrickEndFall(){
brickEndFalling = true;
}
public function createBomb(){
makeBombs++;
}
public function createSidewayBlast(){
makeSidewayBlasts++;
}
public function createColorBlast(){
makeColorBlasts++;
}
private function getSpecialsFromBoard(){
var _local2:int;
var _local1:int = playFieldStart;
while (_local1 <= playFieldEnd) {
_local2 = boardArray[_local1].special;
switch (_local2){
case Brick.SPECIAL_BOMB:
makeBombs++;
break;
case Brick.SPECIAL_SIDEWAY_BLAST:
makeSidewayBlasts++;
break;
case Brick.SPECIAL_COLOR_BLAST:
makeColorBlasts++;
break;
};
_local1++;
};
}
public function switchBrickColor(_arg1:int, _arg2:int){
var _local3:int = int(Math.floor((_arg1 / 50)));
var _local4:int = int((Math.floor((_arg2 + (50 * rows))) / 50));
var _local5:int = int(((((_arg2 + (50 * rows)) % 50) / 50) * 100));
var _local6:Boolean = detectBrick1(_local3, _local4, _local5);
if (_local6){
boardArray[((_local4 * cols) + _local3)].rotate();
SoundManager.playRotate();
return;
};
_local6 = detectBrick2(_local3, (_local4 + 1), _local5);
if (_local6){
boardArray[((_local4 + (1 * cols)) + _local3)].rotate();
SoundManager.playRotate();
return;
};
}
public function atNone(){
var _local1:int = playFieldStart;
while (_local1 <= playFieldEnd) {
boardArray[_local1].unMark();
_local1++;
};
}
public function atBrick(_arg1:int, _arg2:int){
var _local3:int = int(Math.floor((_arg1 / 50)));
var _local4:int = int((Math.floor((_arg2 + (50 * rows))) / 50));
var _local5:int = int(((((_arg2 + (50 * rows)) % 50) / 50) * 100));
var _local6:Boolean = detectBrick1(_local3, _local4, _local5);
if (_local6){
boardArray[((_local4 * cols) + _local3)].mark();
return;
};
_local6 = detectBrick2(_local3, (_local4 + 1), _local5);
if (_local6){
boardArray[((_local4 + (1 * cols)) + _local3)].mark();
return;
};
}
private function detectBrick1(_arg1:int, _arg2:int, _arg3:int):Boolean{
if ((((((((_arg1 < startCol)) || ((_arg1 > endCol)))) || ((_arg2 < 0)))) || ((_arg2 > endRow)))){
return (false);
};
if (boardArray[((_arg2 * cols) + _arg1)].type != Brick.TYPE_NORMAL){
return (false);
};
var _local4:int = (boardArray[((_arg2 * cols) + _arg1)].fallingProcent + 100);
if (_arg3 <= _local4){
return (true);
};
return (false);
}
private function detectBrick2(_arg1:int, _arg2:int, _arg3:int):Boolean{
if ((((((((_arg1 < startCol)) || ((_arg1 > endCol)))) || ((_arg2 < 0)))) || ((_arg2 > endRow)))){
return (false);
};
if (boardArray[((_arg2 * cols) + _arg1)].type != Brick.TYPE_NORMAL){
return (false);
};
var _local4:int = (boardArray[((_arg2 * cols) + _arg1)].fallingProcent + 100);
if (_arg3 > _local4){
return (true);
};
return (false);
}
private function setBrickPositionsOld(){
var _local2:int;
var _local1:int;
while (_local1 < (2 * rows)) {
_local2 = 0;
while (_local2 < cols) {
boardArray[((_local1 * cols) + _local2)].setPos(_local2, _local1);
_local2++;
};
_local1++;
};
}
private function setBrickPositions(){
var _local2:int;
var _local1:int;
while (_local1 < (2 * rows)) {
_local2 = 0;
while (_local2 < cols) {
boardArray[((_local1 * cols) + _local2)].colPos = _local2;
boardArray[((_local1 * cols) + _local2)].rowPos = _local1;
boardArray[((_local1 * cols) + _local2)].graphicBrick.offsetY = int(((50 * boardArray[((_local1 * cols) + _local2)].fallingProcent) * 0.01));
boardArray[((_local1 * cols) + _local2)].graphicBrick.posX = (CoreGame.BOARD_HORIZONTAL_OFFSET + (50 * boardArray[((_local1 * cols) + _local2)].colPos));
boardArray[((_local1 * cols) + _local2)].graphicBrick.posY = (((CoreGame.BOARD_VERTICAL_OFFSET + (50 * boardArray[((_local1 * cols) + _local2)].rowPos)) - (boardArray[((_local1 * cols) + _local2)].graphicBrick.rows * 50)) + boardArray[((_local1 * cols) + _local2)].graphicBrick.offsetY);
_local2++;
};
_local1++;
};
}
private function checkBrickStates(){
preBricksAreFallingThisTick = bricksAreFallingThisTick;
bricksAreFallingThisTick = false;
preLockedThisTick = lockedThisTick;
lockedThisTick = false;
bricksAreMarked = false;
var _local1:int;
while (_local1 < boardArray.length) {
if (boardArray[_local1].falling){
bricksAreFallingThisTick = true;
};
if (boardArray[_local1].marked){
bricksAreMarked = true;
};
if (boardArray[_local1].rotateLock){
lockedThisTick = true;
};
_local1++;
};
}
private function showedBricksUnder(_arg1:int, _arg2:int):int{
var _local3:int;
var _local4:int = (_arg2 + 1);
while (_local4 <= endRow) {
if (boardArray[((_local4 * cols) + _arg1)].type != Brick.TYPE_EMPTY){
_local3++;
};
_local4++;
};
return (_local3);
}
private function falling(){
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Brick;
var _local7:Boolean;
var _local8:Brick;
var _local9:Boolean;
var _local1:int = showedBricksUnder(startCol, startRow);
var _local2:int = endRow;
while (_local2 >= 0) {
_local3 = startCol;
while (_local3 <= endCol) {
_local4 = ((_local2 * cols) + _local3);
_local5 = (((_local2 + 1) * cols) + _local3);
_local6 = boardArray[_local4];
if (_local2 != endRow){
_local7 = false;
if ((((((boardArray[_local5].type == Brick.TYPE_EMPTY)) && (!((boardArray[_local4].type == Brick.TYPE_EMPTY))))) && (!(boardArray[_local4].falling)))){
_local7 = true;
};
if (_local2 >= (startRow - 1)){
_local1 = showedBricksUnder(_local3, _local2);
if (_local1 >= boardMap.map[(_local5 - playFieldStart)]){
_local7 = false;
};
};
if (_local7){
_local8 = _local6;
boardArray[_local4] = boardArray[_local5];
boardArray[_local5] = _local8;
boardArray[_local5].startFall();
boardArray[_local5].delayFrame = 0;
boardArray[_local5].rotateLock = false;
};
};
if (boardArray[_local4].falling){
boardArray[_local4].fall();
if (_local2 != endRow){
if (((boardArray[_local5].falling) && ((boardArray[_local4].fallingProcent > boardArray[_local5].fallingProcent)))){
boardArray[_local4].fallingProcent = boardArray[_local5].fallingProcent;
};
};
if (boardArray[_local4].fallOver()){
if (_local2 != endRow){
_local9 = true;
if (_local2 >= (startRow - 1)){
_local1 = showedBricksUnder(_local3, _local2);
if (_local1 >= boardMap.map[(_local5 - playFieldStart)]){
_local9 = false;
};
};
if (_local9){
if (boardArray[_local5].type == Brick.TYPE_EMPTY){
_local8 = _local6;
boardArray[_local4] = boardArray[_local5];
boardArray[_local5] = _local8;
boardArray[_local5].continueFall();
} else {
boardArray[_local4].endFall();
};
} else {
boardArray[_local4].endFall();
};
} else {
boardArray[_local4].endFall();
};
};
};
_local3++;
};
_local2--;
};
setBrickPositions();
}
private function matching(){
var _local3:int;
var _local4:Brick;
var _local5:int;
prepareMatching();
matchArrays = new Array();
var _local1:Array = new Array();
var _local2:int = startRow;
while (_local2 <= endRow) {
_local3 = startCol;
while (_local3 <= endCol) {
_local4 = boardArray[((_local2 * cols) + _local3)];
_local1.length = 0;
_local1 = matchBrick(_local4, _local1);
if (_local1.length < BRICKS_TO_MATCH){
_local5 = 0;
while (_local5 < _local1.length) {
_local1[_local5].marked = false;
_local1[_local5].delayFrame = 0;
_local1[_local5].rotateLock = false;
_local5++;
};
} else {
_local5 = 0;
while (_local5 < _local1.length) {
if (_local1[_local5].rotateLock == false){
_local1[_local5].delayFrame = 0;
};
_local1[_local5].rotateLock = true;
_local5++;
};
matchArrays[matchArrays.length] = _local1;
_local1 = new Array();
};
_local3++;
};
_local2++;
};
}
private function prepareMatching(){
var _local2:int;
var _local1:int;
while (_local1 <= endRow) {
_local2 = 0;
while (_local2 <= endCol) {
boardArray[((_local1 * cols) + _local2)].marked = false;
boardArray[((_local1 * cols) + _local2)].connectedLeft = false;
boardArray[((_local1 * cols) + _local2)].connectedRight = false;
boardArray[((_local1 * cols) + _local2)].connectedUp = false;
boardArray[((_local1 * cols) + _local2)].connectedDown = false;
_local2++;
};
_local1++;
};
}
private function matchBrick(_arg1:Brick, _arg2:Array):Array{
var _local3:Brick;
if (_arg1.marked){
return (_arg2);
};
_arg1.marked = true;
_arg2[_arg2.length] = _arg1;
_local3 = matchBrickHorizontalRight(_arg1);
if (_local3 != null){
joinArrays(_arg2, matchBrick(_local3, _arg2));
};
_local3 = matchBrickHorizontalLeft(_arg1);
if (_local3 != null){
joinArrays(_arg2, matchBrick(_local3, _arg2));
};
_local3 = matchBrickVerticalDown(_arg1);
if (_local3 != null){
joinArrays(_arg2, matchBrick(_local3, _arg2));
};
_local3 = matchBrickVerticalUp(_arg1);
if (_local3 != null){
joinArrays(_arg2, matchBrick(_local3, _arg2));
};
return (_arg2);
}
private function joinArrays(_arg1:Array, _arg2:Array){
var _local3:int;
while (_local3 < _arg2.length) {
_arg1.push(_arg2.pop());
_local3++;
};
}
private function matchBrickHorizontalRight(_arg1:Brick):Brick{
var _local3:Brick;
var _local2:Brick;
if (!_arg1.falling){
if (_arg1.colPos < endCol){
_local3 = boardArray[(((_arg1.rowPos * cols) + _arg1.colPos) + 1)];
if (((!(_local3.marked)) && (!(_local3.falling)))){
if (_arg1.horizontalMatching(_local3)){
_local2 = _local3;
_arg1.connectedRight = true;
_local3.connectedLeft = true;
};
};
};
};
return (_local2);
}
private function matchBrickHorizontalLeft(_arg1:Brick):Brick{
var _local3:Brick;
var _local2:Brick;
if (!_arg1.falling){
if (_arg1.colPos > startCol){
_local3 = boardArray[(((_arg1.rowPos * cols) + _arg1.colPos) - 1)];
if (((!(_local3.marked)) && (!(_local3.falling)))){
if (_arg1.horizontalMatching(_local3)){
_local2 = _local3;
_arg1.connectedLeft = true;
_local3.connectedRight = true;
};
};
};
};
return (_local2);
}
private function matchBrickVerticalDown(_arg1:Brick):Brick{
var _local3:Brick;
var _local2:Brick;
if (!_arg1.falling){
if (_arg1.rowPos < endRow){
_local3 = boardArray[(((_arg1.rowPos + 1) * cols) + _arg1.colPos)];
if (((!(_local3.marked)) && (!(_local3.falling)))){
if (_arg1.verticalMatching(_local3)){
_local2 = _local3;
_arg1.connectedDown = true;
_local3.connectedUp = true;
};
};
};
};
return (_local2);
}
private function matchBrickVerticalUp(_arg1:Brick):Brick{
var _local3:Brick;
var _local2:Brick;
if (!_arg1.falling){
if (_arg1.rowPos > startRow){
_local3 = boardArray[(((_arg1.rowPos - 1) * cols) + _arg1.colPos)];
if (((!(_local3.marked)) && (!(_local3.falling)))){
if (_arg1.verticalMatching(_local3)){
_local2 = _local3;
_arg1.connectedUp = true;
_local3.connectedDown = true;
};
};
};
};
return (_local2);
}
private function removeMatched():Boolean{
var _local1:Boolean;
var _local3:Array;
var _local6:int;
var _local8:int;
var _local9:int;
var _local10:Boolean;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:Array;
var _local15:int;
var _local16:int;
var _local17:InfoData;
var _local18:int;
var _local19:int;
comboArrays.length = 0;
var _local2:* = 0;
while (_local2 < matchArrays.length) {
_local1 = true;
_local12 = 0;
while (_local12 < matchArrays[_local2].length) {
if (((!((matchArrays[_local2][_local12].state == Brick.STATE_NORMAL))) || ((matchArrays[_local2][_local12].delayFrame < Brick.DELAY_FRAMES)))){
_local1 = false;
};
_local12++;
};
if (_local1){
comboArrays[comboArrays.length] = matchArrays[_local2];
matchArrays.splice(_local2, 1);
};
_local2++;
};
if (comboArrays.length == 0){
return (false);
};
_local3 = findSpecials(comboArrays);
processSpecials(_local3);
var _local4:Boolean;
var _local5:int;
var _local7:Boolean;
_local2 = 0;
while (_local2 < comboArrays.length) {
_local7 = false;
_local11 = comboArrays[_local2].length;
_local8 = 0;
_local9 = 0;
_local6 = comboArrays[_local2].length;
_local13 = 0;
while (_local13 < _local6) {
_local14 = comboArrays[_local2];
if (_local14[_local13].marked){
if (_local14[_local13].type == Brick.TYPE_EMPTY){
_local10 = true;
} else {
_local10 = false;
_local14[_local13].inactivate();
_local14[_local13].marked = false;
};
_local7 = true;
_local4 = true;
if (!_local10){
Communicator.sendPlayData2(78, currentTick, _local14[_local13].colPos, _local14[_local13].rowPos);
_local15 = _local14[_local13].getGraphicPosX();
_local16 = _local14[_local13].getGraphicPosY();
_local17 = new InfoData();
_local17.data1 = _local15;
_local17.data2 = _local16;
messageCallback("brick_removed", _local17);
};
_local8 = (_local8 + _local14[_local13].getGraphicPosX());
_local9 = (_local9 + _local14[_local13].getGraphicPosY());
};
_local13++;
};
if (_local7){
_local5++;
_local18 = int((_local8 / _local11));
_local19 = int((_local9 / _local11));
_local17 = new InfoData();
_local17.data1 = _local18;
_local17.data2 = _local19;
_local17.data3 = _local11;
_local17.data4 = chai;
messageCallback("match_score", _local17);
};
_local2++;
};
return (_local7);
}
public function checkSpecials(){
if (chai >= 4){
messageCallback("chains_four", null);
} else {
if (chai == 3){
messageCallback("chains_three", null);
} else {
if (chai == 2){
messageCallback("chains_two", null);
};
};
};
chai = 0;
}
private function findSpecials(_arg1:Array):Array{
var _local4:Array;
var _local5:int;
var _local2:Array = new Array();
var _local3:int;
while (_local3 < _arg1.length) {
_local4 = _arg1[_local3];
_local5 = 0;
while (_local5 < _local4.length) {
if (((_local4[_local5].marked) && (!((_local4[_local5].special == Brick.SPECIAL_NONE))))){
if (_local4[_local5].special == Brick.SPECIAL_COLOR_BLAST){
_local2[_local2.length] = _local4[_local5];
} else {
_local2.splice(0, 0, _local4[_local5]);
};
};
_local5++;
};
_local3++;
};
return (_local2);
}
private function processSpecials(_arg1:Array){
var _local2:Brick;
var _local3:Array;
if (_arg1.length != 0){
_local2 = _arg1.pop();
if (_local2.isSpecialType(Brick.SPECIAL_BOMB)){
_local3 = blastBomb(_local2);
addNewSpecials(_arg1, _local3);
} else {
if (_local2.isSpecialType(Brick.SPECIAL_SIDEWAY_BLAST)){
_local3 = blastSideway(_local2);
addNewSpecials(_arg1, _local3);
};
};
if (_local2.isSpecialType(Brick.SPECIAL_COLOR_BLAST)){
_local3 = blastColor(_local2);
addNewSpecials(_arg1, _local3);
};
};
if (_arg1.length > 0){
processSpecials(_arg1);
};
}
private function addNewSpecials(_arg1, _arg2){
var _local3:int;
while (_local3 < _arg2.length) {
if (!brickIsInArray(_arg2[_local3], _arg1)){
if (_arg2[_local3].isSpecialType(Brick.SPECIAL_COLOR_BLAST)){
_arg1[_arg1.length] = _arg2[_local3];
} else {
_arg1.splice(0, 0, _arg2[_local3]);
};
};
_local3++;
};
}
private function brickIsInArray(_arg1:Brick, _arg2:Array):Boolean{
var _local3:int;
while (_local3 < _arg2.length) {
if ((((_arg2[_local3].colPos == _arg1.colPos)) && ((_arg2[_local3].rowPos == _arg1.rowPos)))){
return (true);
};
_local3++;
};
return (false);
}
private function blastBomb(_arg1:Brick):Array{
var _local2:Brick;
nrBricksBlasted = 0;
var _local3:Array = new Array();
var _local4:int = _arg1.colPos;
var _local5:int = _arg1.rowPos;
_local2 = specialBlastBrick((_local4 - 1), (_local5 - 1), 1);
if (_local2 != null){
_local3[_local3.length] = _local2;
};
_local2 = specialBlastBrick(_local4, (_local5 - 1), 1);
if (_local2 != null){
_local3[_local3.length] = _local2;
};
_local2 = specialBlastBrick((_local4 + 1), (_local5 - 1), 1);
if (_local2 != null){
_local3[_local3.length] = _local2;
};
_local2 = specialBlastBrick((_local4 - 1), _local5, 1);
if (_local2 != null){
_local3[_local3.length] = _local2;
};
boardArray[((_local5 * cols) + _local4)].setNoSpecial();
specialBlastBrick(_local4, _local5, 1);
_local2 = specialBlastBrick((_local4 + 1), _local5, 1);
if (_local2 != null){
_local3[_local3.length] = _local2;
};
_local2 = specialBlastBrick((_local4 - 1), (_local5 + 1), 1);
if (_local2 != null){
_local3[_local3.length] = _local2;
};
_local2 = specialBlastBrick(_local4, (_local5 + 1), 1);
if (_local2 != null){
_local3[_local3.length] = _local2;
};
_local2 = specialBlastBrick((_local4 + 1), (_local5 + 1), 1);
if (_local2 != null){
_local3[_local3.length] = _local2;
};
var _local6:InfoData = new InfoData();
_local6.data1 = _arg1.getGraphicPosX();
_local6.data2 = _arg1.getGraphicPosY();
_local6.data3 = nrBricksBlasted;
messageCallback("blast_bomb", _local6);
return (_local3);
}
private function blastSideway(_arg1:Brick):Array{
var _local2:Brick;
nrBricksBlasted = 0;
var _local3:Array = new Array();
var _local4:int = _arg1.colPos;
var _local5:int = _arg1.rowPos;
var _local6:int = startCol;
while (_local6 <= endCol) {
_local2 = specialBlastBrick(_local6, _local5, 2);
if (_local6 == _local4){
boardArray[((_local5 * cols) + _local4)].setNoSpecial();
specialBlastBrick(_local4, _local5, 2);
} else {
if (_local2 != null){
_local3[_local3.length] = _local2;
};
};
_local6++;
};
var _local7:InfoData = new InfoData();
_local7.data1 = _arg1.getGraphicPosX();
_local7.data2 = _arg1.getGraphicPosY();
_local7.data3 = nrBricksBlasted;
messageCallback("blast_sideway", _local7);
return (_local3);
}
private function blastColor(_arg1:Brick):Array{
var _local2:Brick;
var _local9:int;
nrBricksBlasted = 0;
var _local3:Array = new Array();
var _local4:int = _arg1.colPos;
var _local5:int = _arg1.rowPos;
var _local6:int = _arg1.getColor();
var _local7:int = startRow;
while (_local7 <= endRow) {
_local9 = startCol;
while (_local9 <= endCol) {
if (boardArray[((_local7 * cols) + _local9)].getColor() == _local6){
_local2 = specialBlastBrick(_local9, _local7, 3);
if ((((_local9 == _local4)) && ((_local7 == _local5)))){
boardArray[((_local5 * cols) + _local4)].setNoSpecial();
specialBlastBrick(_local4, _local5, 3);
} else {
if (_local2 != null){
_local3[_local3.length] = _local2;
};
};
};
_local9++;
};
_local7++;
};
var _local8:InfoData = new InfoData();
_local8.data1 = _arg1.getGraphicPosX();
_local8.data2 = _arg1.getGraphicPosY();
_local8.data3 = nrBricksBlasted;
messageCallback("blast_color", _local8);
return (_local3);
}
private function specialBlastBrick(_arg1:int, _arg2:int, _arg3:int):Brick{
var _local4:Brick;
var _local5:Boolean;
if ((((((((_arg1 >= startCol)) && ((_arg1 <= endCol)))) && ((_arg2 >= startRow)))) && ((_arg2 <= endRow)))){
_local4 = boardArray[((_arg2 * cols) + _arg1)];
_local5 = _local4.empty();
if (_local5 == false){
_local4.marked = true;
_local4.inactivate();
nrBricksBlasted++;
};
sendBlastMsg(_local4, _arg3, !(_local5));
if (_local4.isSpecial()){
return (_local4);
};
};
return (null);
}
private function newSpecialBlastBrick(_arg1:int, _arg2:int):Brick{
var _local3:Brick;
if ((((((((_arg1 >= startCol)) && ((_arg1 <= endCol)))) && ((_arg2 >= startRow)))) && ((_arg2 <= endRow)))){
_local3 = boardArray[((_arg2 * cols) + _arg1)];
if (_local3.fallingProcent > -50){
_local3.marked = true;
_local3.inactivate();
if (_local3.isSpecial()){
return (_local3);
};
return (specialBlastBrickUnder(_arg1, (_arg2 + 1)));
};
};
return (specialBlastBrickUnder(_arg1, (_arg2 + 1)));
}
public function sendBlastMsg(_arg1:Brick, _arg2:int, _arg3:Boolean){
var _local4:int = _arg1.getGraphicPosX();
var _local5:int = _arg1.getGraphicPosY();
var _local6:int = _arg1.getColor();
var _local7:InfoData = new InfoData();
_local7.data1 = _local4;
_local7.data2 = _local5;
_local7.data3 = _local6;
switch (_arg2){
case 0:
break;
case 1:
messageCallback("blast_bomb_brick", _local7);
break;
case 2:
messageCallback("blast_sideway_brick", _local7);
break;
case 3:
if (_arg3){
messageCallback("color_brick_removed", _local7);
};
break;
};
}
private function specialBlastBrickUnder(_arg1:int, _arg2:int):Brick{
var _local3:Brick;
if ((((((((_arg1 >= startCol)) && ((_arg1 <= endCol)))) && ((_arg2 >= startRow)))) && ((_arg2 <= endRow)))){
_local3 = boardArray[((_arg2 * cols) + _arg1)];
if (_local3.fallingProcent <= -50){
_local3.marked = true;
_local3.inactivate();
if (_local3.isSpecial()){
return (_local3);
};
};
};
return (null);
}
private function db(){
var _local2:int;
var _local3:int;
var _local1:int = startCol;
while (_local1 <= endCol) {
_local2 = startRow;
while (_local2 <= endRow) {
if ((boardArray[((_local2 * cols) + _local1)].type == Brick.TYPE_EMPTY) != boardArray[((_local2 * cols) + _local1)].marked){
_local3 = ((_local2 * cols) + _local1);
};
_local2++;
};
_local1++;
};
}
public function refillBoard(){
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local1:int = startCol;
while (_local1 <= endCol) {
_local2 = 0;
_local3 = startRow;
while (_local3 <= endRow) {
if (boardArray[((_local3 * cols) + _local1)].removed){
boardArray[((_local3 * cols) + _local1)].removed = false;
_local2++;
refilling = true;
};
_local3++;
};
if (_local2 > 0){
_local3 = (startRow - 1);
while (_local3 >= 0) {
if (boardArray[((_local3 * cols) + _local1)].type == Brick.TYPE_EMPTY){
break;
};
_local3--;
};
_local4 = _local3;
_local5 = ((_local4 - _local2) + 1);
_local3 = _local4;
while (_local3 >= _local5) {
initRandomBrick(((_local3 * cols) + _local1), true);
if (boardArray[(((_local3 + 1) * cols) + _local1)].falling){
boardArray[((_local3 * cols) + _local1)].startFall();
boardArray[((_local3 * cols) + _local1)].fallingProcent = boardArray[(((_local3 + 1) * cols) + _local1)].fallingProcent;
boardArray[((_local3 * cols) + _local1)].fallSpeed = boardArray[(((_local3 + 1) * cols) + _local1)].fallSpeed;
};
_local3--;
};
};
_local1++;
};
createSpecials();
}
private function initRandomBrick(_arg1:int, _arg2:Boolean){
var _local6:int;
var _local3:int = getRandomColor();
var _local4:Boolean;
var _local5:Boolean;
if (_arg2){
_local6 = random.nextInt(33);
if (_local6 == 0){
_local3 = Brick.MULTI_COLOR;
};
};
_local6 = random.nextInt(2);
if (_local6 == 0){
_local4 = true;
};
_local6 = random.nextInt(10);
if (_local6 == 0){
_local5 = true;
_local4 = true;
};
boardArray[_arg1].init(_local3, Brick.TYPE_NORMAL, _local5, _local4, rows);
}
public function setNrColors(_arg1:int){
nrColors = _arg1;
}
public function setColorSet(_arg1:int){
this.colorSet = _arg1;
}
private function getRandomColor():int{
var _local1:int = (random.nextInt(3) + 1);
var _local2 = 1;
switch (colorSet){
case 1:
switch (_local1){
case 1:
_local2 = Brick.COLOR_RED;
break;
case 2:
_local2 = Brick.COLOR_GREEN;
break;
case 3:
_local2 = Brick.COLOR_BLUE;
break;
};
break;
case 2:
switch (_local1){
case 1:
_local2 = Brick.COLOR_RED;
break;
case 2:
_local2 = Brick.COLOR_GREEN;
break;
case 3:
_local2 = Brick.COLOR_CERISE;
break;
};
break;
case 3:
switch (_local1){
case 1:
_local2 = Brick.COLOR_RED;
break;
case 2:
_local2 = Brick.COLOR_BLUE;
break;
case 3:
_local2 = Brick.COLOR_CERISE;
break;
};
break;
case 4:
switch (_local1){
case 1:
_local2 = Brick.COLOR_GREEN;
break;
case 2:
_local2 = Brick.COLOR_BLUE;
break;
case 3:
_local2 = Brick.COLOR_CERISE;
break;
};
break;
};
return (_local2);
}
private function createSpecials(){
var _local1:int;
while (_local1 < playFieldStart) {
if (makeBombs > 0){
if (boardArray[_local1].setSpecial(Brick.SPECIAL_BOMB)){
makeBombs--;
};
};
if (makeSidewayBlasts > 0){
if (boardArray[_local1].setSpecial(Brick.SPECIAL_SIDEWAY_BLAST)){
makeSidewayBlasts--;
};
};
if (makeColorBlasts > 0){
if (boardArray[_local1].setSpecial(Brick.SPECIAL_COLOR_BLAST)){
makeColorBlasts--;
};
};
_local1++;
};
}
private function createSpecilasAtStart(){
var _local3:int;
var _local1 = 300;
var _local2:int;
while ((((((((makeBombs > 0)) || ((makeSidewayBlasts > 0)))) || ((makeColorBlasts > 0)))) && ((_local2 < _local1)))) {
_local3 = random.nextInt(playFieldStart);
if (makeBombs > 0){
if (boardArray[_local3].setSpecial(Brick.SPECIAL_BOMB)){
makeBombs--;
};
_local2++;
};
_local3 = random.nextInt(playFieldStart);
if (makeSidewayBlasts > 0){
if (boardArray[_local3].setSpecial(Brick.SPECIAL_SIDEWAY_BLAST)){
makeSidewayBlasts--;
};
_local2++;
};
_local3 = random.nextInt(playFieldStart);
if (makeColorBlasts > 0){
if (boardArray[_local3].setSpecial(Brick.SPECIAL_COLOR_BLAST)){
makeColorBlasts--;
};
_local2++;
};
};
}
private function noMoreMoves(){
if (((((brickEndFalling) && (!(bricksAreFallingThisTick)))) || (forcedScrambleTest))){
if (relaxOnce == false){
return;
};
forcedScrambleTest = false;
scramble = scrambleTest();
if (Communicator.isRelaxGame()){
if (((scramble) && (relaxOnce))){
relaxOnce = false;
scramble = false;
messageCallback("scrambling", null);
};
};
};
}
private function scrambleTest():Boolean{
var _local3:int;
var _local4:Brick;
var _local5:Boolean;
var _local6:Array;
var _local1:Boolean;
var _local2:int = startRow;
while (_local2 <= endRow) {
_local3 = startCol;
while (_local3 <= endCol) {
_local4 = boardArray[((_local2 * cols) + _local3)];
_local5 = false;
_local6 = scrambleMatchBrick(_local4);
if (_local6 != null){
_local5 = true;
};
if (_local5){
hintMatch = _local6;
_local1 = false;
break;
};
_local3++;
};
if (_local1 == false){
break;
};
_local2++;
};
return (_local1);
}
private function removeHint(){
var _local1:int = playFieldStart;
while (_local1 <= playFieldEnd) {
boardArray[_local1].turnOffShowHint();
_local1++;
};
}
private function scrambleMatchBrick(_arg1:Brick):Array{
var _local5:Brick;
var _local2:Boolean = _arg1.isCross();
matcedBricks.length = 0;
matcedBricks[matcedBricks.length] = _arg1;
var _local3:int = _arg1.colPos;
var _local4:int = _arg1.rowPos;
if (_local3 < endCol){
_local5 = boardArray[(((_local4 * cols) + _local3) + 1)];
if (_arg1.scrambleMatching(_local5)){
matcedBricks[matcedBricks.length] = _local5;
};
};
if (_local3 > startCol){
_local5 = boardArray[(((_local4 * cols) + _local3) - 1)];
if (_arg1.scrambleMatching(_local5)){
matcedBricks[matcedBricks.length] = _local5;
};
};
if (matcedBricks.length >= BRICKS_TO_MATCH){
return (matcedBricks);
};
if (_local2 == false){
matcedBricks.length = 0;
matcedBricks[matcedBricks.length] = _arg1;
};
if (_local4 < endRow){
_local5 = boardArray[(((_local4 + 1) * cols) + _local3)];
if (_arg1.scrambleMatching(_local5)){
matcedBricks[matcedBricks.length] = _local5;
};
};
if (_local4 > startRow){
_local5 = boardArray[(((_local4 - 1) * cols) + _local3)];
if (_arg1.scrambleMatching(_local5)){
matcedBricks[matcedBricks.length] = _local5;
};
};
if (matcedBricks.length >= BRICKS_TO_MATCH){
return (matcedBricks);
};
return (null);
}
public function setupHoles(){
var _local2:int;
var _local1:int;
while (_local1 < startRow) {
_local2 = startCol;
while (_local2 <= endCol) {
if (boardMap.map[((_local1 * cols) + _local2)] == 0){
boardArray[((_local1 * cols) + _local2)].setType(Brick.TYPE_EMPTY);
};
if (_local1 < (rows - 1)){
if (boardMap.map[((_local1 * cols) + _local2)] == boardMap.map[(((_local1 + 1) * cols) + _local2)]){
boardArray[((_local1 * cols) + _local2)].setType(Brick.TYPE_EMPTY);
};
};
_local2++;
};
_local1++;
};
}
public function setupPack(){
var _local2:int;
var _local3:int;
var _local4:Brick;
var _local1:int = (startRow - 1);
while (_local1 > 0) {
_local2 = startCol;
while (_local2 <= endCol) {
if (boardArray[((_local1 * cols) + _local2)].type == Brick.TYPE_EMPTY){
_local3 = _local1;
while (_local3 > 0) {
_local4 = boardArray[((_local3 * cols) + _local2)];
boardArray[((_local3 * cols) + _local2)] = boardArray[(((_local3 - 1) * cols) + _local2)];
boardArray[(((_local3 - 1) * cols) + _local2)] = _local4;
_local3--;
};
};
_local2++;
};
_local1--;
};
}
public function setupBoard(){
var _local3:int;
var _local4:Boolean;
var _local5:Brick;
var _local6:Array;
var _local7:int;
prepareMatching();
var _local1:int;
var _local2:int;
while (_local2 < startRow) {
_local3 = startCol;
while (_local3 <= endCol) {
if (boardArray[((_local2 * cols) + _local3)].type != Brick.TYPE_EMPTY){
do {
_local4 = false;
_local5 = boardArray[((_local2 * cols) + _local3)];
_local6 = new Array();
_local6 = setupMatchBrick(_local5, _local6);
if (_local6.length >= BRICKS_TO_MATCH){
initRandomBrick(((_local2 * cols) + _local3), false);
if (_local1 < 100){
_local4 = true;
_local1++;
};
};
_local7 = 0;
while (_local7 < _local6.length) {
_local6[_local7].marked = false;
_local7++;
};
} while (_local4);
};
_local3++;
};
_local2++;
};
}
private function setupMatchBrick(_arg1:Brick, _arg2:Array):Array{
var _local6:Brick;
var _local3:Brick;
if (_arg1.marked){
return (_arg2);
};
_arg1.marked = true;
_arg2[_arg2.length] = _arg1;
var _local4:int = _arg1.colPos;
var _local5:int = _arg1.rowPos;
if (_local4 < endCol){
_local6 = boardArray[(((_local5 * cols) + _local4) + 1)];
if (_arg1.horizontalMatching(_local6)){
setupMatchBrick(_local6, _arg2);
};
};
if (_local4 > startCol){
_local6 = boardArray[(((_local5 * cols) + _local4) - 1)];
if (_arg1.horizontalMatching(_local6)){
setupMatchBrick(_local6, _arg2);
};
};
if (_local5 < endRow){
_local6 = boardArray[(((_local5 + 1) * cols) + _local4)];
if (_arg1.verticalMatching(_local6)){
setupMatchBrick(_local6, _arg2);
};
};
if (_local5 > 0){
_local6 = boardArray[(((_local5 - 1) * cols) + _local4)];
if (_arg1.verticalMatching(_local6)){
setupMatchBrick(_local6, _arg2);
};
};
return (_arg2);
}
private function unMarkMatched(_arg1:Array){
var _local2:Boolean;
var _local3:int;
while (_local3 < _arg1.length) {
_arg1[_local3].marked = false;
_local3++;
};
}
public function debugShow(){
var _local2:String;
var _local3:int;
var _local1:int;
while (_local1 < (2 * rows)) {
_local2 = "";
_local3 = 0;
while (_local3 < cols) {
_local2 = ((_local2 + boardArray[((_local1 * cols) + _local3)].getColor()) + " ");
_local3++;
};
trace(_local2);
_local1++;
};
trace("type");
_local1 = 0;
while (_local1 < (2 * rows)) {
_local2 = "";
_local3 = 0;
while (_local3 < cols) {
_local2 = ((_local2 + boardArray[((_local1 * cols) + _local3)].special) + " ");
_local3++;
};
trace(_local2);
_local1++;
};
}
private function debugSetBoard(){
boardArray[9].setColor(Brick.COLOR_RED);
boardArray[10].setColor(Brick.COLOR_RED);
boardArray[11].setColor(Brick.COLOR_GREEN);
boardArray[12].setColor(Brick.COLOR_GREEN);
boardArray[13].setColor(Brick.COLOR_RED);
boardArray[14].setColor(Brick.COLOR_GREEN);
boardArray[15].setColor(Brick.COLOR_BLUE);
boardArray[16].setColor(Brick.COLOR_BLUE);
boardArray[17].setColor(Brick.COLOR_RED);
}
}
}//package com.king.twistmesilly
Section 4
//BoardMap (com.king.twistmesilly.BoardMap)
package com.king.twistmesilly {
class BoardMap {
public var map:Array;
private var map1:Array;
private var map2:Array;
private var map3:Array;
private var map4:Array;
private var map5:Array;
private var map6:Array;
private var map7:Array;
private var map8:Array;
private var map9:Array;
private var map10:Array;
private var map11:Array;
private var map12:Array;
private var map13:Array;
private var map14:Array;
private var map15:Array;
private var map16:Array;
private var map17:Array;
private var map18:Array;
private var map19:Array;
private var map20:Array;
private var map21:Array;
private var map22:Array;
private var cols:int;
private var rows:int;
private var colsMap1:int;// = 10
private var rowsMap1:int;// = 10
function BoardMap(){
map1 = new Array(0, 8, 8, 8, 8, 8, 8, 8, 8, 0, 0, 8, 8, 8, 8, 8, 8, 8, 8, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
map2 = new Array(4, 8, 8, 8, 8, 8, 8, 8, 8, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 4, 4, 7, 7, 7, 7, 7, 7, 7, 7, 4, 4, 6, 6, 6, 6, 6, 6, 6, 6, 4, 3, 5, 5, 5, 5, 5, 5, 5, 5, 3, 2, 4, 4, 4, 4, 4, 4, 4, 4, 2, 1, 3, 3, 3, 3, 3, 3, 3, 3, 1, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
map3 = new Array(7, 9, 9, 9, 9, 9, 9, 9, 9, 7, 7, 9, 9, 9, 9, 9, 9, 9, 9, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 7, 6, 7, 7, 7, 7, 7, 7, 7, 7, 6, 5, 6, 6, 6, 6, 6, 6, 6, 6, 5, 4, 5, 5, 5, 5, 5, 5, 5, 5, 4, 3, 4, 4, 4, 4, 4, 4, 4, 4, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0);
map4 = new Array(0, 8, 8, 8, 8, 8, 8, 8, 8, 0, 0, 8, 8, 8, 7, 7, 8, 8, 8, 0, 0, 7, 7, 7, 6, 6, 7, 7, 7, 0, 0, 6, 6, 6, 5, 5, 6, 6, 6, 0, 0, 5, 5, 5, 4, 4, 5, 5, 5, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 3, 3, 3, 4, 4, 3, 3, 3, 0, 0, 2, 2, 2, 3, 3, 2, 2, 2, 0, 0, 1, 1, 1, 2, 2, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0);
map5 = new Array(6, 8, 8, 8, 6, 6, 8, 8, 8, 6, 6, 8, 8, 8, 6, 6, 8, 8, 8, 6, 6, 7, 7, 7, 5, 5, 7, 7, 7, 6, 5, 6, 6, 6, 5, 5, 6, 6, 6, 5, 4, 5, 5, 5, 4, 4, 5, 5, 5, 4, 3, 4, 4, 4, 3, 3, 4, 4, 4, 3, 2, 3, 3, 3, 2, 2, 3, 3, 3, 2, 1, 2, 2, 2, 1, 1, 2, 2, 2, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
map6 = new Array(10, 10, 10, 10, 10, 9, 9, 9, 9, 5, 9, 9, 9, 9, 9, 9, 9, 9, 9, 5, 8, 8, 8, 8, 8, 8, 8, 8, 8, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
map7 = new Array(5, 10, 9, 9, 9, 9, 9, 9, 10, 5, 4, 9, 9, 9, 9, 9, 9, 9, 9, 4, 3, 8, 8, 8, 8, 8, 8, 8, 8, 3, 2, 7, 7, 7, 7, 7, 7, 7, 7, 2, 1, 6, 6, 6, 6, 6, 6, 6, 6, 1, 0, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0);
map8 = new Array(0, 10, 8, 10, 10, 10, 10, 8, 10, 0, 0, 9, 7, 9, 9, 9, 9, 7, 9, 0, 0, 8, 6, 8, 8, 8, 8, 6, 8, 0, 0, 7, 5, 7, 7, 7, 7, 5, 7, 0, 0, 6, 5, 6, 6, 6, 6, 5, 6, 0, 0, 5, 4, 5, 5, 5, 5, 4, 5, 0, 0, 4, 3, 4, 4, 4, 4, 3, 4, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0);
map9 = new Array(6, 10, 10, 10, 6, 6, 10, 10, 10, 6, 6, 9, 9, 9, 5, 5, 9, 9, 9, 6, 6, 8, 8, 8, 4, 4, 8, 8, 8, 6, 5, 7, 7, 7, 3, 3, 7, 7, 7, 5, 4, 6, 6, 6, 3, 3, 6, 6, 6, 4, 3, 5, 5, 5, 3, 3, 5, 5, 5, 3, 2, 4, 4, 4, 3, 3, 4, 4, 4, 2, 1, 3, 3, 3, 3, 3, 3, 3, 3, 1, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0);
map10 = new Array(0, 10, 8, 10, 8, 8, 10, 8, 10, 0, 0, 9, 7, 9, 8, 8, 9, 7, 9, 0, 0, 8, 6, 8, 7, 7, 8, 6, 8, 0, 0, 7, 5, 7, 6, 6, 7, 5, 7, 0, 0, 6, 5, 6, 5, 5, 6, 5, 6, 0, 0, 5, 4, 5, 4, 4, 5, 4, 5, 0, 0, 4, 3, 4, 3, 3, 4, 3, 4, 0, 0, 3, 3, 3, 2, 2, 3, 3, 3, 0, 0, 2, 2, 2, 1, 1, 2, 2, 2, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0);
map11 = new Array(7, 7, 8, 9, 8, 8, 9, 8, 7, 7, 7, 7, 8, 8, 7, 7, 8, 8, 7, 7, 7, 7, 7, 7, 6, 6, 7, 7, 7, 7, 6, 6, 6, 6, 5, 5, 6, 6, 6, 6, 5, 5, 5, 5, 4, 4, 5, 5, 5, 5, 4, 4, 4, 4, 3, 3, 4, 4, 4, 4, 3, 3, 3, 3, 2, 2, 3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
map12 = new Array(8, 8, 8, 10, 10, 10, 10, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 8, 8, 8, 7, 7, 7, 8, 8, 8, 8, 7, 7, 7, 6, 6, 6, 7, 7, 7, 7, 6, 6, 6, 5, 5, 5, 6, 6, 6, 6, 5, 5, 5, 4, 4, 4, 5, 5, 5, 5, 4, 4, 4, 3, 3, 3, 4, 4, 4, 4, 3, 3, 3, 2, 2, 2, 3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0);
map13 = new Array(8, 10, 10, 10, 10, 10, 10, 10, 10, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 8, 7, 8, 8, 8, 8, 8, 8, 8, 8, 7, 6, 7, 7, 7, 7, 7, 7, 7, 7, 6, 5, 6, 6, 6, 6, 6, 6, 6, 6, 5, 4, 5, 5, 5, 5, 5, 5, 5, 5, 4, 3, 4, 4, 4, 4, 4, 4, 4, 4, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0);
map14 = new Array(0, 10, 10, 10, 8, 8, 10, 10, 10, 0, 0, 9, 9, 9, 7, 7, 9, 9, 9, 0, 0, 8, 8, 8, 6, 6, 8, 8, 8, 0, 0, 7, 7, 7, 5, 5, 7, 7, 7, 0, 0, 6, 6, 6, 4, 4, 6, 6, 6, 0, 0, 5, 5, 5, 3, 3, 5, 5, 5, 0, 0, 4, 4, 4, 2, 2, 4, 4, 4, 0, 0, 3, 3, 3, 1, 1, 3, 3, 3, 0, 0, 2, 2, 2, 0, 0, 2, 2, 2, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0);
map15 = new Array(10, 10, 9, 10, 9, 9, 10, 9, 10, 10, 9, 9, 8, 9, 8, 8, 9, 8, 9, 9, 8, 8, 7, 8, 7, 7, 8, 7, 8, 8, 7, 7, 7, 7, 6, 6, 7, 7, 7, 7, 6, 6, 6, 6, 5, 5, 6, 6, 6, 6, 5, 5, 5, 5, 4, 4, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
map16 = new Array(7, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
map17 = new Array(10, 8, 8, 10, 10, 10, 10, 8, 8, 10, 9, 7, 7, 9, 9, 9, 9, 7, 7, 9, 8, 6, 6, 8, 8, 8, 8, 6, 6, 8, 7, 6, 6, 7, 7, 7, 7, 6, 6, 7, 6, 5, 5, 6, 6, 6, 6, 5, 5, 6, 5, 4, 4, 5, 5, 5, 5, 4, 4, 5, 4, 3, 3, 4, 4, 4, 4, 3, 3, 4, 3, 2, 2, 3, 3, 3, 3, 2, 2, 3, 2, 1, 1, 2, 2, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
map18 = new Array(4, 10, 10, 10, 10, 10, 10, 10, 10, 4, 4, 9, 9, 9, 9, 9, 9, 9, 9, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 4, 4, 7, 7, 7, 7, 7, 7, 7, 7, 4, 3, 6, 6, 6, 6, 6, 6, 6, 6, 3, 2, 5, 5, 5, 5, 5, 5, 5, 5, 2, 1, 4, 4, 4, 4, 4, 4, 4, 4, 1, 0, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0);
map19 = new Array(8, 8, 10, 10, 10, 10, 10, 10, 8, 8, 7, 7, 9, 9, 9, 9, 9, 9, 7, 7, 6, 6, 8, 8, 8, 8, 8, 8, 6, 6, 5, 5, 7, 7, 7, 7, 7, 7, 5, 5, 4, 4, 6, 6, 6, 6, 6, 6, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
map20 = new Array(10, 8, 8, 10, 8, 8, 10, 8, 8, 10, 9, 7, 7, 9, 7, 7, 9, 7, 7, 9, 8, 7, 7, 8, 6, 6, 8, 7, 7, 8, 7, 7, 7, 7, 5, 5, 7, 7, 7, 7, 6, 6, 6, 6, 4, 4, 6, 6, 6, 6, 5, 5, 5, 5, 3, 3, 5, 5, 5, 5, 4, 4, 4, 4, 2, 2, 4, 4, 4, 4, 3, 3, 3, 3, 1, 1, 3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
map21 = new Array(0, 0, 0, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
map22 = new Array(10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
}
public function setMap(_arg1:int){
cols = colsMap1;
rows = rowsMap1;
switch (_arg1){
case 1:
map = map1;
break;
case 2:
map = map2;
break;
case 3:
map = map3;
break;
case 4:
map = map4;
break;
case 5:
map = map5;
break;
case 6:
map = map6;
break;
case 7:
map = map7;
break;
case 8:
map = map8;
break;
case 9:
map = map9;
break;
case 10:
map = map10;
break;
case 11:
map = map11;
break;
case 12:
map = map12;
break;
case 13:
map = map13;
break;
case 14:
map = map14;
break;
case 15:
map = map15;
break;
case 16:
map = map16;
break;
case 17:
map = map17;
break;
case 18:
map = map18;
break;
case 19:
map = map19;
break;
case 20:
map = map20;
break;
case 21:
map = map21;
break;
case 22:
map = map22;
break;
default:
map = map1;
break;
};
}
public function getNrCols():int{
return (cols);
}
public function getNrRows():int{
return (rows);
}
}
}//package com.king.twistmesilly
Section 5
//Brick (com.king.twistmesilly.Brick)
package com.king.twistmesilly {
class Brick {
private var addToDisplayList:Boolean;// = false
private var color:int;
public var type:int;
private var crossType:Boolean;
public var special:int;
public var graphicBrick:GraphicBrick;
public var colPos:int;
public var rowPos:int;
public var marked:Boolean;
public var horizontalOrientation:Boolean;
private var rows:int;
private var colorSwitched:Boolean;
private var messageCallback:Function;
public var state:int;
private var frameCounter:int;
public var fallingProcent:int;
public var falling:Boolean;
public var connectedLeft:Boolean;
public var connectedRight:Boolean;
public var connectedUp:Boolean;
public var connectedDown:Boolean;
public var delayFrame:int;
public var instanceNr:int;
public var rotateLock:Boolean;
public var fallSpeed:Number;
public var removed:Boolean;
public static var SWITCHING_FRAMES:int = 5;
public static var FALL_SPEED:int = 60;
public static var FALL_SPEED_INCREASE:int = 1;
public static var FALL_SPEED_MULTI_INCREASE:Number = 1.4;
public static var DELAY_FRAMES:int = 5;
public static var COLOR_NONE:int = 0;
public static var COLOR_RED:int = 1;
public static var COLOR_GREEN:int = 2;
public static var COLOR_BLUE:int = 3;
public static var COLOR_CERISE:int = 4;
public static var MULTI_COLOR:int = 5;
public static var TYPE_EMPTY:int = 0;
public static var TYPE_NORMAL:int = 1;
public static var SPECIAL_NONE:int = 0;
public static var SPECIAL_BOMB:int = 1;
public static var SPECIAL_SIDEWAY_BLAST:int = 2;
public static var SPECIAL_COLOR_BLAST:int = 3;
public static var STATE_NORMAL:int = 0;
public static var STATE_SWITCHING:int = 1;
public static var STATE_FALLING:int = 2;
public static var STATE_MOVE_OUT:int = 3;
public static var STATE_HIDE:int = 4;
private static var instances:int = 0;
function Brick(_arg1:Function){
this.messageCallback = _arg1;
graphicBrick = new GraphicBrick();
}
public function init(_arg1:int, _arg2:int, _arg3:Boolean, _arg4:Boolean, _arg5:int){
setCross(_arg3);
setColor(_arg1);
setOrientation(_arg4);
this.rows = _arg5;
setType(_arg2);
graphicBrick.init(_arg5);
special = SPECIAL_NONE;
fallingProcent = 0;
falling = false;
connectedLeft = false;
connectedRight = false;
connectedUp = false;
connectedDown = false;
state = STATE_NORMAL;
delayFrame = 0;
rotateLock = false;
instanceNr = instances++;
marked = false;
removed = false;
}
public function addToDisplay(){
graphicBrick.addToDisplay();
}
public function inactivate(){
type = TYPE_EMPTY;
rotateLock = false;
removed = true;
var _local1:InfoData = new InfoData();
_local1.data1 = getGraphicPosX();
_local1.data2 = getGraphicPosY();
_local1.data3 = color;
if (horizontalOrientation){
_local1.data4 = 1;
} else {
_local1.data4 = 0;
};
if (crossType){
_local1.data5 = 1;
} else {
_local1.data5 = 0;
};
messageCallback("fade_brick", _local1);
}
public function tick(){
if (addToDisplayList){
graphicBrick.addToDisplay();
addToDisplayList = false;
};
switch (state){
case STATE_NORMAL:
break;
case STATE_SWITCHING:
if (frameCounter == SWITCHING_FRAMES){
messageCallback("brick_stop_rotation", null);
state = STATE_NORMAL;
};
break;
case STATE_FALLING:
break;
case STATE_MOVE_OUT:
if (frameCounter == 2){
graphicBrick.hide();
state = STATE_HIDE;
};
break;
case STATE_HIDE:
break;
};
if (type == TYPE_EMPTY){
graphicBrick.hide();
} else {
if (state != STATE_HIDE){
graphicBrick.show();
};
};
if (((((((connectedRight) || (connectedLeft))) || (connectedUp))) || (connectedDown))){
graphicBrick.turnOnLights();
if (crossType){
graphicBrick.hideLightningLeft();
graphicBrick.hideLightningRight();
graphicBrick.hideCrossLightningUp();
graphicBrick.hideCrossLightningDown();
if (connectedLeft){
graphicBrick.showLightningLeft();
} else {
if (connectedRight){
graphicBrick.showLightningRight();
} else {
if (connectedUp){
graphicBrick.showCrossLightningUp();
} else {
if (connectedDown){
graphicBrick.showCrossLightningDown();
};
};
};
};
} else {
if (((connectedLeft) || (connectedDown))){
graphicBrick.showLightningLeft();
} else {
graphicBrick.hideLightningLeft();
};
if (((connectedRight) || (connectedUp))){
graphicBrick.showLightningRight();
} else {
graphicBrick.hideLightningRight();
};
};
} else {
graphicBrick.turnOffLights();
graphicBrick.hideLightningLeft();
graphicBrick.hideLightningRight();
graphicBrick.hideCrossLightningUp();
graphicBrick.hideCrossLightningDown();
};
graphicBrick.setOffsetY(fallingProcent);
graphicBrick.tick();
frameCounter++;
if (rotateLock){
delayFrame++;
};
}
public function render(_arg1:Number){
graphicBrick.render(_arg1);
}
public function doForcedRender():void{
graphicBrick.doForcedRender();
}
public function turnOnShowHint(){
graphicBrick.turnOnShowHint();
}
public function turnOffShowHint(){
graphicBrick.turnOffShowHint();
}
public function moveOut(_arg1:Boolean){
frameCounter = 0;
state = STATE_MOVE_OUT;
var _local2:InfoData = new InfoData();
_local2.data1 = getGraphicPosX();
_local2.data2 = getGraphicPosY();
_local2.data3 = color;
if (horizontalOrientation){
_local2.data4 = 1;
} else {
_local2.data4 = 0;
};
if (crossType){
_local2.data5 = 1;
} else {
_local2.data5 = 0;
};
if (_arg1){
_local2.data6 = 1;
} else {
_local2.data6 = 0;
};
messageCallback("brick_move_out", _local2);
}
public function movingOut():Boolean{
if ((((state == STATE_MOVE_OUT)) || ((state == STATE_HIDE)))){
return (true);
};
return (false);
}
public function lock(){
rotateLock = true;
}
public function setPos(_arg1:int, _arg2:int){
this.colPos = _arg1;
this.rowPos = _arg2;
graphicBrick.setOffsetY(fallingProcent);
graphicBrick.setPos(_arg1, _arg2);
}
public function getGraphicPosX():int{
return (graphicBrick.getPosX());
}
public function getGraphicPosY():int{
return (graphicBrick.getPosY());
}
public function setCross(_arg1:Boolean){
crossType = _arg1;
graphicBrick.setCross(crossType);
}
public function isCross():Boolean{
return (crossType);
}
public function setOrientation(_arg1:Boolean){
this.horizontalOrientation = _arg1;
if (this.horizontalOrientation){
graphicBrick.setHorizontal();
} else {
graphicBrick.setVertical();
};
}
public function setColor(_arg1:int){
this.color = _arg1;
graphicBrick.setColor(_arg1);
}
public function setType(_arg1:int){
this.type = _arg1;
}
public function getColor():int{
return (color);
}
public function getType():int{
return (type);
}
public function setNoSpecial(){
special = SPECIAL_NONE;
}
public function setSpecial(_arg1:int):Boolean{
if ((((((this.special == SPECIAL_NONE)) && ((type == TYPE_NORMAL)))) && (!((color == MULTI_COLOR))))){
this.special = _arg1;
graphicBrick.setSpecial(this.special);
return (true);
};
return (false);
}
public function isSpecialType(_arg1:int):Boolean{
if (this.special == _arg1){
return (true);
};
return (false);
}
public function isSpecial():Boolean{
if (special == SPECIAL_NONE){
return (false);
};
return (true);
}
public function scrambleMatching(_arg1:Brick):Boolean{
var _local2:int = color;
var _local3:int = _arg1.color;
if (((!((type == TYPE_NORMAL))) || (!((_arg1.type == TYPE_NORMAL))))){
return (false);
};
if ((((((_local2 == _local3)) || ((_local2 == MULTI_COLOR)))) || ((_local3 == MULTI_COLOR)))){
return (true);
};
return (false);
}
public function horizontalMatching(_arg1:Brick):Boolean{
if ((((state == STATE_SWITCHING)) || ((_arg1.state == STATE_SWITCHING)))){
return (false);
};
if (((!((type == TYPE_NORMAL))) || (!((_arg1.type == TYPE_NORMAL))))){
return (false);
};
if ((((((horizontalOrientation == true)) && ((_arg1.horizontalOrientation == true)))) && ((((((color == _arg1.color)) || ((color == MULTI_COLOR)))) || ((_arg1.color == MULTI_COLOR)))))){
return (true);
};
if ((((((crossType == true)) && ((_arg1.horizontalOrientation == true)))) && ((((((color == _arg1.color)) || ((color == MULTI_COLOR)))) || ((_arg1.color == MULTI_COLOR)))))){
return (true);
};
if ((((((horizontalOrientation == true)) && ((_arg1.crossType == true)))) && ((((((color == _arg1.color)) || ((color == MULTI_COLOR)))) || ((_arg1.color == MULTI_COLOR)))))){
return (true);
};
return (false);
}
public function verticalMatching(_arg1:Brick):Boolean{
if ((((state == STATE_SWITCHING)) || ((_arg1.state == STATE_SWITCHING)))){
return (false);
};
if (((!((type == TYPE_NORMAL))) || (!((_arg1.type == TYPE_NORMAL))))){
return (false);
};
if ((((((horizontalOrientation == false)) && ((_arg1.horizontalOrientation == false)))) && ((((((color == _arg1.color)) || ((color == MULTI_COLOR)))) || ((_arg1.color == MULTI_COLOR)))))){
return (true);
};
if ((((((crossType == true)) && ((_arg1.horizontalOrientation == false)))) && ((((((color == _arg1.color)) || ((color == MULTI_COLOR)))) || ((_arg1.color == MULTI_COLOR)))))){
return (true);
};
if ((((((horizontalOrientation == false)) && ((_arg1.crossType == true)))) && ((((((color == _arg1.color)) || ((color == MULTI_COLOR)))) || ((_arg1.color == MULTI_COLOR)))))){
return (true);
};
if ((((((crossType == true)) && ((_arg1.crossType == true)))) && ((((((color == _arg1.color)) || ((color == MULTI_COLOR)))) || ((_arg1.color == MULTI_COLOR)))))){
return (true);
};
return (false);
}
public function empty():Boolean{
if (type == TYPE_EMPTY){
return (true);
};
return (false);
}
public function startFall(){
fallSpeed = 1;
falling = true;
fallingProcent = -100;
}
public function startScrambleFall(){
fallSpeed = 1;
falling = true;
}
public function endFall(){
fallSpeed = 0;
fallingProcent = 0;
falling = false;
messageCallback("brick_end_fall", null);
}
public function continueFall(){
fallingProcent = (-100 + fallingProcent);
}
public function fall(){
fallSpeed = (fallSpeed * FALL_SPEED_MULTI_INCREASE);
if (fallSpeed > FALL_SPEED){
fallSpeed = FALL_SPEED;
};
fallingProcent = Math.round((fallingProcent + fallSpeed));
}
public function isFalling():Boolean{
return (falling);
}
public function fallOver():Boolean{
if (fallingProcent >= 0){
return (true);
};
return (false);
}
public function setFallingProcent(_arg1:int){
this.fallingProcent = _arg1;
}
public function getFallingProcent():int{
return (fallingProcent);
}
public function adjustFallSwitch(){
fallingProcent = -100;
}
public function rotate(){
if (((rotateLock) || (falling))){
return;
};
if (crossType){
return;
};
if (state != STATE_NORMAL){
return;
};
if (horizontalOrientation){
horizontalOrientation = false;
graphicBrick.rotateToVertical();
} else {
horizontalOrientation = true;
graphicBrick.rotateToHorizontal();
};
frameCounter = 1;
state = STATE_SWITCHING;
}
public function mark(){
graphicBrick.onTop();
graphicBrick.showMouseOver();
}
public function unMark(){
graphicBrick.hideMouseOver();
}
public function debugShow(){
}
}
}//package com.king.twistmesilly
Section 6
//Communicator (com.king.twistmesilly.Communicator)
package com.king.twistmesilly {
import com.king.twistmesilly.*;
import flash.system.*;
import flash.xml.*;
class Communicator {
private static var NORMAL:Boolean = true;
private static var moneyGame:Boolean = false;
private static var freeGame:Boolean = false;
private static var relaxGame:Boolean = false;
public static var randomSeed:Number;
public static var lang;
public static function setMoneyGame(_arg1:Boolean){
moneyGame = _arg1;
}
public static function isFreeGame():Boolean{
return (freeGame);
}
public static function isRelaxGame():Boolean{
return (relaxGame);
}
public static function gameStarted(){
if (NORMAL){
fscommand("gameStart");
};
}
public static function gameEnd(_arg1){
if (NORMAL){
fscommand("gameEnd", _arg1);
};
}
public static function gameQuit(){
if (NORMAL){
fscommand("gameQuit");
};
}
public static function sendPlayData(_arg1:int, _arg2:int, _arg3:int){
if (moneyGame){
fscommand("playData", (((((_arg1 + ",") + _arg2) + ",") + _arg3) + ",0=0"));
};
}
public static function sendPlayData2(_arg1:int, _arg2:int, _arg3:int, _arg4:int){
if (moneyGame){
fscommand("playData", (((((((_arg1 + ",") + _arg2) + ",") + _arg3) + ",") + _arg4) + ",0=0"));
};
}
public static function sendPlayData3(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int){
if (moneyGame){
fscommand("playData", (((((((((_arg1 + ",") + _arg2) + ",") + _arg3) + ",") + _arg4) + ",") + _arg5) + ",0=0"));
};
}
public static function parseGameData(_arg1:String){
var _local6:String;
var _local7:String;
var _local2:XMLDocument = new XMLDocument(_arg1);
var _local3:* = _local2.childNodes[0].childNodes;
randomSeed = new Number(_local2.childNodes[0].attributes.randomseed).valueOf();
lang = _local2.childNodes[0].attributes.lang.valueOf();
var _local4:String = _local2.childNodes[0].attributes.relaxMode;
if (_local4 == "true"){
relaxGame = true;
} else {
relaxGame = false;
};
var _local5:* = 0;
while (_local5 < _local3.length) {
if (_local3[_local5].nodeName == "text"){
if (_local3[_local5].attributes.id == "instruction_text_1"){
_local6 = new String(_local3[_local5].firstChild.nodeValue);
TextProperties.INSTRUCTION_TEXT1 = fixStr(_local6);
};
if (_local3[_local5].attributes.id == "intro_heading1"){
_local6 = new String(_local3[_local5].firstChild.nodeValue);
TextProperties.INTRO_HEADING1 = fixStr(_local6);
};
if (_local3[_local5].attributes.id == "intro_text1"){
_local6 = new String(_local3[_local5].firstChild.nodeValue);
TextProperties.INTRO_TEXT1 = fixStr(_local6);
};
if (_local3[_local5].attributes.id == "intro_text2"){
_local6 = new String(_local3[_local5].firstChild.nodeValue);
TextProperties.INTRO_TEXT2 = fixStr(_local6);
};
if (_local3[_local5].attributes.id == "intro_heading2"){
_local6 = new String(_local3[_local5].firstChild.nodeValue);
TextProperties.INTRO_HEADING2 = fixStr(_local6);
};
if (_local3[_local5].attributes.id == "intro_text3"){
_local6 = new String(_local3[_local5].firstChild.nodeValue);
TextProperties.INTRO_TEXT3 = fixStr(_local6);
};
if (_local3[_local5].attributes.id == "intro_text4"){
_local6 = new String(_local3[_local5].firstChild.nodeValue);
TextProperties.INTRO_TEXT4 = fixStr(_local6);
};
if (_local3[_local5].attributes.id == "intro_text5"){
_local6 = new String(_local3[_local5].firstChild.nodeValue);
TextProperties.INTRO_TEXT5 = fixStr(_local6);
};
if (_local3[_local5].attributes.id == "intro_starts_in"){
_local6 = new String(_local3[_local5].firstChild.nodeValue);
TextProperties.INTRO_GAME_STARTS_IN = fixStr(_local6);
};
if (_local3[_local5].attributes.id == "intro_click_to_start"){
_local6 = new String(_local3[_local5].firstChild.nodeValue);
TextProperties.INTRO_CLICK_TO_START = fixStr(_local6);
};
if (_local3[_local5].attributes.id == "intro_like_this"){
_local6 = new String(_local3[_local5].firstChild.nodeValue);
TextProperties.INTRO_LIKE_THIS = fixStr(_local6);
};
if (_local3[_local5].attributes.id == "level_sign_heading"){
_local6 = new String(_local3[_local5].firstChild.nodeValue);
TextProperties.LEVEL_SIGN_HEADING = fixStr(_local6);
};
if (_local3[_local5].attributes.id == "level_sign_score"){
_local6 = new String(_local3[_local5].firstChild.nodeValue);
TextProperties.LEVEL_SIGN_SCORE_TEXT = fixStr(_local6);
};
if (_local3[_local5].attributes.id == "level_sign_bonus"){
_local6 = new String(_local3[_local5].firstChild.nodeValue);
TextProperties.LEVEL_SIGN_BONUS_TEXT = fixStr(_local6);
};
if (_local3[_local5].attributes.id == "level_sign_totalscore"){
_local6 = new String(_local3[_local5].firstChild.nodeValue);
TextProperties.LEVEL_SIGN_TOTAL_SCORE_TEXT = fixStr(_local6);
};
if (_local3[_local5].attributes.id == "level_sign_click_to_continue"){
_local6 = new String(_local3[_local5].firstChild.nodeValue);
TextProperties.LEVEL_SIGN_CLICK_TEXT = fixStr(_local6);
};
if (_local3[_local5].attributes.id == "led_sign_times_up"){
_local6 = new String(_local3[_local5].firstChild.nodeValue);
TextProperties.TIMES_UP = fixStr(_local6);
};
if (_local3[_local5].attributes.id == "led_sign_scramble"){
_local6 = new String(_local3[_local5].firstChild.nodeValue);
TextProperties.SCRAMBLE = fixStr(_local6);
};
if (_local3[_local5].attributes.id == "ends_in"){
_local6 = new String(_local3[_local5].firstChild.nodeValue);
TextProperties.ENDS_IN = fixStr(_local6);
};
if (_local3[_local5].attributes.id == "game_ends"){
_local6 = new String(_local3[_local5].firstChild.nodeValue);
TextProperties.GAME_ENDS = fixStr(_local6);
};
if (_local3[_local5].attributes.id == "scramble_button_text"){
_local6 = new String(_local3[_local5].firstChild.nodeValue);
TextProperties.SCRAMBLE_BUTTON_TEXT = fixStr(_local6);
};
if (_local3[_local5].attributes.id == "gui_score_text"){
_local6 = new String(_local3[_local5].firstChild.nodeValue);
TextProperties.GUI_SCORE_TEXT = fixStr(_local6);
};
if (_local3[_local5].attributes.id == "gui_level_text"){
_local6 = new String(_local3[_local5].firstChild.nodeValue);
TextProperties.GUI_LEVEL_TEXT = fixStr(_local6);
};
if (_local3[_local5].attributes.id == "the_end"){
_local6 = new String(_local3[_local5].firstChild.nodeValue);
TextProperties.THE_END = fixStr(_local6);
} else {
if (_local3[_local5].attributes.id == "free_game_text"){
_local6 = new String(_local3[_local5].firstChild.nodeValue);
TextProperties.FREE_GAME_TEXT = fixStr(_local6);
};
};
};
if (_local3[_local5].nodeName == "userType"){
_local7 = new String(_local3[_local5].firstChild.nodeValue);
if (_local7 == "0"){
freeGame = true;
} else {
freeGame = false;
};
};
_local5++;
};
}
private static function fixStr(_arg1:String):String{
var _local2:String = _arg1.split("\r\n").join("\n");
return (_local2);
}
}
}//package com.king.twistmesilly
Section 7
//CoreGame (com.king.twistmesilly.CoreGame)
package com.king.twistmesilly {
import flash.display.*;
import com.king.twistmesilly.*;
import flash.system.*;
import flash.ui.*;
class CoreGame {
private var seed:int;
private var input:Input;
private var messageCallback:Function;
private var board:Board;
public var gameGUI:GameGUI;
private var dynamicObjects:Array;
private var leftFlash:Flash;
private var rightFlash:Flash;
private var currentTick:int;
private var levelTick:int;
private var score:int;
private var level:int;
private var time:int;
private var brickToBlastOnLevel:int;
private var nrRemovedBricksThisLevel:int;
private var nrRemovedBricksThisTick:int;
private var scoreThisTick:int;
private var nrNormalExplosions:int;
private var inputEnabled:Boolean;
private var countTime:Boolean;
private var levelFinish:Boolean;
private var timesUp:Boolean;
private var exitGame:Boolean;
private var playMatchSoundOnce:Boolean;
private var random:Random;
private var lightningSoundCounter:int;
private var ledJumping:Boolean;
private var alwaysMatchCounter:int;
var levelTime:int;
public static var DEMO_LEVEL_TIME_LIMIT:int = 125;
public static var TIME_LIMIT:int = 6000;
public static var SCRAMBLE_TIME_PENALTY_FRAMES:int = 250;
public static var START_LED_JUMPING:int = 250;
public static var MAP_NR:int = 1;
public static var BOARD_HORIZONTAL_OFFSET:int = 47;
public static var BOARD_VERTICAL_OFFSET:int = 60;
public static var LEVEL_EXTRA:int = 20;
public static var BOMB_SCORE:int = 150;
public static var SIDEWAY_SCORE:int = 200;
public static var COLOR_SCORE_PER_BRICK:int = 20;
function CoreGame(_arg1:int, _arg2:Input, _arg3:Function){
this.seed = _arg1;
this.input = _arg2;
this.messageCallback = _arg3;
random = new Random(_arg1);
board = new Board(_arg1, messageReciver);
gameGUI = new GameGUI(Global.defaultDisplayObject);
dynamicObjects = new Array();
leftFlash = new Flash(37, 565);
rightFlash = new Flash(0x0202, 565);
gameGUI.render(1);
leftFlash.setGoalPos(0, 0);
rightFlash.setGoalPos(0, 0);
score = 0;
time = 0;
levelTime = 0;
level = 1;
gameGUI.setLevel(level);
nrRemovedBricksThisLevel = 0;
brickToBlastOnLevel = 0;
enableInput(false);
timesUp = false;
exitGame = false;
enableCountTime(false);
alwaysMatchCounter = 0;
}
public function initParts():Boolean{
if (board.initParts()){
return (true);
};
return (false);
}
public function tick(_arg1:int):void{
playMatchSoundOnce = true;
if (inputEnabled == false){
input.reset();
input.setMousePos(1000, 1000);
};
nrRemovedBricksThisTick = 0;
scoreThisTick = 0;
nrNormalExplosions = 0;
if (input.mouseIsPressed){
board.switchBrickColor(((input.xMouse - BOARD_HORIZONTAL_OFFSET) + 25), ((input.yMouse - BOARD_VERTICAL_OFFSET) + 25));
};
board.atNone();
board.atBrick(((input.xMouse - BOARD_HORIZONTAL_OFFSET) + 25), ((input.yMouse - BOARD_VERTICAL_OFFSET) + 25));
currentTick = _arg1;
if ((((nrRemovedBricksThisLevel >= brickToBlastOnLevel)) || ((time >= (TIME_LIMIT - 1))))){
board.setBlockScramble();
};
if (time >= TIME_LIMIT){
enableInput(false);
enableCountTime(false);
};
if (exitGame == true){
enableInput(false);
enableCountTime(false);
};
board.alwaysMatch = false;
if ((((nrRemovedBricksThisLevel >= brickToBlastOnLevel)) || ((time >= TIME_LIMIT)))){
if (alwaysMatchCounter < 8){
board.alwaysMatch = true;
alwaysMatchCounter++;
};
};
board.tick(currentTick);
updateDynamicObjects();
removeDynamicObjects();
nrRemovedBricksThisLevel = (nrRemovedBricksThisLevel + nrRemovedBricksThisTick);
gameGUI.setProgress(nrRemovedBricksThisLevel, brickToBlastOnLevel);
if (nrRemovedBricksThisLevel >= brickToBlastOnLevel){
enableInput(false);
};
if ((((((((time >= (TIME_LIMIT - START_LED_JUMPING))) && (!(ledJumping)))) && (inputEnabled))) && ((board.scrambling() == false)))){
ledJumping = true;
gameGUI.startLedJumping();
messageCallback("little_time_left", null);
};
var _local2:Boolean = board.moveFinished();
if ((((((((time >= TIME_LIMIT)) && ((levelFinish == false)))) && ((timesUp == false)))) && ((board.scrambling() == false)))){
if (_local2 == true){
timesUp = true;
gameGUI.stopLedJumping();
messageCallback("finish_game", null);
};
};
if (Communicator.isFreeGame()){
if ((((((((((level >= 2)) && ((levelTime >= DEMO_LEVEL_TIME_LIMIT)))) && ((levelFinish == false)))) && ((timesUp == false)))) && ((board.scrambling() == false)))){
if (_local2 == true){
timesUp = true;
gameGUI.stopLedJumping();
messageCallback("demo_finish_game", null);
};
};
};
if ((((((((levelFinish == false)) && ((timesUp == false)))) && ((nrRemovedBricksThisLevel >= brickToBlastOnLevel)))) && ((_local2 == true)))){
board.checkSpecials();
board.setBlockScramble();
levelFinish = true;
gameGUI.stopLedJumping();
enableInput(false);
enableCountTime(false);
messageCallback("level_finished", null);
};
if ((((((((levelFinish == false)) && ((timesUp == false)))) && ((exitGame == true)))) && ((((_local2 == true)) && ((levelTick > 35)))))){
board.setBlockScramble();
enableInput(false);
messageCallback("exit_game", null);
};
gameGUI.setTime((TIME_LIMIT - time));
gameGUI.tick();
leftFlash.tick();
rightFlash.tick();
if (countTime){
if (Communicator.isRelaxGame() == false){
time++;
};
levelTime++;
};
levelTick++;
}
public function render(_arg1:Number):void{
board.render(_arg1);
renderDynamicObjects();
gameGUI.render(_arg1);
leftFlash.render();
rightFlash.render();
}
public function initEndLevelAnim(){
board.startAnimOutBoard();
leftFlash.showFlash();
rightFlash.showFlash();
}
public function updateEndLevelAnim():Boolean{
var _local1:Boolean = board.updateAnimOutBoard();
if (_local1){
leftFlash.hideFlash();
rightFlash.hideFlash();
return (true);
};
return (false);
}
public function enableInput(_arg1:Boolean){
inputEnabled = _arg1;
}
public function enableCountTime(_arg1:Boolean){
countTime = _arg1;
}
public function ledsAreJumping(){
return (ledJumping);
}
public function setupLevel(_arg1:int){
this.level = _arg1;
var _local2:int = (board.random.nextInt(4) + 1);
board.setColorSet(_local2);
var _local3:int = (board.random.nextInt(20) + 1);
board.initMap(_local3);
levelFinish = false;
gameGUI.setLevel(_arg1);
nrRemovedBricksThisLevel = 0;
ledJumping = false;
setTarget(_arg1);
levelTick = 0;
lightningSoundCounter = 0;
enableCountTime(false);
levelTime = 0;
alwaysMatchCounter = 0;
}
public function scramble(){
if (((inputEnabled) && (board.moveFinishedLight()))){
board.startScramble();
time = (time + SCRAMBLE_TIME_PENALTY_FRAMES);
if (time > TIME_LIMIT){
time = TIME_LIMIT;
};
};
}
public function tryToExitGame(){
exitGame = true;
}
private function setTarget(_arg1:int){
if (_arg1 < 4){
brickToBlastOnLevel = (25 + (25 * _arg1));
} else {
brickToBlastOnLevel = (50 * _arg1);
};
}
public function messageReciver(_arg1:String, _arg2:InfoData){
if (_arg1 == "chains_two"){
onChainsTwo();
} else {
if (_arg1 == "chains_three"){
onChainsThree();
} else {
if (_arg1 == "chains_four"){
onChainsFour();
} else {
if (_arg1 == "brick_removed"){
onBrickRemoved(_arg2);
} else {
if (_arg1 == "blast_bomb_brick"){
onBlastBombBrick(_arg2);
} else {
if (_arg1 == "blast_sideway_brick"){
onBlastSidewayBrick(_arg2);
} else {
if (_arg1 == "color_brick_removed"){
onColorBrickRemoved(_arg2);
} else {
if (_arg1 == "match_score"){
onMatchScore(_arg2);
} else {
if (_arg1 == "blast_bomb"){
onBlastBomb(_arg2);
} else {
if (_arg1 == "blast_sideway"){
onBlastSideway(_arg2);
} else {
if (_arg1 == "blast_color"){
onBlastColor(_arg2);
} else {
if (_arg1 == "fade_brick"){
onFadeBrick(_arg2);
} else {
if (_arg1 == "board_ready"){
onBoardReady();
} else {
if (_arg1 == "enable_input"){
onEnableInput();
} else {
if (_arg1 == "scrambling"){
onScrambling();
} else {
if (_arg1 == "brick_move_out"){
onBrickMoveOut(_arg2);
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
}
private function onChainsTwo(){
board.createBomb();
}
private function onChainsThree(){
board.createSidewayBlast();
}
private function onChainsFour(){
board.createColorBlast();
}
private function onBrickRemoved(_arg1:InfoData){
var _local2:int = _arg1.data1;
var _local3:int = _arg1.data2;
var _local4:DynamicObject = new DynamicObject(new normal_explosion(), _local2, _local3, 7, DynamicObject.TINT_COLOR_NONE, 1);
dynamicObjects.push(_local4);
nrNormalExplosions++;
}
private function onBlastBombBrick(_arg1:InfoData){
var _local2:int = _arg1.data1;
var _local3:int = _arg1.data2;
var _local4:DynamicObject = new DynamicObject(new explosion_bitmap(), _local2, _local3, 17, DynamicObject.TINT_COLOR_NONE, 1);
dynamicObjects.push(_local4);
}
private function onBlastSidewayBrick(_arg1:InfoData){
var _local2:int = _arg1.data1;
var _local3:int = _arg1.data2;
var _local4:DynamicObject = new DynamicObject(new normal_explosion(), _local2, _local3, 7, DynamicObject.TINT_COLOR_NONE, 1);
dynamicObjects.push(_local4);
}
private function onColorBrickRemoved(_arg1:InfoData){
var _local2:int = _arg1.data1;
var _local3:int = _arg1.data2;
var _local4:int = _arg1.data3;
if (_local4 == Brick.MULTI_COLOR){
_local4 = DynamicObject.TINT_COLOR_NONE;
};
var _local5:DynamicObject = new DynamicObject(new explosion_bitmap(), _local2, _local3, 17, _local4, 1);
dynamicObjects.push(_local5);
}
private function onMatchScore(_arg1:InfoData){
var _local2:int = _arg1.data1;
var _local3:int = _arg1.data2;
var _local4:int = _arg1.data3;
var _local5:int = _arg1.data4;
var _local6:int = calculateMatchScore(_local4, _local5, level);
addScore(_local6);
Communicator.sendPlayData3(50, currentTick, getTime(), _local6, score);
var _local7:* = new score_animation();
_local7.score_mc.score_txt.text = _local6;
var _local8:DynamicObject = new DynamicObject(_local7, _local2, _local3, 15, DynamicObject.TINT_COLOR_NONE, 2);
_local8.setDelay(4);
dynamicObjects.push(_local8);
playMatchSound(_local5);
}
private function playMatchSound(_arg1:int){
if (playMatchSoundOnce){
switch (_arg1){
case 0:
SoundManager.playMatch1();
break;
case 1:
SoundManager.playMatch2();
break;
case 2:
SoundManager.playMatch3();
break;
case 3:
SoundManager.playMatch4();
break;
case 4:
SoundManager.playMatch5();
break;
default:
SoundManager.playMatch6();
break;
};
};
playMatchSoundOnce = false;
}
private function onBlastBomb(_arg1:InfoData){
var _local2:int = _arg1.data1;
var _local3:int = _arg1.data2;
var _local4:int = _arg1.data3;
var _local5:* = new score_animation();
_local5.score_mc.score_txt.text = BOMB_SCORE;
var _local6:DynamicObject = new DynamicObject(_local5, _local2, _local3, 15, DynamicObject.TINT_COLOR_NONE, 2);
_local6.setDelay(4);
dynamicObjects.push(_local6);
addScore(BOMB_SCORE);
Communicator.sendPlayData3(51, currentTick, getTime(), BOMB_SCORE, score);
SoundManager.playBomb();
}
private function onBlastSideway(_arg1:InfoData){
var _local2:int = _arg1.data1;
var _local3:int = _arg1.data2;
var _local4:int = _arg1.data3;
var _local5:DynamicObject = new DynamicObject(new sideway_explosion_bitmap(), _local2, _local3, 18, DynamicObject.TINT_COLOR_NONE, 1);
dynamicObjects.push(_local5);
_local5 = new DynamicObject(new sideway_explosion_bitmap(), _local2, _local3, 18, DynamicObject.TINT_COLOR_NONE, 0);
_local5.setMirrorMode();
dynamicObjects.push(_local5);
var _local6:* = new score_animation();
_local6.score_mc.score_txt.text = SIDEWAY_SCORE;
_local5 = new DynamicObject(_local6, _local2, _local3, 15, DynamicObject.TINT_COLOR_NONE, 1);
_local5.setDelay(4);
dynamicObjects.push(_local5);
addScore(SIDEWAY_SCORE);
Communicator.sendPlayData3(52, currentTick, getTime(), SIDEWAY_SCORE, score);
SoundManager.playLineBlast();
}
private function onBlastColor(_arg1:InfoData){
var _local5:int;
var _local6:*;
var _local7:DynamicObject;
var _local2:int = _arg1.data1;
var _local3:int = _arg1.data2;
var _local4:int = _arg1.data3;
if (_local4 > 0){
_local5 = (_local4 * 20);
_local6 = new score_animation();
_local6.score_mc.score_txt.text = _local5;
_local7 = new DynamicObject(_local6, _local2, _local3, 15, DynamicObject.TINT_COLOR_NONE, 2);
_local7.setDelay(4);
dynamicObjects.push(_local7);
addScore(_local5);
Communicator.sendPlayData3(53, currentTick, getTime(), _local5, score);
SoundManager.playColorBomb();
};
}
private function onFadeBrick(_arg1:InfoData){
var _local7:*;
var _local2:int = _arg1.data1;
var _local3:int = _arg1.data2;
var _local4:int = _arg1.data3;
var _local5:int = _arg1.data4;
var _local6:int = _arg1.data5;
switch (_local4){
case Brick.COLOR_RED:
if (_local6 == 0){
_local7 = new red3();
} else {
_local7 = new red5();
};
break;
case Brick.COLOR_GREEN:
if (_local6 == 0){
_local7 = new green3();
} else {
_local7 = new green5();
};
break;
case Brick.COLOR_BLUE:
if (_local6 == 0){
_local7 = new blue3();
} else {
_local7 = new blue5();
};
break;
case Brick.COLOR_CERISE:
if (_local6 == 0){
_local7 = new cerise3();
} else {
_local7 = new cerise5();
};
break;
case Brick.MULTI_COLOR:
if (_local6 == 0){
_local7 = new rainbow3();
} else {
_local7 = new rainbow5();
};
break;
};
var _local8:DynamicObject = new DynamicObject(_local7, _local2, _local3, 5, DynamicObject.TINT_COLOR_NONE, 0);
_local8.setZoomOut();
if (_local5 == 0){
_local8.setRotated();
};
dynamicObjects.push(_local8);
nrRemovedBricksThisTick++;
}
private function onBoardReady(){
enableInput(true);
enableCountTime(true);
messageCallback("level_ready", null);
}
private function onBoardFinish(){
messageCallback("level_finish", null);
}
private function onEnableInput(){
enableInput(true);
}
private function onScrambling(){
enableInput(false);
enableCountTime(false);
messageCallback("scrambling", null);
}
private function onBrickMoveOut(_arg1:InfoData){
var _local7:Boolean;
var _local8:*;
var _local2:int = _arg1.data1;
var _local3:int = _arg1.data2;
var _local4:int = _arg1.data3;
var _local5:int = _arg1.data4;
var _local6:int = _arg1.data5;
if (_arg1.data6 == 1){
_local7 = true;
} else {
_local7 = false;
};
switch (_local4){
case Brick.COLOR_RED:
if (_local6 == 0){
_local8 = new red3();
} else {
_local8 = new red5();
};
break;
case Brick.COLOR_GREEN:
if (_local6 == 0){
_local8 = new green3();
} else {
_local8 = new green5();
};
break;
case Brick.COLOR_BLUE:
if (_local6 == 0){
_local8 = new blue3();
} else {
_local8 = new blue5();
};
break;
case Brick.COLOR_CERISE:
if (_local6 == 0){
_local8 = new cerise3();
} else {
_local8 = new cerise5();
};
break;
case Brick.MULTI_COLOR:
if (_local6 == 0){
_local8 = new rainbow3();
} else {
_local8 = new rainbow5();
};
break;
};
var _local9:DynamicObject = new DynamicObject(_local8, _local2, _local3, 100, DynamicObject.TINT_COLOR_NONE, 0);
_local9.setMoveOut();
if (_local5 == 0){
_local9.setRotated();
};
dynamicObjects.push(_local9);
if (_local7){
rightFlash.setGoalPos(_local2, _local3);
} else {
leftFlash.setGoalPos(_local2, _local3);
};
if (lightningSoundCounter == 0){
SoundManager.playLightning();
};
lightningSoundCounter++;
if (lightningSoundCounter >= 10){
lightningSoundCounter = 0;
};
}
public function addBoardToDisplay(){
board.addBricksToDisplay();
}
private function updateDynamicObjects(){
var _local1:* = 0;
while (_local1 < dynamicObjects.length) {
dynamicObjects[_local1].tick();
_local1++;
};
}
private function renderDynamicObjects(){
var _local1:* = 0;
while (_local1 < dynamicObjects.length) {
dynamicObjects[_local1].render();
_local1++;
};
}
private function removeDynamicObjects(){
var _local2:DynamicObject;
var _local3:*;
var _local1:Number = 0;
while (_local1 < dynamicObjects.length) {
if (dynamicObjects[_local1].toBeRemoved){
if (_local1 == (dynamicObjects.length - 1)){
_local2 = dynamicObjects.pop();
_local2.deleting();
_local2 = null;
} else {
_local3 = dynamicObjects.pop();
_local2 = dynamicObjects[_local1];
_local2.deleting();
_local2 = null;
dynamicObjects[_local1] = _local3;
_local1--;
};
};
_local1++;
};
}
private function calculateMatchScore(_arg1:int, _arg2:int, _arg3:int):int{
var _local4:int;
switch (_arg1){
case 3:
_local4 = (50 + ((_arg3 - 1) * LEVEL_EXTRA));
break;
case 4:
_local4 = (100 + ((_arg3 - 1) * LEVEL_EXTRA));
break;
case 5:
_local4 = (150 + ((_arg3 - 1) * LEVEL_EXTRA));
break;
case 6:
_local4 = (250 + ((_arg3 - 1) * LEVEL_EXTRA));
break;
case 7:
default:
_local4 = (500 + ((_arg3 - 1) * LEVEL_EXTRA));
break;
};
var _local5:Number = (1 + (_arg2 * 0.5));
_local4 = int((_local4 * _local5));
return (_local4);
}
public function addScore(_arg1:int){
scoreThisTick = (scoreThisTick + _arg1);
score = (score + _arg1);
gameGUI.setScore(score);
}
public function getScore():int{
return (score);
}
public function getTime():int{
return (time);
}
public function littleTimeLeft():Boolean{
if (time >= (TIME_LIMIT - START_LED_JUMPING)){
return (true);
};
return (false);
}
}
}//package com.king.twistmesilly
Section 8
//DynamicObject (com.king.twistmesilly.DynamicObject)
package com.king.twistmesilly {
import flash.display.*;
import flash.geom.*;
class DynamicObject {
private var posX:Number;
private var posY:Number;
private var frames:int;
private var clip:MovieClip;
private var animFrame;// = 0
private var mirror:Boolean;
private var zoomOut:Boolean;
private var movingOut:Boolean;
private var delayFrames:int;
private var visible:Boolean;
public var toBeRemoved:Boolean;
private var rotation:Number;
private var deltaRotation:int;
private var movingOutSpeed:Number;
private var scale:Number;
private var renderLevel:int;
private var counter:int;// = 0
public static var MAX_MOVING_OUT_SPEED:int = 30;
public static var MOVING_OUT_SPEED_FACTOR:Number = 3;
public static var MOVING_OUT_MAX_DELTA_ROTATION:int = 30;
public static var TINT_COLOR_NONE:int = 0;
public static var TINT_COLOR_RED:int = 1;
public static var TINT_COLOR_GREEN:int = 2;
public static var TINT_COLOR_BLUE:int = 3;
public static var TINT_COLOR_CERISE:int = 4;
function DynamicObject(_arg1:MovieClip, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int){
this.clip = _arg1;
this.posX = _arg2;
this.posY = _arg3;
this.frames = _arg4;
this.renderLevel = _arg6;
mirror = false;
zoomOut = false;
movingOut = false;
delayFrames = 0;
rotation = 0;
deltaRotation = 0;
movingOutSpeed = 0;
visible = false;
toBeRemoved = false;
tint(_arg5);
if (_arg6 == 0){
Global.playFieldClip0.addChild(_arg1);
};
if (_arg6 == 1){
Global.playFieldClip2.addChild(_arg1);
} else {
if (_arg6 == 2){
Global.playFieldClip3.addChild(_arg1);
};
};
}
public function tick(){
counter++;
if (delayFrames > 0){
delayFrames--;
return;
};
visible = true;
animFrame++;
if (animFrame > frames){
animFrame = frames;
toBeRemoved = true;
};
if (zoomOut){
switch (animFrame){
case 1:
scale = 1;
break;
case 2:
scale = 1.15;
break;
case 3:
scale = 1.34;
break;
case 4:
scale = 1;
break;
case 5:
scale = 0.75;
break;
};
};
if (movingOut){
movingOutSpeed = (movingOutSpeed * MOVING_OUT_SPEED_FACTOR);
if (movingOutSpeed > MAX_MOVING_OUT_SPEED){
movingOutSpeed = MAX_MOVING_OUT_SPEED;
};
posY = (posY + movingOutSpeed);
rotation = (rotation + deltaRotation);
if (posY > 650){
toBeRemoved = true;
};
};
}
public function render(){
clip.visible = visible;
clip.x = posX;
clip.y = posY;
if (mirror){
clip.scaleX = -1;
};
if (zoomOut){
clip.scaleX = scale;
clip.scaleY = scale;
};
clip.rotation = rotation;
clip.gotoAndStop(animFrame);
}
public function setMirrorMode(){
mirror = true;
}
public function setRotated(){
rotation = (rotation + 90);
}
public function setMoveOut(){
movingOut = true;
movingOutSpeed = 1;
deltaRotation = (int((Math.random() * MAX_MOVING_OUT_SPEED)) - int((MAX_MOVING_OUT_SPEED / 2)));
}
public function setZoomOut(){
zoomOut = true;
}
public function setDelay(_arg1:int){
this.delayFrames = _arg1;
}
public function setToBeRemoved(){
visible = false;
toBeRemoved = true;
}
public function deleting(){
if (renderLevel == 0){
Global.playFieldClip0.removeChild(clip);
} else {
if (renderLevel == 1){
Global.playFieldClip2.removeChild(clip);
} else {
if (renderLevel == 2){
Global.playFieldClip3.removeChild(clip);
};
};
};
clip = null;
}
private function tint(_arg1:int){
switch (_arg1){
case TINT_COLOR_NONE:
break;
case TINT_COLOR_RED:
this.clip.transform.colorTransform = new ColorTransform(0.5, 0.5, 0.5, 1, 128, 0, 0, 0);
break;
case TINT_COLOR_GREEN:
this.clip.transform.colorTransform = new ColorTransform(0.5, 0.5, 0.5, 1, 0, 77, 0, 0);
break;
case TINT_COLOR_BLUE:
this.clip.transform.colorTransform = new ColorTransform(0.5, 0.5, 0.5, 1, 12, 54, 124, 0);
break;
case TINT_COLOR_CERISE:
this.clip.transform.colorTransform = new ColorTransform(1, 0.25, 0.25, 1, 249, 108, 15, 0);
break;
};
}
}
}//package com.king.twistmesilly
Section 9
//Flash (com.king.twistmesilly.Flash)
package com.king.twistmesilly {
import flash.display.*;
class Flash {
private var clip:MovieClip;
private var posX:int;
private var posY:int;
private var length:Number;
private var rotation:Number;
private var frame:int;
private var scale:Number;
private var visible:Boolean;
private var countDown:int;
function Flash(_arg1:int, _arg2:int){
this.posX = _arg1;
this.posY = _arg2;
countDown = -1;
clip = new blixt();
clip.visible = false;
Global.playFieldClip3.addChild(clip);
frame = 1;
hideFlash();
}
public function tick(){
frame++;
if (frame == 5){
frame = 1;
};
if (countDown > -1){
countDown--;
};
if (countDown == 1){
length = (length - 45);
scale = (length / 715);
};
if (countDown == 0){
scale = 0.015;
};
}
public function render(){
clip.gotoAndStop(frame);
clip.x = posX;
clip.y = posY;
clip.scaleX = scale;
clip.rotation = rotation;
clip.visible = visible;
}
public function showFlash(){
visible = true;
}
public function hideFlash(){
visible = false;
scale = 0.015;
}
public function setGoalPos(_arg1:int, _arg2:int){
var _local3:int = (posX - _arg1);
var _local4:int = (posY - _arg2);
var _local5:Number = Math.atan2(_local4, _local3);
rotation = ((_local5 * 180) / Math.PI);
length = Math.sqrt(((_local3 * _local3) + (_local4 * _local4)));
scale = (length / 715);
countDown = 3;
}
}
}//package com.king.twistmesilly
Section 10
//GameGUI (com.king.twistmesilly.GameGUI)
package com.king.twistmesilly {
import flash.display.*;
import com.king.twistmesilly.*;
class GameGUI {
private var clip:MovieClip;
private var score:int;
private var level:int;
private var progressFrame:int;
private var wantedProgressFrame:int;
private var progressBlink:Boolean;
private var time1:String;// = ""
private var time2:String;// = ""
private var time3:String;// = ""
private var time1LedBlink:Boolean;
private var time1LedAnimFrame;
private var time2LedBlink:Boolean;
private var time2LedAnimFrame;
private var time2Visible:Boolean;
private var time3LedBlink:Boolean;
private var time3LedAnimFrame;
private var ledJump:Boolean;
function GameGUI(_arg1:MovieClip){
this.clip = _arg1;
progressFrame = 1;
progressBlink = false;
showMiddleLedTime();
time1LedAnimFrame = 1;
time1LedBlink = false;
time2LedAnimFrame = 1;
time2LedBlink = false;
time3LedAnimFrame = 1;
time3LedBlink = false;
stopLedJumping();
if (Communicator.isRelaxGame()){
_arg1.scramble_mc.visible = false;
_arg1.scramble_button_txt.visible = false;
};
}
public function init(){
level = 0;
score = 0;
}
public function tick(){
var _local1:int;
if (Communicator.isRelaxGame()){
TextProperties.SCRAMBLE = TextProperties.THE_END;
};
if (progressBlink){
progressFrame++;
if (progressFrame > 80){
progressFrame = 60;
};
} else {
if (progressFrame < wantedProgressFrame){
progressFrame++;
};
};
if (ledJump){
time1LedAnimFrame++;
if (time1LedAnimFrame > 22){
time1LedAnimFrame = 8;
};
time2LedAnimFrame++;
if (time2LedAnimFrame > 22){
time2LedAnimFrame = 8;
};
time3LedAnimFrame++;
if (time3LedAnimFrame > 22){
time3LedAnimFrame = 8;
};
} else {
if (time1LedBlink == false){
_local1 = Math.round((Math.random() * 100));
if (_local1 == 0){
time1LedAnimFrame = 1;
time1LedBlink = true;
};
};
if (time1LedBlink){
time1LedAnimFrame++;
};
if (time1LedAnimFrame > 7){
time1LedAnimFrame = 1;
time1LedBlink = false;
};
if (time2LedBlink == false){
_local1 = Math.round((Math.random() * 100));
if (_local1 == 0){
time2LedAnimFrame = 1;
time2LedBlink = true;
};
};
if (time2LedBlink){
time2LedAnimFrame++;
};
if (time2LedAnimFrame > 7){
time2LedAnimFrame = 1;
time2LedBlink = false;
};
if (time3LedBlink == false){
_local1 = Math.round((Math.random() * 100));
if (_local1 == 0){
time3LedAnimFrame = 1;
time3LedBlink = true;
};
};
if (time3LedBlink){
time3LedAnimFrame++;
};
if (time3LedAnimFrame > 7){
time3LedAnimFrame = 1;
time3LedBlink = false;
};
};
}
public function render(_arg1:Number){
var _local2:String;
if (clip.score_mc.score_txt.text){
if (clip.score_mc.score_txt.text != score){
clip.score_mc.score_txt.text = score;
};
};
if (clip.level_mc.level_txt){
_local2 = ((TextProperties.GUI_LEVEL_TEXT + " ") + level);
if (clip.level_mc.level_txt.text != _local2){
clip.level_mc.level_txt.text = _local2;
};
};
if (clip.progress_mc){
clip.progress_mc.gotoAndStop(progressFrame);
};
if (clip.time1_mc){
if (clip.time1_mc.timeLed_mc.time_txt.text != time1){
clip.time1_mc.timeLed_mc.time_txt.text = time1;
if (Communicator.isRelaxGame()){
clip.time1_mc.timeLed_mc.time_txt.text = "";
};
};
clip.time1_mc.gotoAndStop(time1LedAnimFrame);
};
if (clip.time2_mc){
clip.time2_mc.visible = time2Visible;
if (clip.time2_mc.timeLed_mc.time_txt.text != time2){
clip.time2_mc.timeLed_mc.time_txt.text = time2;
if (Communicator.isRelaxGame()){
clip.time2_mc.timeLed_mc.time_txt.text = "";
};
};
clip.time2_mc.gotoAndStop(time2LedAnimFrame);
};
if (clip.time3_mc){
if (clip.time3_mc.timeLed_mc.time_txt.text != time3){
clip.time3_mc.timeLed_mc.time_txt.text = time3;
if (Communicator.isRelaxGame()){
clip.time3_mc.timeLed_mc.time_txt.text = "";
};
};
clip.time3_mc.gotoAndStop(time3LedAnimFrame);
};
if (clip.scramble_button_txt){
if (clip.scramble_button_txt.text != TextProperties.SCRAMBLE_BUTTON_TEXT){
clip.scramble_button_txt.text = TextProperties.SCRAMBLE_BUTTON_TEXT;
};
};
if (clip.score_mc.score_inner_mc){
if (clip.score_mc.score_inner_mc.gui_score_text_txt.text != TextProperties.GUI_SCORE_TEXT){
clip.score_mc.score_inner_mc.gui_score_text_txt.text = TextProperties.GUI_SCORE_TEXT;
};
};
}
public function setScore(_arg1:int){
this.score = _arg1;
}
public function setLevel(_arg1:int){
this.level = _arg1;
}
public function setProgress(_arg1:int, _arg2:int){
if (_arg1 > _arg2){
_arg1 = _arg2;
};
if (_arg1 == 0){
progressFrame = 1;
};
var _local3:Number = (_arg1 / _arg2);
wantedProgressFrame = int((41 * _local3));
if ((((((_arg1 == _arg2)) && ((wantedProgressFrame >= 40)))) && ((progressBlink == false)))){
progressFrame = 60;
progressBlink = true;
} else {
if (wantedProgressFrame == 0){
progressBlink = false;
};
};
}
public function setTime(_arg1:int){
var _local2:int = (_arg1 / 25);
var _local3:int = (_local2 / 60);
_local2 = (_local2 - (_local3 * 60));
var _local4:int = int((_local2 / 10));
time1 = String(_local3);
time2 = String(_local4);
time3 = String(int((_local2 - (_local4 * 10))));
}
public function showMiddleLedTime(){
time2Visible = true;
}
public function hideMiddleLedTime(){
time2Visible = false;
}
public function startLedJumping(){
time1LedAnimFrame = 8;
time2LedAnimFrame = 1;
time3LedAnimFrame = 3;
ledJump = true;
}
public function stopLedJumping(){
ledJump = false;
}
}
}//package com.king.twistmesilly
Section 11
//GameHandler (com.king.twistmesilly.GameHandler)
package com.king.twistmesilly {
import flash.display.*;
import com.king.twistmesilly.*;
import flash.system.*;
import flash.ui.*;
class GameHandler {
public var coreGame:CoreGame;
private var input:Input;
private var messageCallback:Function;
private var ghState:int;
private var level:int;
public var currentTick:int;
private var tickCounter:int;
private var tickCounter2:int;
private var delay:Boolean;
public var moviePlayer:MoviePlayer;
private var logoPlayer2:LogoPlayer;
private var scrambling:Boolean;
private var gameStarted:Boolean;
private var endLevelCounter:int;
private var blingStars:BlingStars;
private var normalGameLoopVolume:Boolean;
public static var GAME_ENDS_IN_TICKS:int = 250;
public static var SHOW_LEVEL_SIGN_TICKS:int = 125;
public static var STATE_START = 10;
public static var STATE_PAUSE = 0;
public static var INIT_GAME:int = 1;
public static var PRE_LEVEL:int = 2;
public static var NEXT_LEVEL:int = 9;
public static var LEVEL_INTRO:int = 8;
public static var STATE_PLAY = 3;
public static var END_LEVEL:int = 4;
public static var SHOW_LEVEL_SIGN:int = 13;
public static var STATE_TIMESUP:int = 11;
public static var STATE_GAME_OVER:int = 5;
public static var STATE_GAME_OVER_FREE:int = 6;
public static var STATE_END:int = 7;
public static var STATE_SCRAMBLE:int = 12;
function GameHandler(_arg1:int, _arg2:Input, _arg3:Function){
this.input = _arg2;
this.messageCallback = _arg3;
moviePlayer = new MoviePlayer(Global.defaultDisplayObject);
coreGame = new CoreGame(_arg1, _arg2, messageReciver);
currentTick = 0;
level = 0;
ghState = STATE_START;
logoPlayer2 = new LogoPlayer(Global.defaultDisplayObject.GameLogo_mc);
scrambling = false;
gameStarted = false;
blingStars = new BlingStars(Global.defaultDisplayObject.blingStarsHolder_mc);
normalGameLoopVolume = true;
}
public function tick():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
if ((((ghState == STATE_PLAY)) && (input.mouseIsPressed))){
Communicator.sendPlayData3(20, currentTick, coreGame.getTime(), input.xMouse, input.yMouse);
};
scrambleButton();
switch (ghState){
case STATE_START:
break;
case STATE_PAUSE:
break;
case INIT_GAME:
if (coreGame.initParts()){
coreGame.addBoardToDisplay();
ghState = STATE_PAUSE;
coreGame.render(1);
};
break;
case PRE_LEVEL:
level++;
coreGame.setupLevel(level);
tickCounter = 99;
ghState = LEVEL_INTRO;
break;
case NEXT_LEVEL:
if (tickCounter == 10){
level++;
coreGame.setupLevel(level);
tickCounter = 0;
SoundManager.playLevelStart();
ghState = LEVEL_INTRO;
blingStars.inactivateAll();
};
coreGame.tick(currentTick);
currentTick++;
blingStars.tick();
break;
case LEVEL_INTRO:
if (tickCounter == 10){
normalGameLoopVolume = true;
};
coreGame.tick(currentTick);
currentTick++;
break;
case STATE_PLAY:
coreGame.tick(currentTick);
currentTick++;
break;
case STATE_SCRAMBLE:
coreGame.tick(currentTick);
currentTick++;
if (tickCounter == 40){
moviePlayer.hideScramble();
};
if (tickCounter == 46){
coreGame.gameGUI.showMiddleLedTime();
ghState = STATE_PLAY;
if (Communicator.isRelaxGame()){
tryToExitGame();
};
if (coreGame.littleTimeLeft()){
SoundManager.playTimeOutLoop();
};
};
break;
case END_LEVEL:
if (coreGame.updateEndLevelAnim()){
tickCounter = 0;
_local1 = coreGame.getScore();
_local2 = 1000;
coreGame.addScore(_local2);
_local3 = coreGame.getScore();
moviePlayer.setLevelSignScore(_local1, _local2, _local3);
if (level >= 3){
moviePlayer.animInLevelSign(2);
} else {
moviePlayer.animInLevelSign(1);
};
SoundManager.playLevelEnd();
ghState = SHOW_LEVEL_SIGN;
_local4 = (7 * level);
if (_local4 > 56){
_local4 = 56;
};
blingStars.init(_local4);
};
coreGame.tick(currentTick);
currentTick++;
endLevelCounter++;
break;
case SHOW_LEVEL_SIGN:
if ((((tickCounter == SHOW_LEVEL_SIGN_TICKS)) || ((((tickCounter >= 31)) && (input.mouseIsPressed))))){
nextLevel();
};
coreGame.tick(currentTick);
currentTick++;
blingStars.tick();
break;
case STATE_TIMESUP:
coreGame.tick(currentTick);
currentTick++;
if (tickCounter > (2 * 25)){
tickCounter = 0;
moviePlayer.hideTimesup();
coreGame.gameGUI.showMiddleLedTime();
if (level >= 4){
moviePlayer.animInLevelSign(2);
} else {
moviePlayer.animInLevelSign(1);
};
SoundManager.playLevelEnd();
Communicator.sendPlayData2(15, currentTick, coreGame.getTime(), coreGame.getScore());
Communicator.gameEnd(coreGame.getScore());
ghState = STATE_GAME_OVER;
_local4 = (7 * level);
if (_local4 > 56){
_local4 = 56;
};
blingStars.init(_local4);
};
break;
case STATE_GAME_OVER:
moviePlayer.setGameEndsIn((GAME_ENDS_IN_TICKS - tickCounter));
if (tickCounter == 20){
SoundManager.playEndLoop();
};
if ((((tickCounter == GAME_ENDS_IN_TICKS)) || ((((tickCounter >= 30)) && (input.mouseIsPressed))))){
Communicator.sendPlayData2(17, currentTick, coreGame.getTime(), coreGame.getScore());
Communicator.gameQuit();
ghState = STATE_END;
blingStars.inactivateAll();
};
blingStars.tick();
break;
case STATE_GAME_OVER_FREE:
moviePlayer.setGameEndsIn((GAME_ENDS_IN_TICKS - tickCounter));
if (tickCounter == 20){
SoundManager.playEndLoop();
};
if ((((tickCounter == GAME_ENDS_IN_TICKS)) || ((((tickCounter >= 30)) && (input.mouseIsPressed))))){
Communicator.sendPlayData2(17, currentTick, coreGame.getTime(), coreGame.getScore());
Communicator.gameQuit();
ghState = STATE_END;
blingStars.inactivateAll();
};
blingStars.tick();
break;
case STATE_END:
break;
};
moviePlayer.tick();
logoPlayer2.tick();
tickCounter++;
tickCounter2++;
}
public function render(_arg1:Number):void{
switch (ghState){
case STATE_START:
break;
case STATE_PAUSE:
break;
case INIT_GAME:
break;
case PRE_LEVEL:
coreGame.render(_arg1);
break;
case NEXT_LEVEL:
coreGame.render(_arg1);
blingStars.render();
break;
case LEVEL_INTRO:
coreGame.render(_arg1);
blingStars.render();
break;
case STATE_PLAY:
coreGame.render(_arg1);
break;
case STATE_SCRAMBLE:
coreGame.render(_arg1);
break;
case END_LEVEL:
coreGame.render(_arg1);
break;
case SHOW_LEVEL_SIGN:
coreGame.render(_arg1);
blingStars.render();
break;
case STATE_TIMESUP:
coreGame.render(_arg1);
break;
case STATE_GAME_OVER:
blingStars.render();
break;
case STATE_GAME_OVER_FREE:
blingStars.render();
break;
case STATE_END:
blingStars.render();
break;
};
moviePlayer.render(_arg1);
logoPlayer2.render(_arg1);
}
public function initGame(){
ghState = INIT_GAME;
}
public function startGame(){
gameStarted = true;
ghState = PRE_LEVEL;
Communicator.sendPlayData2(10, currentTick, coreGame.getTime(), coreGame.getScore());
Communicator.gameStarted();
SoundManager.stopIntroLoop();
SoundManager.playGameLoop();
}
public function gameIsPaused():Boolean{
if (ghState == STATE_PAUSE){
return (true);
};
return (false);
}
public function tryToExitGame(){
Communicator.sendPlayData(40, currentTick, coreGame.getTime());
coreGame.tryToExitGame();
}
public function messageReciver(_arg1:String, _arg2:InfoData){
if (_arg1 == "level_finished"){
onLevelFinished();
} else {
if (_arg1 == "level_ready"){
onLevelReady();
} else {
if (_arg1 == "finish_game"){
onFinishGame();
} else {
if (_arg1 == "exit_game"){
onExitGame();
} else {
if (_arg1 == "little_time_left"){
onLittleTimeLeft();
} else {
if (_arg1 == "scrambling"){
onScrambling();
} else {
if (_arg1 == "demo_finish_game"){
onDemoFinishGame();
};
};
};
};
};
};
};
}
private function onLevelFinished(){
tickCounter = 0;
normalGameLoopVolume = false;
SoundManager.stopTimeOutLoop();
coreGame.initEndLevelAnim();
Communicator.sendPlayData2(12, currentTick, coreGame.getTime(), coreGame.getScore());
endLevelCounter = 0;
ghState = END_LEVEL;
}
private function onLevelReady(){
Communicator.sendPlayData2(11, currentTick, coreGame.getTime(), level);
ghState = STATE_PLAY;
}
private function onFinishGame(){
moviePlayer.showTimesup();
SoundManager.playTimeSign();
coreGame.gameGUI.hideMiddleLedTime();
var _local1:int = coreGame.getScore();
moviePlayer.setLevelSignScore(_local1, 0, _local1);
moviePlayer.setGameEnds();
tickCounter = 0;
ghState = STATE_TIMESUP;
SoundManager.stopGameLoop();
SoundManager.stopTimeOutLoop();
}
private function onDemoFinishGame(){
var _local1:int = coreGame.getScore();
moviePlayer.setLevelSignScore(_local1, 0, _local1);
moviePlayer.setGameEnds();
tickCounter = 0;
SoundManager.stopGameLoop();
SoundManager.stopTimeOutLoop();
coreGame.tick(currentTick);
currentTick++;
tickCounter = 0;
if (level >= 4){
moviePlayer.animInLevelSign(2);
} else {
moviePlayer.animInLevelSign(1);
};
moviePlayer.showFreeGameText();
SoundManager.playLevelEnd();
Communicator.sendPlayData2(15, currentTick, coreGame.getTime(), coreGame.getScore());
Communicator.gameEnd(coreGame.getScore());
ghState = STATE_GAME_OVER_FREE;
var _local2:int = (7 * level);
if (_local2 > 56){
_local2 = 56;
};
blingStars.init(_local2);
}
private function onExitGame(){
tickCounter = 0;
moviePlayer.animInLevelSign(3);
SoundManager.stopGameLoop();
SoundManager.stopTimeOutLoop();
SoundManager.playLevelEnd();
var _local1:int = coreGame.getScore();
moviePlayer.setLevelSignScore(_local1, 0, _local1);
moviePlayer.setGameEnds();
Communicator.sendPlayData2(16, currentTick, coreGame.getTime(), coreGame.getScore());
Communicator.gameEnd(coreGame.getScore());
ghState = STATE_GAME_OVER;
var _local2:int = (7 * level);
if (_local2 > 56){
_local2 = 56;
};
blingStars.init(_local2);
}
private function onLittleTimeLeft(){
SoundManager.playTimeOutLoop();
}
private function onScrambling(){
moviePlayer.showScramble();
coreGame.gameGUI.hideMiddleLedTime();
tickCounter = 0;
ghState = STATE_SCRAMBLE;
SoundManager.stopTimeOutLoop();
SoundManager.playNoMoreMoves();
Communicator.sendPlayData(19, currentTick, coreGame.getTime());
}
private function scrambleButton(){
if (Communicator.isRelaxGame() == false){
if ((((((((((input.xMouse >= 592)) && ((input.xMouse <= 654)))) && ((input.yMouse >= 324)))) && ((input.yMouse <= 385)))) && (input.mouseIsPressed))){
moviePlayer.scrambleButtonPressed();
if (ghState == STATE_PLAY){
coreGame.scramble();
};
};
};
}
public function soundOff(){
SoundManager.soundOff();
}
public function soundOn(){
SoundManager.soundOn();
if ((((((((ghState == STATE_TIMESUP)) || ((ghState == STATE_GAME_OVER)))) || ((ghState == STATE_GAME_OVER_FREE)))) || ((ghState == STATE_END)))){
SoundManager.playEndLoop();
} else {
SoundManager.playGameLoop();
if (coreGame.ledsAreJumping()){
SoundManager.playTimeOutLoop();
};
};
}
private function nextLevel(){
Communicator.sendPlayData(13, currentTick, coreGame.getTime());
moviePlayer.animOutLevelSign();
tickCounter = 0;
ghState = NEXT_LEVEL;
blingStars.stopGenerate();
}
}
}//package com.king.twistmesilly
Section 12
//Global (com.king.twistmesilly.Global)
package com.king.twistmesilly {
import flash.display.*;
import com.king.twistmesilly.*;
class Global {
public static var defaultDisplayObject:MovieClip;
public static var gameHolder:MovieClip;
public static var playFieldClip0:MovieClip;
public static var playFieldClip1:MovieClip;
public static var playFieldClip2:MovieClip;
public static var playFieldClip3:MovieClip;
public static function CreateClips(){
gameHolder = defaultDisplayObject.game_holder_mc;
playFieldClip1 = new MovieClip();
gameHolder.addChild(playFieldClip1);
playFieldClip0 = new MovieClip();
gameHolder.addChild(playFieldClip0);
playFieldClip2 = new MovieClip();
gameHolder.addChild(playFieldClip2);
playFieldClip3 = new MovieClip();
gameHolder.addChild(playFieldClip3);
}
}
}//package com.king.twistmesilly
Section 13
//GraphicBrick (com.king.twistmesilly.GraphicBrick)
package com.king.twistmesilly {
import flash.display.*;
import com.king.twistmesilly.*;
class GraphicBrick {
public var clip:MovieClip;
private var showClip:Boolean;
public var posX:int;
public var posY:int;
public var offsetY:int;
public var rows:int;
private var horizontalOrientation:Boolean;
public var toBeRemoved:Boolean;
private var state:int;
private var fading:Boolean;
private var scale:Number;
private var fadingFrameCounter:int;
private var rotationAngle:Number;
private var rotationDeltaAngle:Number;
private var rotationDeltaAngle2:Number;
private var rotationAngle2:Number;
private var oldRotationAngle:Number;// = 0
private var color:int;
private var lightsFrame:int;
private var mouseOverFrame:int;
private var mouseOverBrick:Boolean;
private var specialFrame:int;
private var specialEndFrame:int;
private var lightFrame:int;
private var turnOn:Boolean;
private var turnOff:Boolean;
private var lightOffFrame:int;
private var lightOnFrame:int;
private var lightState:int;
private var lightningFrame:int;
private var lightningLeft:Boolean;
private var lightningRight:Boolean;
private var lightningCrossUp:Boolean;
private var lightningCrossDown:Boolean;
private var crossType:Boolean;
private var showSpecialBomb:Boolean;
private var showSpecialSidewayBlast:Boolean;
private var showSpecialColorBlast:Boolean;
private var instanceNr:int;
private var iFloatY:IFloat;
private var showHint:Boolean;
private var hintFrame:int;
private var forceRender:Boolean;// = false
private var forceRenderValue:Number;// = 1
private static var OFFSET_X:int = 100;
private static var OFFSET_Y:int = 100;
public static var FADING_FRAMES:int = 15;
private static var ROTATION_FRAMES:int = Brick.SWITCHING_FRAMES;
private static var STATE_NORMAL:int = 0;
private static var STATE_ROTATE:int = 1;
public static var MOVSE_OVER_FRAMES:int = 32;
public static var SPECIAL_BOMB_END_FRAME:int = 9;
public static var SPECIAL_SIDEWAY_END_FRAME:int = 17;
public static var SPECIAL_COLOR_BLAST_END_FRAME:int = 20;
public static var RED_LIGHTS_OFF:int = 21;
public static var RED_LIGHTS_ON:int = 25;
public static var GREEN_LIGHTS_OFF:int = 11;
public static var GREEN_LIGHTS_ON:int = 15;
public static var BLUE_LIGHTS_OFF:int = 41;
public static var BLUE_LIGHTS_ON:int = 45;
public static var CERISE_LIGHTS_OFF:int = 31;
public static var CERISE_LIGHTS_ON:int = 35;
public static var MULTI_COLOR_LIGHTS_OFF:int = 1;
public static var MULTI_COLOR_LIGHTS_ON:int = 5;
public static var LIGHT_STATE_TURN_ON = 0;
public static var LIGHT_STATE_TURN_OFF = 1;
private static var nrGraphicBricks:int = 0;
function GraphicBrick(){
crossType = false;
this.clip = new BrickC();
clip.visible = false;
clip.cacheAsBitmap = true;
clip.lights_mc.cacheAsBitmap = true;
clip.mouse_over_mc.cacheAsBitmap = true;
clip.lights_mc.cacheAsBitmap = true;
clip.special_mc.cacheAsBitmap = true;
show();
posX = 0;
posY = 0;
offsetY = 0;
toBeRemoved = false;
scale = 1;
setHorizontal();
fading = false;
state = STATE_NORMAL;
nrGraphicBricks++;
iFloatY = new IFloat(0);
instanceNr = nrGraphicBricks;
showHint = false;
}
public function init(_arg1:int){
this.rows = _arg1;
mouseOverFrame = 1;
specialFrame = 1;
lightningFrame = 1;
hideMouseOver();
turnOn = false;
turnOff = false;
lightsOff();
hideLightningLeft();
hideLightningRight();
hideCrossLightningUp();
hideCrossLightningDown();
showSpecialBomb = false;
showSpecialSidewayBlast = false;
showSpecialColorBlast = false;
lightState = LIGHT_STATE_TURN_OFF;
showHint = false;
}
public function addToDisplay(){
Global.playFieldClip1.addChild(clip);
}
public function onTop(){
Global.playFieldClip1.setChildIndex(clip, (nrGraphicBricks - 1));
}
public function tick(){
if (fading){
scale = (1 - (fadingFrameCounter / (FADING_FRAMES * 1)));
if (fadingFrameCounter == FADING_FRAMES){
hide();
toBeRemoved = true;
};
fadingFrameCounter++;
return;
};
switch (state){
case STATE_NORMAL:
break;
case STATE_ROTATE:
rotationAngle = (rotationAngle + rotationDeltaAngle);
rotationAngle2 = (rotationAngle2 + rotationDeltaAngle2);
if (rotationAngle >= 0){
rotationAngle = 0;
horizontalOrientation = true;
state = STATE_NORMAL;
} else {
if (rotationAngle <= -90){
rotationAngle = -90;
horizontalOrientation = false;
state = STATE_NORMAL;
};
};
if (rotationAngle2 >= 0){
rotationAngle2 = 0;
} else {
if (rotationAngle2 <= -90){
rotationAngle2 = -90;
};
};
break;
};
mouseOverFrame = (mouseOverFrame + 1);
if (mouseOverFrame > MOVSE_OVER_FRAMES){
mouseOverFrame = 1;
};
switch (lightState){
case LIGHT_STATE_TURN_ON:
lightFrame = (lightFrame + 1);
if (lightFrame > lightOnFrame){
lightFrame = lightOnFrame;
};
break;
case LIGHT_STATE_TURN_OFF:
lightFrame = (lightFrame - 1);
if (lightFrame < lightOffFrame){
lightFrame = lightOffFrame;
};
break;
};
lightningFrame = (lightningFrame + 1);
if (lightningFrame > 49){
lightningFrame = 1;
};
lightningFrame = 1;
specialFrame = (specialFrame + 1);
if (specialFrame > specialEndFrame){
specialFrame = 1;
};
if (showHint){
hintFrame++;
if (hintFrame > 30){
hintFrame = 1;
};
};
iFloatY.set(posY);
}
public function initRender(){
clip.visible = false;
clip.scaleX = scale;
clip.scaleY = scale;
clip.sidewayblast_mc.visible = false;
clip.special_mc.colourbomb_green_mc.visible = false;
clip.special_mc.colourbomb_red_mc.visible = false;
clip.special_mc.colourbomb_blue_mc.visible = false;
clip.special_mc.colourbomb_cerise_mc.visible = false;
clip.special_mc.sparkle_mc.visible = false;
clip.mouse_over_mc.visible = false;
clip.mouse_over_mc.gotoAndStop(1);
clip.lights_mc.gotoAndStop(lightFrame);
if (clip.lights_mc.left_lightning_mc){
clip.lights_mc.left_lightning_mc.visible = false;
clip.lights_mc.left_lightning_mc.gotoAndStop(1);
};
if (clip.lights_mc.right_lightning_mc){
clip.lights_mc.right_lightning_mc.visible = false;
clip.lights_mc.right_lightning_mc.gotoAndStop(1);
};
if (clip.lights_mc.up_lightning_mc){
clip.lights_mc.up_lightning_mc.visible = false;
clip.lights_mc.up_lightning_mc.gotoAndStop(1);
};
if (clip.lights_mc.down_lightning_mc){
clip.lights_mc.down_lightning_mc.visible = false;
clip.lights_mc.down_lightning_mc.gotoAndStop(1);
};
clip.special_mc.sparkle_mc.visible = false;
clip.special_mc.sparkle_mc.gotoAndStop(1);
clip.sidewayblast_mc.visible = true;
clip.sidewayblast_mc.gotoAndStop(1);
clip.special_mc.colourbomb_red_mc.visible = true;
clip.special_mc.colourbomb_red_mc.gotoAndStop(1);
clip.special_mc.colourbomb_green_mc.visible = true;
clip.special_mc.colourbomb_green_mc.gotoAndStop(1);
clip.special_mc.colourbomb_blue_mc.visible = true;
clip.special_mc.colourbomb_blue_mc.gotoAndStop(1);
clip.special_mc.colourbomb_cerise_mc.visible = true;
clip.special_mc.colourbomb_cerise_mc.gotoAndStop(1);
clip.special_mc.colourbomb_cerise_mc.visible = true;
clip.special_mc.colourbomb_cerise_mc.gotoAndStop(1);
clip.card2_mc.gotoAndStop(1);
clip.hint_mc.visible = false;
clip.hint_mc.gotoAndStop(1);
clip.x = posX;
clip.y = posY;
}
public function render(_arg1:Number){
if (((showClip) && ((posY > -50)))){
clip.visible = true;
} else {
clip.visible = false;
};
clip.scaleX = scale;
clip.scaleY = scale;
clip.sidewayblast_mc.visible = false;
clip.special_mc.colourbomb_green_mc.visible = false;
clip.special_mc.colourbomb_red_mc.visible = false;
clip.special_mc.colourbomb_blue_mc.visible = false;
clip.special_mc.colourbomb_cerise_mc.visible = false;
clip.special_mc.sparkle_mc.visible = false;
clip.mouse_over_mc.visible = mouseOverBrick;
if (mouseOverBrick){
clip.mouse_over_mc.gotoAndStop(mouseOverFrame);
};
clip.lights_mc.gotoAndStop(lightFrame);
if (clip.lights_mc.left_lightning_mc){
if (lightningLeft){
clip.lights_mc.left_lightning_mc.visible = true;
clip.lights_mc.left_lightning_mc.gotoAndStop(lightningFrame);
} else {
clip.lights_mc.left_lightning_mc.visible = false;
clip.lights_mc.left_lightning_mc.gotoAndStop(1);
};
};
if (clip.lights_mc.right_lightning_mc){
if (lightningRight){
clip.lights_mc.right_lightning_mc.visible = true;
clip.lights_mc.right_lightning_mc.gotoAndStop(lightningFrame);
} else {
clip.lights_mc.right_lightning_mc.visible = false;
clip.lights_mc.right_lightning_mc.gotoAndStop(1);
};
};
if (clip.lights_mc.up_lightning_mc){
if (lightningCrossUp){
clip.lights_mc.up_lightning_mc.visible = true;
clip.lights_mc.up_lightning_mc.gotoAndStop(lightningFrame);
} else {
clip.lights_mc.up_lightning_mc.visible = false;
clip.lights_mc.up_lightning_mc.gotoAndStop(1);
};
};
if (clip.lights_mc.down_lightning_mc){
if (lightningCrossDown){
clip.lights_mc.down_lightning_mc.visible = true;
clip.lights_mc.down_lightning_mc.gotoAndStop(lightningFrame);
} else {
clip.lights_mc.down_lightning_mc.visible = false;
clip.lights_mc.down_lightning_mc.gotoAndStop(1);
};
};
if (showSpecialBomb){
clip.special_mc.sparkle_mc.visible = true;
clip.special_mc.sparkle_mc.gotoAndStop(specialFrame);
} else {
clip.special_mc.sparkle_mc.gotoAndStop(1);
};
if (showSpecialSidewayBlast){
clip.sidewayblast_mc.visible = true;
clip.sidewayblast_mc.gotoAndStop(specialFrame);
} else {
clip.sidewayblast_mc.gotoAndStop(1);
};
if (showSpecialColorBlast){
switch (color){
case Brick.COLOR_RED:
clip.special_mc.colourbomb_red_mc.visible = true;
clip.special_mc.colourbomb_red_mc.gotoAndStop(specialFrame);
break;
case Brick.COLOR_GREEN:
clip.special_mc.colourbomb_green_mc.visible = true;
clip.special_mc.colourbomb_green_mc.gotoAndStop(specialFrame);
break;
case Brick.COLOR_BLUE:
clip.special_mc.colourbomb_blue_mc.visible = true;
clip.special_mc.colourbomb_blue_mc.gotoAndStop(specialFrame);
break;
case Brick.COLOR_CERISE:
clip.special_mc.colourbomb_cerise_mc.visible = true;
clip.special_mc.colourbomb_cerise_mc.gotoAndStop(specialFrame);
break;
case Brick.MULTI_COLOR:
clip.special_mc.colourbomb_cerise_mc.visible = true;
clip.special_mc.colourbomb_cerise_mc.gotoAndStop(specialFrame);
break;
};
} else {
clip.special_mc.colourbomb_red_mc.gotoAndStop(1);
clip.special_mc.colourbomb_green_mc.gotoAndStop(1);
clip.special_mc.colourbomb_blue_mc.gotoAndStop(1);
clip.special_mc.colourbomb_cerise_mc.gotoAndStop(1);
};
if (crossType){
clip.card2_mc.gotoAndStop(2);
} else {
clip.card2_mc.gotoAndStop(1);
};
clip.hint_mc.visible = showHint;
clip.hint_mc.gotoAndStop(hintFrame);
clip.x = posX;
clip.y = iFloatY.get(_arg1);
if (rotationAngle != oldRotationAngle){
clip.lights_mc.rotation = rotationAngle;
clip.special_mc.rotation = rotationAngle;
clip.card2_mc.rotation = rotationAngle;
clip.card1_mc.rotation = rotationAngle2;
};
oldRotationAngle = rotationAngle;
if (forceRender){
forceRender = false;
if (forceRenderValue == 1){
forceRenderValue = 0.99;
} else {
forceRenderValue = 1;
};
clip.lights_mc.alpha = forceRenderValue;
};
}
public function doForcedRender():void{
forceRender = true;
}
public function turnOnShowHint(){
if (showHint == false){
hintFrame = int((Math.random() * 30));
showHint = true;
};
}
public function turnOffShowHint(){
showHint = false;
}
public function lightsOn(){
lightFrame = lightOnFrame;
}
public function lightsOff(){
lightFrame = lightOffFrame;
}
public function turnOnLights(){
lightState = LIGHT_STATE_TURN_ON;
}
public function turnOffLights(){
lightState = LIGHT_STATE_TURN_OFF;
}
public function showLightningLeft(){
lightningLeft = true;
}
public function hideLightningLeft(){
lightningLeft = false;
}
public function showLightningRight(){
lightningRight = true;
}
public function hideLightningRight(){
lightningRight = false;
}
public function showCrossLightningUp(){
lightningCrossUp = true;
}
public function hideCrossLightningUp(){
lightningCrossUp = false;
}
public function showCrossLightningDown(){
lightningCrossDown = true;
}
public function hideCrossLightningDown(){
lightningCrossDown = false;
}
public function setPos(_arg1:int, _arg2:int){
posX = (CoreGame.BOARD_HORIZONTAL_OFFSET + (50 * _arg1));
posY = (((CoreGame.BOARD_VERTICAL_OFFSET + (50 * _arg2)) - (rows * 50)) + offsetY);
}
public function getPosX():int{
return (posX);
}
public function getPosY():int{
return (posY);
}
public function copyPos(_arg1:GraphicBrick){
posX = _arg1.posX;
posY = _arg1.posY;
}
public function setOffsetY(_arg1:int){
offsetY = int(((50 * _arg1) * 0.01));
}
public function setHorizontal(){
rotationAngle = 0;
rotationAngle2 = rotationAngle;
horizontalOrientation = true;
state = STATE_NORMAL;
}
public function setVertical(){
rotationAngle = -90;
rotationAngle2 = rotationAngle;
horizontalOrientation = false;
state = STATE_NORMAL;
}
public function rotateToHorizontal(){
rotationDeltaAngle = (90 / ROTATION_FRAMES);
rotationDeltaAngle2 = (90 / (ROTATION_FRAMES - 1));
state = STATE_ROTATE;
}
public function rotateToVertical(){
rotationDeltaAngle = (-90 / ROTATION_FRAMES);
rotationDeltaAngle2 = (-90 / (ROTATION_FRAMES - 1));
state = STATE_ROTATE;
}
public function setColor(_arg1:int){
this.color = _arg1;
lightsFrame = (_arg1 + 1);
switch (_arg1){
case Brick.COLOR_RED:
lightOffFrame = RED_LIGHTS_OFF;
lightOnFrame = RED_LIGHTS_ON;
break;
case Brick.COLOR_GREEN:
lightOffFrame = GREEN_LIGHTS_OFF;
lightOnFrame = GREEN_LIGHTS_ON;
break;
case Brick.COLOR_BLUE:
lightOffFrame = BLUE_LIGHTS_OFF;
lightOnFrame = BLUE_LIGHTS_ON;
break;
case Brick.COLOR_CERISE:
lightOffFrame = CERISE_LIGHTS_OFF;
lightOnFrame = CERISE_LIGHTS_ON;
break;
case Brick.MULTI_COLOR:
lightOffFrame = MULTI_COLOR_LIGHTS_OFF;
lightOnFrame = MULTI_COLOR_LIGHTS_ON;
break;
};
if (crossType){
lightOffFrame = (lightOffFrame + 5);
lightOnFrame = (lightOnFrame + 5);
};
lightsOff();
}
public function setCross(_arg1:Boolean){
crossType = _arg1;
}
public function setSpecial(_arg1:int){
switch (_arg1){
case Brick.SPECIAL_BOMB:
specialFrame = 1;
specialEndFrame = SPECIAL_BOMB_END_FRAME;
showSpecialBomb = true;
break;
case Brick.SPECIAL_SIDEWAY_BLAST:
specialFrame = 1;
specialEndFrame = SPECIAL_SIDEWAY_END_FRAME;
showSpecialSidewayBlast = true;
break;
case Brick.SPECIAL_COLOR_BLAST:
specialFrame = 1;
specialEndFrame = SPECIAL_COLOR_BLAST_END_FRAME;
showSpecialColorBlast = true;
break;
default:
showSpecialBomb = false;
showSpecialSidewayBlast = false;
showSpecialColorBlast = false;
break;
};
}
public function show(){
showClip = true;
}
public function hide(){
showClip = false;
}
public function showMouseOver(){
mouseOverBrick = true;
}
public function hideMouseOver(){
mouseOverBrick = false;
}
public function startFading(){
fadingFrameCounter = 1;
fading = true;
}
public function deleting(){
if (Global.defaultDisplayObject.contains(clip)){
Global.playFieldClip1.removeChild(clip);
};
clip = null;
}
}
}//package com.king.twistmesilly
Section 14
//IFloat (com.king.twistmesilly.IFloat)
package com.king.twistmesilly {
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){
ivalue = _arg1;
lastValue = _arg1;
}
public static function setAlpha(_arg1:Number){
alpha = _arg1;
}
}
}//package com.king.twistmesilly
Section 15
//InfoData (com.king.twistmesilly.InfoData)
package com.king.twistmesilly {
class InfoData {
public var data1:int;
public var data2:int;
public var data3:int;
public var data4:int;
public var data5:int;
public var data6:int;
public var graphicBrick:GraphicBrick;
}
}//package com.king.twistmesilly
Section 16
//Input (com.king.twistmesilly.Input)
package com.king.twistmesilly {
class Input {
public var xMouse:int;
public var yMouse:int;
public var mouseIsPressed:Boolean;
public var mouseIsReleased:Boolean;
public function init(){
reset();
}
public function reset(){
mouseIsPressed = false;
mouseIsReleased = false;
}
public function setMousePos(_arg1:Number, _arg2:Number){
xMouse = _arg1;
yMouse = _arg2;
}
public function mousePressed(){
mouseIsPressed = true;
}
public function mouseReleased(){
mouseIsReleased = true;
}
public function printInput(){
}
}
}//package com.king.twistmesilly
Section 17
//Integer64 (com.king.twistmesilly.Integer64)
package com.king.twistmesilly {
import com.king.twistmesilly.*;
class Integer64 {
private var p:Array;
private var r:Array;
private var s:Array;
function Integer64(_arg1){
r = [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]];
p = [0, 0, 0, 0, 0];
s = [0, 0, 0];
if (_arg1){
merge(_arg1);
};
}
public function init(_arg1:Integer64):void{
var _local2:* = 0;
while (_local2 < p.length) {
p[_local2] = _arg1.p[_local2];
_local2++;
};
}
public function init32(_arg1:Number):void{
p[0] = (_arg1 & 32767);
_arg1 = (_arg1 >>> 15);
p[1] = (_arg1 & 32767);
_arg1 = (_arg1 >>> 15);
p[2] = (_arg1 & 3);
p[3] = 0;
p[4] = 0;
}
public function get lsb():Number{
return (((p[0] | (p[1] << 15)) | ((p[2] & 3) << 30)));
}
public function get msb():Number{
return (((((p[2] >> 2) | ((p[3] << 15) >> 2)) | ((p[4] << (15 * 2)) >> 2)) & 2147483647));
}
public function binaryShiftLeft(_arg1:Number):void{
var _local2:* = 0;
while (_local2 < _arg1) {
shl();
_local2++;
};
}
public function binaryShiftRight(_arg1:Number):void{
var _local5:*;
var _local6:*;
var _local2:* = ((_arg1 / 15) >> 0);
var _local3:* = (_arg1 - (_local2 * 15));
var _local4:* = (p.length - 1);
while (_local4 > 0) {
_local5 = 0;
while (_local5 < _local2) {
p[_local5] = p[(_local5 + 1)];
_local5++;
};
var _temp1 = _local4;
_local4 = (_local4 - 1);
var _local7 = _temp1;
p[_local7] = 0;
};
if (_local3 > 0){
_local6 = 0;
while (_local6 < _local3) {
shr();
_local6++;
};
};
}
public function binaryNot(_arg1:Integer64):void{
p[0] = (p[0] ^ _arg1.p[0]);
p[1] = (p[1] ^ _arg1.p[1]);
p[2] = (p[2] ^ _arg1.p[2]);
p[3] = (p[3] ^ _arg1.p[3]);
p[4] = (p[4] ^ _arg1.p[4]);
}
public function add64(_arg1:Integer64):void{
var _local2:* = 0;
var _local3:* = 1;
var _local4:* = 0;
while ((((_local3 < p.length)) && (!((_arg1.p[_local4] == 0))))) {
_local3++;
};
_local4 = 0;
while (_local4 < _local3) {
_local2 = (_local2 + (p[_local4] + _arg1.p[_local4]));
p[_local4] = (_local2 & 32767);
_local2 = (_local2 >> 15);
_local4++;
};
}
public function add32(_arg1:Number):void{
var _local2:* = 0;
var _local3:* = (_arg1 & 32767);
_arg1 = (_arg1 >> 15);
var _local4:* = (_arg1 & 32767);
_arg1 = (_arg1 >> 15);
var _local5:* = (_arg1 & 3);
_local2 = (_local2 + (p[0] + _local3));
p[0] = (_local2 & 32767);
_local2 = (_local2 >> 15);
_local2 = (_local2 + (p[1] + _local4));
p[1] = (_local2 & 32767);
_local2 = (_local2 >> 15);
_local2 = (_local2 + (p[2] + _local5));
p[2] = (_local2 & 32767);
}
public function mulu32(_arg1:Number):void{
var _local4:*;
var _local2:* = 0;
s[0] = (_arg1 & 32767);
_arg1 = (_arg1 >>> 15);
s[1] = (_arg1 & 32767);
_arg1 = (_arg1 >>> 15);
s[2] = (_arg1 & 3);
var _local3:* = 0;
while (_local3 < 3) {
_local4 = s[_local3];
_local2 = (_local4 * p[0]);
r[_local3][0] = (_local2 & 32767);
_local2 = (_local2 >> 15);
_local2 = (_local2 + (_local4 * p[1]));
r[_local3][1] = (_local2 & 32767);
_local2 = (_local2 >> 15);
_local2 = (_local2 + (_local4 * p[2]));
r[_local3][2] = (_local2 & 3);
_local3++;
};
_local2 = r[0][0];
p[0] = (_local2 & 32767);
_local2 = (_local2 >> 15);
_local2 = (_local2 + (r[0][1] + r[1][0]));
p[1] = (_local2 & 32767);
_local2 = (_local2 >> 15);
_local2 = (_local2 + ((r[0][2] + r[1][1]) + r[2][0]));
p[2] = (_local2 & 3);
p[3] = 0;
p[4] = 0;
}
public function mul64(_arg1:Integer64):void{
var _local4:*;
var _local2:* = 0;
var _local3:* = 0;
while (_local3 < 5) {
_local4 = _arg1.p[_local3];
_local2 = (_local4 * p[0]);
r[_local3][0] = (_local2 & 32767);
_local2 = (_local2 >> 15);
_local2 = (_local2 + (_local4 * p[1]));
r[_local3][1] = (_local2 & 32767);
_local2 = (_local2 >> 15);
_local2 = (_local2 + (_local4 * p[2]));
r[_local3][2] = (_local2 & 32767);
_local2 = (_local2 >> 15);
_local2 = (_local2 + (_local4 * p[3]));
r[_local3][3] = (_local2 & 32767);
_local2 = (_local2 >> 15);
_local2 = (_local2 + (_local4 * p[4]));
r[_local3][4] = (_local2 & 32767);
_local3++;
};
_local2 = r[0][0];
p[0] = (_local2 & 32767);
_local2 = (_local2 >> 15);
_local2 = (_local2 + (r[0][1] + r[1][0]));
p[1] = (_local2 & 32767);
_local2 = (_local2 >> 15);
_local2 = (_local2 + ((r[0][2] + r[1][1]) + r[2][0]));
p[2] = (_local2 & 32767);
_local2 = (_local2 >> 15);
_local2 = (_local2 + (((r[0][3] + r[1][2]) + r[2][1]) + r[3][0]));
p[3] = (_local2 & 32767);
_local2 = (_local2 >> 15);
_local2 = (_local2 + ((((r[0][4] + r[1][3]) + r[2][2]) + r[3][1]) + r[4][0]));
p[4] = (_local2 & 7);
}
public function mul32(_arg1:Number):void{
mul64(new Integer64(_arg1));
}
private function merge(_arg1:Number):Number{
var _local2:* = 0;
while (_local2 < 3) {
p[_local2] = (p[_local2] + (_arg1 & 32767));
_arg1 = (_arg1 >>> 15);
_local2++;
};
return (_arg1);
}
private function shl():void{
var _local1:* = 0;
var _local2:* = 0;
var _local3:* = 0;
var _local4:* = p.length;
while (_local3 < _local4) {
_local1 = ((p[_local3] & 0x4000) >> 14);
p[_local3] = (p[_local3] << 1);
p[_local3] = ((p[_local3] | _local2) & 32767);
_local3++;
_local2 = _local1;
};
}
private function shr():void{
var _local1:* = 0;
var _local2:* = 0;
var _local3:* = (p.length - 1);
while (_local3 >= 0) {
_local1 = ((p[_local3] & 1) << 14);
p[_local3] = (p[_local3] >> 1);
p[_local3] = ((p[_local3] | _local2) & 32767);
_local3--;
_local2 = _local1;
};
}
}
}//package com.king.twistmesilly
Section 18
//IntroPlayer (com.king.twistmesilly.IntroPlayer)
package com.king.twistmesilly {
import flash.display.*;
import com.king.twistmesilly.*;
class IntroPlayer {
private var clip:MovieClip;
private var introVisible:Boolean;
private var introFrame:int;
private var introState:int;
private var logoPlayer:LogoPlayer;
private var introGameStartsIn:String;
public static var STAR_BLINK_CHANCE:int = 150;
public static var PLAY:int = 0;
public static var HIDE:int = 1;
function IntroPlayer(_arg1:MovieClip){
this.clip = _arg1;
introVisible = true;
introFrame = 0;
introState = PLAY;
introGameStartsIn = "";
logoPlayer = new LogoPlayer(_arg1.intro_mc.IntroLogo_mc);
}
public function tick(){
switch (introState){
case PLAY:
introFrame++;
if (introFrame > 600){
introFrame = 1;
};
logoPlayer.tick();
break;
case HIDE:
break;
};
}
public function render(_arg1:Number){
if (clip.intro_mc){
if (clip.intro_mc.heading1_txt){
if (clip.intro_mc.heading1_txt.text != TextProperties.INTRO_HEADING1){
clip.intro_mc.heading1_txt.text = TextProperties.INTRO_HEADING1;
};
};
if (clip.intro_mc.text1_txt){
if (clip.intro_mc.text1_txt.text != TextProperties.INTRO_TEXT1){
clip.intro_mc.text1_txt.text = TextProperties.INTRO_TEXT1;
};
};
if (clip.intro_mc.text2_txt){
if (clip.intro_mc.text2_txt.text != TextProperties.INTRO_TEXT2){
clip.intro_mc.text2_txt.text = TextProperties.INTRO_TEXT2;
};
};
if (clip.intro_mc.heading2_txt){
if (clip.intro_mc.heading2_txt.text != TextProperties.INTRO_HEADING2){
clip.intro_mc.heading2_txt.text = TextProperties.INTRO_HEADING2;
};
};
if (clip.intro_mc.text3_txt){
if (clip.intro_mc.text3_txt.text != TextProperties.INTRO_TEXT3){
clip.intro_mc.text3_txt.text = TextProperties.INTRO_TEXT3;
};
};
if (clip.intro_mc.text4_txt){
if (clip.intro_mc.text4_txt.text != TextProperties.INTRO_TEXT4){
clip.intro_mc.text4_txt.text = TextProperties.INTRO_TEXT4;
};
};
if (clip.intro_mc.text5_txt){
if (clip.intro_mc.text5_txt.text != TextProperties.INTRO_TEXT5){
clip.intro_mc.text5_txt.text = TextProperties.INTRO_TEXT5;
};
};
if (clip.intro_mc.like_this_mc){
if (clip.intro_mc.like_this_mc.like_this_txt.text != TextProperties.INTRO_LIKE_THIS){
clip.intro_mc.like_this_mc.like_this_txt.text = TextProperties.INTRO_LIKE_THIS;
};
};
if (clip.intro_mc.game_starts_in_txt.text != introGameStartsIn){
clip.intro_mc.game_starts_in_txt.text = introGameStartsIn;
};
if (clip.intro_mc.click_to_start_txt.text != TextProperties.INTRO_CLICK_TO_START){
clip.intro_mc.click_to_start_txt.text = TextProperties.INTRO_CLICK_TO_START;
};
clip.intro_mc.visible = introVisible;
clip.intro_mc.gotoAndStop(introFrame);
logoPlayer.render(_arg1);
};
}
public function hideIntro(){
introState = HIDE;
introVisible = false;
}
public function setGameStartsIn(_arg1:Number){
var _local2:Number = Math.floor((_arg1 / 25));
if (_local2 < 0){
_local2 = 0;
};
var _local3:String = String(_local2);
var _local4:String = TextProperties.INTRO_GAME_STARTS_IN;
_local4 = _local4.split("[0]").join(_local3);
introGameStartsIn = _local4;
}
}
}//package com.king.twistmesilly
Section 19
//LogoPlayer (com.king.twistmesilly.LogoPlayer)
package com.king.twistmesilly {
import flash.display.*;
import com.king.twistmesilly.*;
class LogoPlayer {
private var clip:MovieClip;
private var star1Frame;
private var star2Frame;
private var star3Frame;
private var star1Counter;
private var star2Counter;
private var star3Counter;
private var star1CounterMax;
private var star2CounterMax;
private var star3CounterMax;
public static var STAR_BLINK_CHANCE:int = 150;
function LogoPlayer(_arg1:MovieClip){
this.clip = _arg1;
initStars();
}
public function tick(){
tickStars();
}
public function render(_arg1:Number){
renderStars();
}
private function initStars(){
star1Counter = 21;
star2Counter = 21;
star3Counter = 21;
star1CounterMax = (Math.round((Math.random() * STAR_BLINK_CHANCE)) + 30);
star2CounterMax = (Math.round((Math.random() * STAR_BLINK_CHANCE)) + 30);
star3CounterMax = (Math.round((Math.random() * STAR_BLINK_CHANCE)) + 30);
star1Frame = star1Counter;
star2Frame = star2Counter;
star3Frame = star3Counter;
}
private function tickStars(){
var _local1:int;
star1Counter++;
if (star1Counter > star1CounterMax){
star1Counter = 1;
_local1 = (Math.round((Math.random() * STAR_BLINK_CHANCE)) + 30);
star1CounterMax = _local1;
};
if (star1Counter <= 21){
star1Frame = star1Counter;
};
star2Counter++;
if (star2Counter > star2CounterMax){
star2Counter = 1;
_local1 = (Math.round((Math.random() * STAR_BLINK_CHANCE)) + 30);
star2CounterMax = _local1;
};
if (star2Counter <= 21){
star2Frame = star2Counter;
};
star3Counter++;
if (star3Counter > star3CounterMax){
star3Counter = 1;
_local1 = (Math.round((Math.random() * STAR_BLINK_CHANCE)) + 30);
star3CounterMax = _local1;
};
if (star3Counter <= 21){
star3Frame = star3Counter;
};
}
private function renderStars(){
if (clip.star1_mc){
clip.star1_mc.gotoAndStop(star1Frame);
};
if (clip.star2_mc){
clip.star2_mc.gotoAndStop(star2Frame);
};
if (clip.star3_mc){
clip.star3_mc.gotoAndStop(star3Frame);
};
}
}
}//package com.king.twistmesilly
Section 20
//MoviePlayer (com.king.twistmesilly.MoviePlayer)
package com.king.twistmesilly {
import flash.display.*;
import com.king.twistmesilly.*;
class MoviePlayer {
private var clip:MovieClip;
private var levelSignAnimFrame:int;
private var levelSignFigureFrame:int;
private var levelSignStar1Frame:int;
private var levelSignStar2Frame:int;
private var animateLevelSignFigure:Boolean;
private var levelSignFrame:int;
private var levelSignVisible:Boolean;
private var levelSignState:int;
private var levelExplosinVisible:Boolean;
private var levelExplosionFrame:int;
private var timesup:Boolean;
private var timesupOut:Boolean;
private var timesUp:Boolean;
private var ledSignFrame:int;
private var ledSignInnerFrame:int;
private var figure1HappyVisible;
private var figure1NeutralVisible;
private var figure1SadVisible;
private var figure2HappyVisible;
private var figure2NeutralVisible;
private var figure2SadVisible:Boolean;
private var scrambleButtonFrame:int;
private var animateScrambleButton:Boolean;
private var soundButtonOn:Boolean;
private var soundButtonFrame:int;
private var turnOff:Boolean;
private var turnOffButtonFrame:int;
private var levelSignScore:String;// = ""
private var levelSingBonus:String;// = ""
private var levelSingTotalScore:String;// = ""
private var gameEndsIn:String;// = ""
private var showFreeGameEnd:Boolean;// = false
public static var LEVEL_SIGN_HIDE:int = 0;
public static var LEVEL_SIGN_IN:int = 1;
public static var LEVEL_SIGN_SHOWING:int = 2;
public static var LEVEL_SIGN_OUT:int = 3;
function MoviePlayer(_arg1:MovieClip){
this.clip = _arg1;
levelSignState = LEVEL_SIGN_HIDE;
levelExplosinVisible = false;
levelExplosionFrame = 1;
timesup = false;
timesupOut = false;
timesUp = true;
ledSignFrame = 1;
ledSignInnerFrame = 1;
figure1HappyVisible = false;
figure1NeutralVisible = false;
figure1SadVisible = false;
figure2HappyVisible = false;
figure2NeutralVisible = false;
figure2SadVisible = false;
scrambleButtonFrame = 1;
animateScrambleButton = false;
soundButtonOn = true;
soundButtonFrame = 1;
turnOff = false;
turnOffButtonFrame = 1;
}
public function tick(){
switch (levelSignState){
case LEVEL_SIGN_HIDE:
levelSignVisible = false;
levelSignAnimFrame = 1;
levelSignFrame = 1;
animateLevelSignFigure = false;
levelSignFigureFrame = 1;
levelSignStar1Frame = 1;
levelSignStar2Frame = 3;
break;
case LEVEL_SIGN_IN:
levelSignVisible = true;
levelSignAnimFrame++;
if (levelSignAnimFrame > 25){
levelSignAnimFrame = 25;
};
levelSignFrame++;
if (levelSignFrame > 90){
levelSignFrame = 35;
};
break;
case LEVEL_SIGN_SHOWING:
break;
case LEVEL_SIGN_OUT:
levelSignFrame = 25;
levelSignAnimFrame--;
if (levelSignAnimFrame < 1){
levelSignFrame = 1;
levelSignState = LEVEL_SIGN_HIDE;
animateLevelSignFigure = false;
};
break;
};
if (levelSignVisible){
levelSignStar1Frame++;
if (levelSignStar1Frame > 28){
levelSignStar1Frame = 1;
};
levelSignStar2Frame++;
if (levelSignStar2Frame > 28){
levelSignStar2Frame = 1;
};
};
if (animateLevelSignFigure){
levelSignFigureFrame++;
if (levelSignFigureFrame > 120){
levelSignFigureFrame = 35;
};
};
if (levelExplosinVisible){
levelExplosionFrame++;
if (levelExplosionFrame > 21){
levelExplosionFrame = 1;
levelExplosinVisible = false;
};
};
if (timesup){
ledSignFrame++;
if (ledSignFrame > 6){
ledSignFrame = 6;
};
ledSignInnerFrame++;
if (ledSignInnerFrame > 35){
ledSignInnerFrame = 7;
};
} else {
if (timesupOut){
ledSignFrame--;
ledSignInnerFrame--;
if (ledSignInnerFrame < 1){
ledSignInnerFrame = 1;
};
if (ledSignFrame < 1){
ledSignFrame = 1;
ledSignInnerFrame = 1;
timesupOut = false;
};
};
};
if (animateScrambleButton){
scrambleButtonFrame++;
if (scrambleButtonFrame > 8){
scrambleButtonFrame = 1;
animateScrambleButton = false;
};
};
if (soundButtonOn){
soundButtonFrame--;
if (soundButtonFrame < 1){
soundButtonFrame = 1;
};
} else {
soundButtonFrame++;
if (soundButtonFrame > 5){
soundButtonFrame = 5;
};
};
if (turnOff == true){
turnOffButtonFrame++;
if (turnOffButtonFrame > 5){
turnOffButtonFrame = 5;
};
};
}
public function render(_arg1:Number){
if (clip.level_sign_anim_mc.level_sign_mc.text_mc){
if (clip.level_sign_anim_mc.level_sign_mc.text_mc.score_txt.text != levelSignScore){
clip.level_sign_anim_mc.level_sign_mc.text_mc.score_txt.text = levelSignScore;
};
if (clip.level_sign_anim_mc.level_sign_mc.text_mc.bonus_txt.text != levelSingBonus){
clip.level_sign_anim_mc.level_sign_mc.text_mc.bonus_txt.text = levelSingBonus;
};
if (clip.level_sign_anim_mc.level_sign_mc.text_mc.total_score_txt.text != levelSingTotalScore){
clip.level_sign_anim_mc.level_sign_mc.text_mc.total_score_txt.text = levelSingTotalScore;
};
if (clip.level_sign_anim_mc.level_sign_mc.text_mc.heading_txt.text != TextProperties.LEVEL_SIGN_HEADING){
clip.level_sign_anim_mc.level_sign_mc.text_mc.heading_txt.text = TextProperties.LEVEL_SIGN_HEADING;
};
if (clip.level_sign_anim_mc.level_sign_mc.text_mc.score_text_txt.text != TextProperties.LEVEL_SIGN_SCORE_TEXT){
clip.level_sign_anim_mc.level_sign_mc.text_mc.score_text_txt.text = TextProperties.LEVEL_SIGN_SCORE_TEXT;
};
if (clip.level_sign_anim_mc.level_sign_mc.text_mc.bonus_text_txt.text != TextProperties.LEVEL_SIGN_BONUS_TEXT){
clip.level_sign_anim_mc.level_sign_mc.text_mc.bonus_text_txt.text = TextProperties.LEVEL_SIGN_BONUS_TEXT;
};
if (clip.level_sign_anim_mc.level_sign_mc.text_mc.total_score_text_txt.text != TextProperties.LEVEL_SIGN_TOTAL_SCORE_TEXT){
clip.level_sign_anim_mc.level_sign_mc.text_mc.total_score_text_txt.text = TextProperties.LEVEL_SIGN_TOTAL_SCORE_TEXT;
};
if (clip.level_sign_anim_mc.level_sign_mc.star1_mc){
clip.level_sign_anim_mc.level_sign_mc.star1_mc.gotoAndStop(levelSignStar1Frame);
};
if (clip.level_sign_anim_mc.level_sign_mc.star2_mc){
clip.level_sign_anim_mc.level_sign_mc.star2_mc.gotoAndStop(levelSignStar2Frame);
};
if (gameEndsIn != ""){
if (clip.level_sign_anim_mc.level_sign_mc.text_mc.click_text_txt.text != gameEndsIn){
clip.level_sign_anim_mc.level_sign_mc.text_mc.click_text_txt.text = gameEndsIn;
};
} else {
if (clip.level_sign_anim_mc.level_sign_mc.text_mc.click_text_txt.text != TextProperties.LEVEL_SIGN_CLICK_TEXT){
clip.level_sign_anim_mc.level_sign_mc.text_mc.click_text_txt.text = TextProperties.LEVEL_SIGN_CLICK_TEXT;
};
};
};
clip.level_sign_anim_mc.visible = levelSignVisible;
clip.level_sign_anim_mc.gotoAndStop(levelSignAnimFrame);
clip.level_sign_anim_mc.level_sign_mc.gotoAndStop(levelSignFrame);
clip.level_sign_anim_mc.level_sign_mc.Figure1Glad_mc.visible = figure1HappyVisible;
clip.level_sign_anim_mc.level_sign_mc.Figure1Neutral_mc.visible = figure1NeutralVisible;
clip.level_sign_anim_mc.level_sign_mc.Figure1Sad_mc.visible = figure1SadVisible;
clip.level_sign_anim_mc.level_sign_mc.Figure2Glad_mc.visible = figure2HappyVisible;
clip.level_sign_anim_mc.level_sign_mc.Figure2Neutral_mc.visible = figure2NeutralVisible;
clip.level_sign_anim_mc.level_sign_mc.Figure2Sad_mc.visible = figure2SadVisible;
if (figure1HappyVisible){
clip.level_sign_anim_mc.level_sign_mc.Figure1Glad_mc.gotoAndStop(levelSignFigureFrame);
} else {
if (figure1NeutralVisible){
clip.level_sign_anim_mc.level_sign_mc.Figure1Neutral_mc.gotoAndStop(levelSignFigureFrame);
} else {
if (figure1SadVisible){
clip.level_sign_anim_mc.level_sign_mc.Figure1Sad_mc.gotoAndStop(levelSignFigureFrame);
} else {
if (figure2HappyVisible){
clip.level_sign_anim_mc.level_sign_mc.Figure2Glad_mc.gotoAndStop(levelSignFigureFrame);
} else {
if (figure2NeutralVisible){
clip.level_sign_anim_mc.level_sign_mc.Figure2Neutral_mc.gotoAndStop(levelSignFigureFrame);
} else {
if (figure2SadVisible){
clip.level_sign_anim_mc.level_sign_mc.Figure2Sad_mc.gotoAndStop(levelSignFigureFrame);
};
};
};
};
};
};
if (clip.LevelByteExplosion_mc){
clip.LevelByteExplosion_mc.visible = levelExplosinVisible;
clip.LevelByteExplosion_mc.gotoAndStop(levelExplosionFrame);
};
if (clip.led_sign_mc){
if (((timesup) || (timesupOut))){
clip.led_sign_mc.gotoAndStop(ledSignFrame);
clip.led_sign_mc.visible = true;
clip.led_sign_mc.sign_mc.gotoAndStop(ledSignInnerFrame);
} else {
clip.led_sign_mc.gotoAndStop(1);
clip.led_sign_mc.visible = false;
};
if (clip.led_sign_mc.sign_mc.timesup_mc){
if (timesUp){
clip.led_sign_mc.sign_mc.timesup_mc.text_txt.text = TextProperties.TIMES_UP;
} else {
clip.led_sign_mc.sign_mc.timesup_mc.text_txt.text = TextProperties.SCRAMBLE;
};
};
};
clip.scramble_mc.gotoAndStop(scrambleButtonFrame);
clip.soundButton_mc.gotoAndStop(soundButtonFrame);
clip.exitButton_mc.gotoAndStop(turnOffButtonFrame);
if (showFreeGameEnd){
clip.level_sign_anim_mc.level_sign_mc.text_mc.score_txt.text = "";
clip.level_sign_anim_mc.level_sign_mc.text_mc.bonus_txt.text = "";
clip.level_sign_anim_mc.level_sign_mc.text_mc.total_score_txt.text = "";
clip.level_sign_anim_mc.level_sign_mc.text_mc.heading_txt.text = TextProperties.FREE_GAME_TEXT;
clip.level_sign_anim_mc.level_sign_mc.text_mc.score_text_txt.text = "";
clip.level_sign_anim_mc.level_sign_mc.text_mc.bonus_text_txt.text = "";
clip.level_sign_anim_mc.level_sign_mc.text_mc.total_score_text_txt.text = "";
clip.level_sign_anim_mc.level_sign_mc.text_mc.line_txt.text = "";
};
}
public function animInLevelSign(_arg1:int){
figure1HappyVisible = false;
figure1NeutralVisible = false;
figure1SadVisible = false;
figure2HappyVisible = false;
figure2NeutralVisible = false;
figure2SadVisible = false;
var _local2:int = int((Math.random() * 2));
switch (_arg1){
case 1:
if (_local2 == 0){
figure1NeutralVisible = true;
} else {
figure2NeutralVisible = true;
};
break;
case 2:
if (_local2 == 0){
figure1HappyVisible = true;
} else {
figure2HappyVisible = true;
};
break;
case 3:
if (_local2 == 0){
figure1SadVisible = true;
} else {
figure2SadVisible = true;
};
break;
};
levelSignState = LEVEL_SIGN_IN;
levelSignAnimFrame = 1;
levelSignFrame = 1;
levelSignFigureFrame = 1;
animateLevelSignFigure = true;
}
public function setLevelSignScore(_arg1:int, _arg2:int, _arg3:int){
levelSignScore = String(_arg1);
levelSingBonus = String(_arg2);
levelSingTotalScore = String(_arg3);
}
public function animOutLevelSign(){
levelSignState = LEVEL_SIGN_OUT;
}
public function showLevelExplosion(){
levelExplosionFrame = 0;
levelExplosinVisible = true;
}
public function showTimesup(){
timesUp = true;
ledSignFrame = 1;
ledSignInnerFrame = 1;
timesup = true;
}
public function hideTimesup(){
timesup = false;
timesupOut = true;
ledSignInnerFrame = 7;
}
public function showScramble(){
timesUp = false;
ledSignFrame = 1;
ledSignInnerFrame = 1;
timesup = true;
}
public function hideScramble(){
timesup = false;
timesupOut = true;
ledSignInnerFrame = 7;
}
public function scrambleButtonPressed(){
if (scrambleButtonFrame == 1){
animateScrambleButton = true;
};
}
public function soundButtonSoundOff(){
soundButtonOn = false;
}
public function soundButtonSoundOn(){
soundButtonOn = true;
}
public function soundButtonSwitchDept(){
clip.setChildIndex(clip.soundButton_mc, clip.getChildIndex(clip.exitButton_mc));
clip.soundButton_mc.x = 621;
clip.soundButton_mc.y = 533;
}
public function turnOffButton(){
turnOff = true;
}
public function setGameEndsIn(_arg1:Number){
var _local2:Number = Math.floor((_arg1 / 25));
if (_local2 < 0){
_local2 = 0;
};
var _local3:String = String(_local2);
var _local4:String = TextProperties.ENDS_IN;
_local4 = _local4.split("[0]").join(_local3);
gameEndsIn = _local4;
}
public function setGameEnds(){
if (TextProperties.LEVEL_SIGN_HEADING != TextProperties.GAME_ENDS){
TextProperties.LEVEL_SIGN_HEADING = TextProperties.GAME_ENDS;
};
}
public function showFreeGameText(){
showFreeGameEnd = true;
}
}
}//package com.king.twistmesilly
Section 21
//Random (com.king.twistmesilly.Random)
package com.king.twistmesilly {
import flash.utils.*;
public class Random {
private var mta:Array;
private var lastSeed:Number;
private var mti:Number;
public static var nr:int = 0;
private static var N:Number = 624;
private static var M:Number = 397;
private static var MATRIX_A:Number = 2567483615;
private static var UPPER_MASK:Number = 2147483648;
private static var LOWER_MASK:Number = 2147483647;
private static var mag01:Array = [0, 2567483615];
public function Random(_arg1:Number){
mta = new Array(N);
mti = (N + 1);
if (_arg1){
init_genrand(_arg1);
};
}
public function set seed(_arg1:Number){
init_genrand(_arg1);
}
public function get seed():Number{
return (lastSeed);
}
public function nextInt(_arg1:Number){
nr++;
return (((genrand_int32() & 2147483647) % _arg1));
}
public function nextFloat(){
return ((next(24) / (1 << 24)));
}
public function nextDouble(){
return ((next(24) / (1 << 24)));
}
public function next(_arg1:Number){
if (_arg1 < 32){
return ((genrand_int32() & ((1 << _arg1) - 1)));
};
return (genrand_int32());
}
private function init_genrand(_arg1:Number):void{
_arg1 = int(_arg1);
var _local2:* = getTimer();
lastSeed = _arg1;
mta[0] = _arg1;
var _local3:* = _arg1;
var _local4:* = new Integer64(null);
var _local5:Number = N;
mti = 1;
while (mti < _local5) {
_local4.init32(((_local3 >>> 30) ^ _local3));
_local4.mulu32(1812433253);
_local3 = (mta[mti] = int((_local4.lsb + mti)));
mti++;
};
var _local6:* = getTimer();
}
private function genrand_int32(){
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local1:Number = N;
var _local2:Number = 0;
if (mti >= _local1){
if (mti == (_local1 + 1)){
init_genrand(5489);
};
_local3 = M;
_local4 = UPPER_MASK;
_local5 = LOWER_MASK;
_local6 = mag01;
_local7 = getTimer();
_local8 = 0;
_local9 = (_local1 - _local3);
_local10 = (_local3 - _local1);
_local8 = 0;
while (_local8 < _local9) {
_local2 = ((mta[_local8] & _local4) | (mta[(_local8 + 1)] & _local5));
mta[_local8] = ((mta[(_local8 + _local3)] ^ (_local2 >>> 1)) ^ _local6[(_local2 & 1)]);
_local8++;
};
_local9 = (_local1 - 1);
while (_local8 < _local9) {
_local2 = ((mta[_local8] & _local4) | (mta[(_local8 + 1)] & _local5));
mta[_local8] = ((mta[(_local8 + _local10)] ^ (_local2 >>> 1)) ^ _local6[(_local2 & 1)]);
_local8++;
};
_local2 = ((mta[(_local1 - 1)] & _local4) | (mta[0] & _local5));
mta[(_local1 - 1)] = ((mta[(_local3 - 1)] ^ (_local2 >>> 1)) ^ _local6[(_local2 & 1)]);
mti = 0;
_local11 = getTimer();
};
_local2 = mta[mti++];
_local2 = (_local2 ^ (_local2 >>> 11));
_local2 = (_local2 ^ ((_local2 << 7) & 2636928640));
_local2 = (_local2 ^ ((_local2 << 15) & 4022730752));
_local2 = (_local2 ^ (_local2 >>> 18));
return (_local2);
}
}
}//package com.king.twistmesilly
Section 22
//SoundManager (com.king.twistmesilly.SoundManager)
package com.king.twistmesilly {
import flash.media.*;
class SoundManager {
private static var gameLoop:Sound = new twist_loop();
private static var gameLoopChannel:SoundChannel = null;
private static var gameLoopPlaying:Boolean = false;
private static var introLoop:Sound = new twist_intro();
private static var introLoopChannel:SoundChannel = null;
private static var introLoopPlaying:Boolean = false;
private static var endLoop:Sound = new twist_end();
private static var endLoopChannel:SoundChannel = null;
private static var endLoopPlaying:Boolean = false;
private static var INNER:Sound = new time_out3();
private static var timeOutChannel:SoundChannel = null;
private static var timeOutPlaying:Boolean = false;
private static var rotate:Sound = new rrotate_sound2();
private static var match1:Sound = new twist_combo1();
private static var match2:Sound = new twist_combo2();
private static var match3:Sound = new twist_combo3();
private static var match4:Sound = new twist_combo4();
private static var match5:Sound = new twist_combo5();
private static var match6:Sound = new twist_combo6();
private static var bomb:Sound = new bomb_sound6();
private static var colorBomb:Sound = new powerup2();
private static var lineBlast:Sound = new line_blast2();
private static var levelStart:Sound = new twist_level_start();
private static var levelEnd:Sound = new twist_level_end();
private static var noMoreMoves:Sound = new no_more_moves4();
private static var lightning:Sound = new lightning2();
private static var timeSign:Sound = new negative_4way3();
public static var isSoundOn:Boolean = true;
public static function soundOff(){
stopGameLoop();
stopIntroLoop();
stopEndLoop();
isSoundOn = false;
stopTimeOutLoop();
}
public static function soundOn(){
isSoundOn = true;
}
public static function playGameLoop(){
if (((isSoundOn) && (!(gameLoopPlaying)))){
gameLoopChannel = gameLoop.play(0, 9999, new SoundTransform(0.7));
gameLoopPlaying = true;
};
}
public static function stopGameLoop(){
if (gameLoopChannel != null){
gameLoopChannel.stop();
gameLoopChannel = null;
gameLoopPlaying = false;
};
}
public static function setGameLoopNormalVolume(){
if (gameLoopPlaying){
gameLoopChannel.soundTransform = new SoundTransform(1);
};
}
public static function setGameLoopLowVolume(){
if (gameLoopPlaying){
gameLoopChannel.soundTransform = new SoundTransform(0.4);
};
}
public static function playIntroLoop(){
if (((isSoundOn) && (!(introLoopPlaying)))){
introLoopChannel = introLoop.play(0, 9999, new SoundTransform(1));
introLoopPlaying = true;
};
}
public static function stopIntroLoop(){
if (introLoopChannel != null){
introLoopChannel.stop();
introLoopChannel = null;
introLoopPlaying = false;
};
}
public static function playEndLoop(){
if (((isSoundOn) && (!(endLoopPlaying)))){
endLoopChannel = endLoop.play(0, 9999, new SoundTransform(1));
endLoopPlaying = true;
};
}
public static function stopEndLoop(){
if (endLoopChannel != null){
endLoopChannel.stop();
endLoopChannel = null;
endLoopPlaying = false;
};
}
public static function playTimeOutLoop(){
if (((isSoundOn) && (!(timeOutPlaying)))){
timeOutChannel = INNER.play(0, 9999, new SoundTransform(1));
timeOutPlaying = true;
};
}
public static function stopTimeOutLoop(){
if (timeOutChannel != null){
timeOutChannel.stop();
timeOutChannel = null;
timeOutPlaying = false;
};
}
public static function playRotate(){
if (isSoundOn){
rotate.play(0, 1, new SoundTransform(0.4));
};
}
public static function playMatch1(){
if (isSoundOn){
match1.play();
};
}
public static function playMatch2(){
if (isSoundOn){
match2.play();
};
}
public static function playMatch3(){
if (isSoundOn){
match3.play();
};
}
public static function playMatch4(){
if (isSoundOn){
match4.play();
};
}
public static function playMatch5(){
if (isSoundOn){
match5.play();
};
}
public static function playMatch6(){
if (isSoundOn){
match6.play();
};
}
public static function playBomb(){
if (isSoundOn){
bomb.play();
};
}
public static function playColorBomb(){
if (isSoundOn){
colorBomb.play();
};
}
public static function playLineBlast(){
if (isSoundOn){
lineBlast.play();
};
}
public static function playLevelStart(){
if (isSoundOn){
levelStart.play();
};
}
public static function playLevelEnd(){
if (isSoundOn){
levelEnd.play();
};
}
public static function playNoMoreMoves(){
if (isSoundOn){
noMoreMoves.play();
};
}
public static function playLightning(){
if (isSoundOn){
lightning.play(0, 1, new SoundTransform(0.2));
};
}
public static function playTimeSign(){
if (isSoundOn){
timeSign.play();
};
}
}
}//package com.king.twistmesilly
Section 23
//TextProperties (com.king.twistmesilly.TextProperties)
package com.king.twistmesilly {
class TextProperties {
public static var INSTRUCTION_TEXT1:String = "instruction_text_1";
public static var INTRO_HEADING1:String = "INTRO_HEADING1";
public static var INTRO_TEXT1:String = "INTRO_TEXT1";
public static var INTRO_TEXT2:String = "INTRO_TEXT2";
public static var INTRO_HEADING2:String = "INTRO_HEADING2";
public static var INTRO_TEXT3:String = "INTRO_TEXT3";
public static var INTRO_TEXT4:String = "INTRO_TEXT4";
public static var INTRO_TEXT5:String = "INTRO_TEXT5";
public static var INTRO_GAME_STARTS_IN:String = "GAME_STARTS_IN";
public static var INTRO_CLICK_TO_START:String = "INTRO_CLICK_TO_START";
public static var INTRO_LIKE_THIS:String = "INTRO_LIKE_THIS";
public static var LEVEL_SIGN_HEADING:String = "LEVEL_SIGN_HEADING";
public static var LEVEL_SIGN_SCORE_TEXT:String = "LEVEL_SIGN_SCORE_TEXT";
public static var LEVEL_SIGN_BONUS_TEXT:String = "LEVEL_SIGN_BONUS_TEXT";
public static var LEVEL_SIGN_TOTAL_SCORE_TEXT:String = "LEVEL_SIGN_TOTAL_SCORE_TEXT";
public static var LEVEL_SIGN_CLICK_TEXT:String = "LEVEL_SIGN_CLICK_TEXT";
public static var TIMES_UP:String = "TIMES_UP";
public static var SCRAMBLE:String = "SCRAMBLE";
public static var ENDS_IN:String = "ENDS_IN";
public static var GAME_ENDS:String = "GAME_ENDS";
public static var SCRAMBLE_BUTTON_TEXT:String = "SCRAMBLE";
public static var GUI_SCORE_TEXT:String = "SCORE";
public static var GUI_LEVEL_TEXT:String = "LEVEL";
public static var FREE_GAME_TEXT:String = "FREE_GAME_TEXT";
public static var THE_END:String = "THE_END";
}
}//package com.king.twistmesilly
Section 24
//Timer (com.king.twistmesilly.Timer)
package com.king.twistmesilly {
import flash.utils.*;
public class Timer {
private var lastTime:Number;// = -1
private var ticksPerSecond:Number;
private var msPerTick:Number;
private var unprocessedTime:Number;// = 0
public var alpha:Number;// = 0
public var timeScale:Number;// = 1
public var passedTime:Number;// = 0
public static var currentTime:Number = 0;
public function Timer(_arg1){
this.ticksPerSecond = _arg1;
msPerTick = (1000 / _arg1);
}
public function advanceTime(){
if (lastTime == -1){
lastTime = getTimer();
};
var _local1:* = getTimer();
passedTime = (_local1 - lastTime);
passedTime = (passedTime * timeScale);
currentTime = (currentTime + passedTime);
lastTime = _local1;
unprocessedTime = (unprocessedTime + passedTime);
var _local2:int = int((unprocessedTime / msPerTick));
unprocessedTime = (unprocessedTime - (_local2 * msPerTick));
alpha = (unprocessedTime / msPerTick);
return (_local2);
}
}
}//package com.king.twistmesilly
Section 25
//TwistMeSilly (com.king.twistmesilly.TwistMeSilly)
package com.king.twistmesilly {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.ui.*;
import flash.xml.*;
import flash.external.*;
import flash.net.*;
public class TwistMeSilly extends MovieClip {
public var debugTickTime_txt:TextField;
public var soundButton_mc:MovieClip;
public var time2_mc:MovieClip;
public var time3_mc:MovieClip;
public var tick_txt:TextField;
public var debugRenderFPS_txt:TextField;
public var intro_mc:MovieClip;
public var level_sign_anim_mc:MovieClip;
public var time1_mc:MovieClip;
public var level_mc:MovieClip;
public var scramble_mc:MovieClip;
public var exitButton_mc:MovieClip;
public var progress_mc:MovieClip;
public var game_holder_mc:MovieClip;
public var GameLogo_mc:MovieClip;
public var blingStarsHolder_mc:MovieClip;
public var led_sign_mc:MovieClip;
public var seed_txt:TextField;
public var LevelByteExplosion_mc:MovieClip;
public var bg_mc:MovieClip;
public var scramble_button_txt:TextField;
public var score_mc:MovieClip;
private var state:int;
private var gameHandler:GameHandler;
private var input:Input;
private var introPlayer:IntroPlayer;
public var timer:Timer;
private var tickCounter:int;
private var renderFPS:Number;// = 0
private var renderStartTime:Number;
private var tickTime:int;// = 0
private var soundOn:Boolean;
private var lastIntroRender:Boolean;// = true
private var garbageCounter:int;// = 0
public static var DEBUG_MODE:Boolean = false;
public static var MONEY_GAME:Boolean = true;
public static var TICKS_PER_SECOND:Number = 25;
public static var TITLE_SHOWING_TICKS:int = 1;
public static var INSTRUCTIONS_SHOWING_TICKS:int = 500;
public static var STATE_TITLE:int = 0;
public static var STATE_INSTRUCTIONS:int = 1;
public static var STATE_GAME:int = 2;
public static var STATE_END:int = 3;
private static var GAME_DATA:String = (((((((((((((((((((((((((("<gamedata randomseed=\"5\" timelimit=\"660\" lang=\"de\" relaxMode=\"false\">" + "<text id=\"intro_heading1\">aSpela så här:</text>") + "<text id=\"intro_text1\">aRotera brickor så minst tre dioder av samma färg kopplas samman.</text>") + "<text id=\"intro_text2\">aRegnsbågsbrickor kan kopplas samman med alla andra färger.</text>") + "<text id=\"intro_heading2\">aSpecialobjekt:</text>") + "<text id=\"intro_text3\">aDyker upp när man gjort två kedjor. Spränger i sidled.</text>") + "<text id=\"intro_text4\">aDyker upp när man gjort en kedja. Spränger runt sig.</text>") + "<text id=\"intro_text5\">aDyker upp när man gjort tre kedjor. Spränger alla brickor i samma färg.</text>") + "<text id=\"intro_starts_in\">aGame starts in [0] seconds</text>") + "<text id=\"intro_click_to_start\">aclick to start</text>") + "<text id=\"intro_like_this\">aSÅ HÄR!</text>") + "<text id=\"level_sign_heading\">aLEVEL COMPLETED</text>") + "<text id=\"level_sign_score\">aSCORE</text>") + "<text id=\"level_sign_bonus\">aBONUS</text>") + "<text id=\"level_sign_totalscore\">aTOTAL SCORE</text>") + "<text id=\"level_sign_click_to_continue\">aCLICK TO CONTINUE</text>") + "<text id=\"led_sign_times_up\">TEMPS\nECOULE !</text>") + "<text id=\"led_sign_scramble\">aSCRAMBLE</text>") + "<text id=\"ends_in\">aGAME ENDS IN [0] SECONDS</text>") + "<text id=\"game_ends\">aGAME ENDS</text>") + "<text id=\"scramble_button_text\">aS C R A M B L E</text>") + "<text id=\"gui_score_text\">aS C O R E</text>") + "<text id=\"gui_level_text\">aLEVEL</text>") + "<text id=\"the_end\">THE END</text>") + "<text id=\"free_game_text\">aSignup to play\nthe full game</text>") + "<userType id=\"0\">2</userType>") + "</gamedata>");
public function TwistMeSilly(){
Global.defaultDisplayObject = this;
Global.CreateClips();
stage.quality = StageQuality.HIGH;
introPlayer = new IntroPlayer(Global.defaultDisplayObject);
Communicator.setMoneyGame(MONEY_GAME);
if (!DEBUG_MODE){
getGameData();
};
Communicator.parseGameData(GAME_DATA);
if (Communicator.isRelaxGame()){
MONEY_GAME = false;
Communicator.setMoneyGame(MONEY_GAME);
};
var _local1:int = Communicator.randomSeed;
input = new Input();
input.init();
gameHandler = new GameHandler(_local1, input, messageReciver);
soundOn = true;
timer = new Timer(TICKS_PER_SECOND);
addEventListener("enterFrame", advanceTime);
this.addEventListener(MouseEvent.MOUSE_DOWN, mousePressed);
this.addEventListener(MouseEvent.MOUSE_UP, mouseReleased);
tickCounter = 0;
state = STATE_TITLE;
SoundManager.playIntroLoop();
}
private function tick():void{
input.setMousePos(this.mouseX, this.mouseY);
offButton();
soundButton();
switch (state){
case STATE_TITLE:
if ((((tickCounter >= TITLE_SHOWING_TICKS)) || (input.mouseIsReleased))){
tickCounter = 0;
state = STATE_INSTRUCTIONS;
gameHandler.initGame();
};
introPlayer.tick();
break;
case STATE_INSTRUCTIONS:
introPlayer.setGameStartsIn(((INSTRUCTIONS_SHOWING_TICKS + 25) - tickCounter));
introPlayer.tick();
if ((((tickCounter >= INSTRUCTIONS_SHOWING_TICKS)) || (((input.mouseIsReleased) && (noSoundButtonClick()))))){
if (gameHandler.gameIsPaused()){
gameHandler.startGame();
state = STATE_GAME;
gameHandler.moviePlayer.soundButtonSwitchDept();
introPlayer.hideIntro();
};
};
break;
case STATE_GAME:
break;
};
gameHandler.tick();
input.reset();
tickCounter++;
}
private function render(_arg1:Number):void{
gameHandler.render(_arg1);
if ((((state == STATE_TITLE)) || ((state == STATE_INSTRUCTIONS)))){
introPlayer.render(_arg1);
} else {
if (lastIntroRender){
introPlayer.render(_arg1);
lastIntroRender = false;
};
};
}
public function messageReciver(_arg1:String, _arg2:InfoData){
}
private function getGameData(){
var _local1:Object = ExternalInterface.call("getGameData");
if ((((_local1 == null)) || (!(_local1.success)))){
} else {
GAME_DATA = _local1.message;
};
}
private function advanceTime(_arg1:Event):void{
var e = _arg1;
var ticks:* = timer.advanceTime();
var i:* = 0;
while (i < ticks) {
tick();
i = (i + 1);
};
render(timer.alpha);
garbageCounter++;
if ((((garbageCounter > 75)) && ((state == STATE_GAME)))){
garbageCounter = 0;
try {
new LocalConnection().connect("foo");
new LocalConnection().connect("foo");
} catch(e) {
};
};
}
public function mousePressed(_arg1:MouseEvent){
input.mousePressed();
}
public function mouseReleased(_arg1:MouseEvent){
input.mouseReleased();
}
private function soundButton(){
if ((((state == STATE_TITLE)) || ((state == STATE_INSTRUCTIONS)))){
if ((((((((((((input.xMouse >= 715)) && ((input.xMouse <= 737)))) && ((input.yMouse >= 533)))) && ((input.yMouse <= 553)))) && (input.mouseIsPressed))) && (soundOn))){
soundOn = false;
gameHandler.soundOff();
gameHandler.moviePlayer.soundButtonSoundOff();
} else {
if ((((((((((((input.xMouse >= 699)) && ((input.xMouse <= 719)))) && ((input.yMouse >= 557)))) && ((input.yMouse <= 577)))) && (input.mouseIsPressed))) && (!(soundOn)))){
soundOn = true;
SoundManager.soundOn();
SoundManager.playIntroLoop();
gameHandler.moviePlayer.soundButtonSoundOn();
};
};
} else {
if ((((((((((((input.xMouse >= 654)) && ((input.xMouse <= 674)))) && ((input.yMouse >= 533)))) && ((input.yMouse <= 553)))) && (input.mouseIsPressed))) && (soundOn))){
soundOn = false;
gameHandler.soundOff();
gameHandler.moviePlayer.soundButtonSoundOff();
} else {
if ((((((((((((input.xMouse >= 638)) && ((input.xMouse <= 658)))) && ((input.yMouse >= 557)))) && ((input.yMouse <= 577)))) && (input.mouseIsPressed))) && (!(soundOn)))){
soundOn = true;
gameHandler.soundOn();
gameHandler.moviePlayer.soundButtonSoundOn();
};
};
};
}
private function offButton(){
if (state == STATE_GAME){
if ((((((((((input.xMouse >= 691)) && ((input.xMouse <= 711)))) && ((input.yMouse >= 539)))) && ((input.yMouse <= 559)))) && (input.mouseIsPressed))){
gameHandler.moviePlayer.turnOffButton();
gameHandler.tryToExitGame();
};
};
}
private function noSoundButtonClick():Boolean{
if ((((state == STATE_TITLE)) || ((state == STATE_INSTRUCTIONS)))){
if ((((((((((input.xMouse >= 715)) && ((input.xMouse <= 737)))) && ((input.yMouse >= 533)))) && ((input.yMouse <= 553)))) || ((((((((input.xMouse >= 699)) && ((input.xMouse <= 719)))) && ((input.yMouse >= 557)))) && ((input.yMouse <= 577)))))){
return (false);
};
return (true);
//unresolved jump
};
if ((((((((((input.xMouse >= 654)) && ((input.xMouse <= 674)))) && ((input.yMouse >= 533)))) && ((input.yMouse <= 553)))) || ((((((((input.xMouse >= 638)) && ((input.xMouse <= 658)))) && ((input.yMouse >= 557)))) && ((input.yMouse <= 577)))))){
return (false);
};
return (true);
}
}
}//package com.king.twistmesilly
Section 26
//alla_powerups_50 (twistmesilly_fla.alla_powerups_50)
package twistmesilly_fla {
import flash.display.*;
public dynamic class alla_powerups_50 extends MovieClip {
public var colourbomb_cerise_mc:MovieClip;
public var colourbomb_red_mc:MovieClip;
public var colourbomb_blue_mc:MovieClip;
public var colourbomb_green_mc:MovieClip;
public var sparkle_mc:MovieClip;
public function alla_powerups_50(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package twistmesilly_fla
Section 27
//bling_7 (twistmesilly_fla.bling_7)
package twistmesilly_fla {
import flash.display.*;
public dynamic class bling_7 extends MovieClip {
public function bling_7(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package twistmesilly_fla
Section 28
//bling_87 (twistmesilly_fla.bling_87)
package twistmesilly_fla {
import flash.display.*;
public dynamic class bling_87 extends MovieClip {
public function bling_87(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package twistmesilly_fla
Section 29
//blue_colourbomb_52 (twistmesilly_fla.blue_colourbomb_52)
package twistmesilly_fla {
import flash.display.*;
public dynamic class blue_colourbomb_52 extends MovieClip {
public function blue_colourbomb_52(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package twistmesilly_fla
Section 30
//brick_4_49 (twistmesilly_fla.brick_4_49)
package twistmesilly_fla {
import flash.display.*;
public dynamic class brick_4_49 extends MovieClip {
public function brick_4_49(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package twistmesilly_fla
Section 31
//cerise_colourbomb_53 (twistmesilly_fla.cerise_colourbomb_53)
package twistmesilly_fla {
import flash.display.*;
public dynamic class cerise_colourbomb_53 extends MovieClip {
public function cerise_colourbomb_53(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package twistmesilly_fla
Section 32
//green_colourbomb_55 (twistmesilly_fla.green_colourbomb_55)
package twistmesilly_fla {
import flash.display.*;
public dynamic class green_colourbomb_55 extends MovieClip {
public function green_colourbomb_55(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package twistmesilly_fla
Section 33
//hint_1_63 (twistmesilly_fla.hint_1_63)
package twistmesilly_fla {
import flash.display.*;
public dynamic class hint_1_63 extends MovieClip {
public function hint_1_63(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package twistmesilly_fla
Section 34
//intro_42 (twistmesilly_fla.intro_42)
package twistmesilly_fla {
import flash.display.*;
import flash.text.*;
public dynamic class intro_42 extends MovieClip {
public var text4_txt:TextField;
public var IntroLogo_mc:MovieClip;
public var text1_txt:TextField;
public var text3_txt:TextField;
public var text2_txt:TextField;
public var click_to_start_txt:TextField;
public var heading2_txt:TextField;
public var game_starts_in_txt:TextField;
public var heading1_txt:TextField;
public var like_this_mc:MovieClip;
public var text5_txt:TextField;
public function intro_42(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package twistmesilly_fla
Section 35
//LED_figur_sekvens_16 (twistmesilly_fla.LED_figur_sekvens_16)
package twistmesilly_fla {
import flash.display.*;
public dynamic class LED_figur_sekvens_16 extends MovieClip {
public var timeLed_mc:MovieClip;
public function LED_figur_sekvens_16(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package twistmesilly_fla
Section 36
//LED_sign_18 (twistmesilly_fla.LED_sign_18)
package twistmesilly_fla {
import flash.display.*;
public dynamic class LED_sign_18 extends MovieClip {
public var sign_mc:MovieClip;
public function LED_sign_18(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package twistmesilly_fla
Section 37
//led_time_up_19 (twistmesilly_fla.led_time_up_19)
package twistmesilly_fla {
import flash.display.*;
public dynamic class led_time_up_19 extends MovieClip {
public var timesup_mc:MovieClip;
public function led_time_up_19(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package twistmesilly_fla
Section 38
//ledstar_40 (twistmesilly_fla.ledstar_40)
package twistmesilly_fla {
import flash.display.*;
public dynamic class ledstar_40 extends MovieClip {
public function ledstar_40(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package twistmesilly_fla
Section 39
//levelbyte_24 (twistmesilly_fla.levelbyte_24)
package twistmesilly_fla {
import flash.display.*;
public dynamic class levelbyte_24 extends MovieClip {
public function levelbyte_24(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package twistmesilly_fla
Section 40
//levelprogress_13 (twistmesilly_fla.levelprogress_13)
package twistmesilly_fla {
import flash.display.*;
public dynamic class levelprogress_13 extends MovieClip {
public function levelprogress_13(){
addFrameScript(79, frame80);
}
function frame80(){
gotoAndPlay(60);
}
}
}//package twistmesilly_fla
Section 41
//power_on_off_4 (twistmesilly_fla.power_on_off_4)
package twistmesilly_fla {
import flash.display.*;
public dynamic class power_on_off_4 extends MovieClip {
public function power_on_off_4(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package twistmesilly_fla
Section 42
//red_colourbomb_54 (twistmesilly_fla.red_colourbomb_54)
package twistmesilly_fla {
import flash.display.*;
public dynamic class red_colourbomb_54 extends MovieClip {
public function red_colourbomb_54(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package twistmesilly_fla
Section 43
//scramble_11 (twistmesilly_fla.scramble_11)
package twistmesilly_fla {
import flash.display.*;
public dynamic class scramble_11 extends MovieClip {
public function scramble_11(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package twistmesilly_fla
Section 44
//selected_mouseover_64 (twistmesilly_fla.selected_mouseover_64)
package twistmesilly_fla {
import flash.display.*;
public dynamic class selected_mouseover_64 extends MovieClip {
public function selected_mouseover_64(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package twistmesilly_fla
Section 45
//skylt_26 (twistmesilly_fla.skylt_26)
package twistmesilly_fla {
import flash.display.*;
public dynamic class skylt_26 extends MovieClip {
public var Figure2Glad_mc:MovieClip;
public var Figure1Glad_mc:MovieClip;
public var star2_mc:MovieClip;
public var Figure1Sad_mc:MovieClip;
public var star1_mc:MovieClip;
public var text_mc:MovieClip;
public var Figure2Sad_mc:MovieClip;
public var Figure1Neutral_mc:MovieClip;
public var Figure2Neutral_mc:MovieClip;
public function skylt_26(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package twistmesilly_fla
Section 46
//skyltenanimation_25 (twistmesilly_fla.skyltenanimation_25)
package twistmesilly_fla {
import flash.display.*;
public dynamic class skyltenanimation_25 extends MovieClip {
public var level_sign_mc:MovieClip;
public function skyltenanimation_25(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package twistmesilly_fla
Section 47
//skyltfigur1_31 (twistmesilly_fla.skyltfigur1_31)
package twistmesilly_fla {
import flash.display.*;
public dynamic class skyltfigur1_31 extends MovieClip {
public function skyltfigur1_31(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package twistmesilly_fla
Section 48
//skyltfigur1_glad_33 (twistmesilly_fla.skyltfigur1_glad_33)
package twistmesilly_fla {
import flash.display.*;
public dynamic class skyltfigur1_glad_33 extends MovieClip {
public function skyltfigur1_glad_33(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package twistmesilly_fla
Section 49
//skyltfigur1_ledsen_32 (twistmesilly_fla.skyltfigur1_ledsen_32)
package twistmesilly_fla {
import flash.display.*;
public dynamic class skyltfigur1_ledsen_32 extends MovieClip {
public function skyltfigur1_ledsen_32(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package twistmesilly_fla
Section 50
//skyltfigur2_glad_36 (twistmesilly_fla.skyltfigur2_glad_36)
package twistmesilly_fla {
import flash.display.*;
public dynamic class skyltfigur2_glad_36 extends MovieClip {
public function skyltfigur2_glad_36(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package twistmesilly_fla
Section 51
//skyltfigur2_ledsen_34 (twistmesilly_fla.skyltfigur2_ledsen_34)
package twistmesilly_fla {
import flash.display.*;
public dynamic class skyltfigur2_ledsen_34 extends MovieClip {
public function skyltfigur2_ledsen_34(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package twistmesilly_fla
Section 52
//skyltfigur2_neutral_35 (twistmesilly_fla.skyltfigur2_neutral_35)
package twistmesilly_fla {
import flash.display.*;
public dynamic class skyltfigur2_neutral_35 extends MovieClip {
public function skyltfigur2_neutral_35(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package twistmesilly_fla
Section 53
//soundtoggle_46 (twistmesilly_fla.soundtoggle_46)
package twistmesilly_fla {
import flash.display.*;
public dynamic class soundtoggle_46 extends MovieClip {
public function soundtoggle_46(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package twistmesilly_fla
Section 54
//text_sign_27 (twistmesilly_fla.text_sign_27)
package twistmesilly_fla {
import flash.display.*;
import flash.text.*;
public dynamic class text_sign_27 extends MovieClip {
public var click_text_txt:TextField;
public var score_txt:TextField;
public var score_text_txt:TextField;
public var bonus_txt:TextField;
public var bonus_text_txt:TextField;
public var heading_txt:TextField;
public var line_txt:TextField;
public var total_score_text_txt:TextField;
public var total_score_txt:TextField;
public function text_sign_27(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package twistmesilly_fla
Section 55
//bling (bling)
package {
import flash.display.*;
public dynamic class bling extends MovieClip {
public function bling(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 56
//bling2 (bling2)
package {
import flash.display.*;
public dynamic class bling2 extends MovieClip {
public var bling_mc:MovieClip;
}
}//package
Section 57
//blixt (blixt)
package {
import flash.display.*;
public dynamic class blixt extends MovieClip {
public function blixt(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 58
//blue3 (blue3)
package {
import flash.display.*;
public dynamic class blue3 extends MovieClip {
}
}//package
Section 59
//blue5 (blue5)
package {
import flash.display.*;
public dynamic class blue5 extends MovieClip {
}
}//package
Section 60
//bomb_sound6 (bomb_sound6)
package {
import flash.media.*;
public dynamic class bomb_sound6 extends Sound {
}
}//package
Section 61
//bomb_sound7 (bomb_sound7)
package {
import flash.media.*;
public dynamic class bomb_sound7 extends Sound {
}
}//package
Section 62
//BrickC (BrickC)
package {
import flash.display.*;
public dynamic class BrickC extends MovieClip {
public var card2_mc:MovieClip;
public var hint_mc:MovieClip;
public var card1_mc:MovieClip;
public var special_mc:MovieClip;
public var sidewayblast_mc:MovieClip;
public var mouse_over_mc:MovieClip;
public var lights_mc:MovieClip;
}
}//package
Section 63
//cerise3 (cerise3)
package {
import flash.display.*;
public dynamic class cerise3 extends MovieClip {
}
}//package
Section 64
//cerise5 (cerise5)
package {
import flash.display.*;
public dynamic class cerise5 extends MovieClip {
}
}//package
Section 65
//combo1 (combo1)
package {
import flash.media.*;
public dynamic class combo1 extends Sound {
}
}//package
Section 66
//explosion_bitmap (explosion_bitmap)
package {
import flash.display.*;
public dynamic class explosion_bitmap extends MovieClip {
}
}//package
Section 67
//green3 (green3)
package {
import flash.display.*;
public dynamic class green3 extends MovieClip {
}
}//package
Section 68
//green5 (green5)
package {
import flash.display.*;
public dynamic class green5 extends MovieClip {
}
}//package
Section 69
//lightning2 (lightning2)
package {
import flash.media.*;
public dynamic class lightning2 extends Sound {
}
}//package
Section 70
//line_blast2 (line_blast2)
package {
import flash.media.*;
public dynamic class line_blast2 extends Sound {
}
}//package
Section 71
//negative_4way3 (negative_4way3)
package {
import flash.media.*;
public dynamic class negative_4way3 extends Sound {
}
}//package
Section 72
//no_more_moves4 (no_more_moves4)
package {
import flash.media.*;
public dynamic class no_more_moves4 extends Sound {
}
}//package
Section 73
//normal_explosion (normal_explosion)
package {
import flash.display.*;
public dynamic class normal_explosion extends MovieClip {
}
}//package
Section 74
//powerup2 (powerup2)
package {
import flash.media.*;
public dynamic class powerup2 extends Sound {
}
}//package
Section 75
//rainbow3 (rainbow3)
package {
import flash.display.*;
public dynamic class rainbow3 extends MovieClip {
}
}//package
Section 76
//rainbow5 (rainbow5)
package {
import flash.display.*;
public dynamic class rainbow5 extends MovieClip {
}
}//package
Section 77
//red3 (red3)
package {
import flash.display.*;
public dynamic class red3 extends MovieClip {
}
}//package
Section 78
//red5 (red5)
package {
import flash.display.*;
public dynamic class red5 extends MovieClip {
}
}//package
Section 79
//rrotate_sound2 (rrotate_sound2)
package {
import flash.media.*;
public dynamic class rrotate_sound2 extends Sound {
}
}//package
Section 80
//score_animation (score_animation)
package {
import flash.display.*;
public dynamic class score_animation extends MovieClip {
public var score_mc:MovieClip;
}
}//package
Section 81
//sideway_explosion (sideway_explosion)
package {
import flash.display.*;
public dynamic class sideway_explosion extends MovieClip {
}
}//package
Section 82
//sideway_explosion_bitmap (sideway_explosion_bitmap)
package {
import flash.display.*;
public dynamic class sideway_explosion_bitmap extends MovieClip {
}
}//package
Section 83
//time_out3 (time_out3)
package {
import flash.media.*;
public dynamic class time_out3 extends Sound {
}
}//package
Section 84
//twist_combo1 (twist_combo1)
package {
import flash.media.*;
public dynamic class twist_combo1 extends Sound {
}
}//package
Section 85
//twist_combo2 (twist_combo2)
package {
import flash.media.*;
public dynamic class twist_combo2 extends Sound {
}
}//package
Section 86
//twist_combo3 (twist_combo3)
package {
import flash.media.*;
public dynamic class twist_combo3 extends Sound {
}
}//package
Section 87
//twist_combo4 (twist_combo4)
package {
import flash.media.*;
public dynamic class twist_combo4 extends Sound {
}
}//package
Section 88
//twist_combo5 (twist_combo5)
package {
import flash.media.*;
public dynamic class twist_combo5 extends Sound {
}
}//package
Section 89
//twist_combo6 (twist_combo6)
package {
import flash.media.*;
public dynamic class twist_combo6 extends Sound {
}
}//package
Section 90
//twist_end (twist_end)
package {
import flash.media.*;
public dynamic class twist_end extends Sound {
}
}//package
Section 91
//twist_intro (twist_intro)
package {
import flash.media.*;
public dynamic class twist_intro extends Sound {
}
}//package
Section 92
//twist_level_end (twist_level_end)
package {
import flash.media.*;
public dynamic class twist_level_end extends Sound {
}
}//package
Section 93
//twist_level_start (twist_level_start)
package {
import flash.media.*;
public dynamic class twist_level_start extends Sound {
}
}//package
Section 94
//twist_loop (twist_loop)
package {
import flash.media.*;
public dynamic class twist_loop extends Sound {
}
}//package