Symbol 108 MovieClip [Star] Frame 1
#initclip 36
Object.registerClass("Star", com.king.FourSeasons.Star);
#endinitclip
Symbol 1016 MovieClip [Pieces] Frame 1
#initclip 26
Object.registerClass("Pieces", com.king.FourSeasons.Pieces);
#endinitclip
Symbol 1023 MovieClip [JumpLetter] Frame 1
#initclip 27
Object.registerClass("JumpLetter", com.king.FourSeasons.JumpLetter);
#endinitclip
Symbol 1027 MovieClip [Score] Frame 1
#initclip 28
Object.registerClass("Score", com.king.FourSeasons.Score);
#endinitclip
Symbol 1133 MovieClip [BonusAnim] Frame 1
#initclip 29
Object.registerClass("BonusAnim", com.king.FourSeasons.BonusAnim);
#endinitclip
Symbol 1166 MovieClip [Particle] Frame 1
#initclip 30
Object.registerClass("Particle", com.king.FourSeasons.Particle);
#endinitclip
Symbol 1170 MovieClip Frame 1
stop();
Symbol 1177 MovieClip [GameTimer] Frame 1
#initclip 31
Object.registerClass("GameTimer", com.king.FourSeasons.GameTimer);
#endinitclip
stop();
Symbol 1181 MovieClip [IntroExpl] Frame 1
#initclip 32
Object.registerClass("IntroExpl", com.king.FourSeasons.IntroExpl);
#endinitclip
Symbol 1188 MovieClip [Marker] Frame 1
#initclip 33
Object.registerClass("Marker", com.king.FourSeasons.Marker);
#endinitclip
Symbol 1198 MovieClip Frame 1
stop();
Symbol 1267 MovieClip Frame 1
stop();
Symbol 1268 MovieClip [Game] Frame 1
#initclip 34
Object.registerClass("Game", com.king.FourSeasons.Game);
#endinitclip
Symbol 1294 MovieClip Frame 1
stop();
Symbol 1304 MovieClip Frame 1
stop();
Symbol 1304 MovieClip Frame 5
stop();
Symbol 1308 MovieClip [FourSeasons] Frame 1
#initclip 35
Object.registerClass("FourSeasons", com.king.FourSeasons.FourSeasons);
#endinitclip
Symbol 1309 MovieClip [__Packages.com.king.FourSeasons.Pieces] Frame 0
class com.king.FourSeasons.Pieces extends MovieClip
{
var delay, yFloat, xFloat, expFloat, pWidth, pHeight, currentTick, runDelay, delayTime, runGotoY, yInc, yPos, accYCounter, speed, runGotoX, _parent, xInc, xPos, accXCounter, spinAnimCounter, a, b, aa, bb, expGoto, bonus, hitTest, y, x, _ymouse, _xmouse, explode, expPos, _y, _x, mcP, level, starBonus, type, gotoAndStop, mcBonus, mcStar, id, cfe, removeMovieClip;
function Pieces () {
super();
delay = new com.king.util.Delay();
yFloat = new com.king.timing.IFloat();
xFloat = new com.king.timing.IFloat();
expFloat = new com.king.timing.IFloat();
pWidth = (pHeight = 70);
}
function tick(tick, tps) {
currentTick = tick;
if (runDelay) {
delayTime--;
if (delayTime == 0) {
runDelay = false;
}
}
if (runGotoY && (delayTime == 0)) {
if (yInc) {
yPos = yPos + (speed + accYCounter);
} else {
yPos = yPos - (speed + accYCounter);
}
accYCounter = accYCounter + 2;
if (((yPos > gotoY) && (yInc)) || ((yPos < gotoY) && (!yInc))) {
yPos = gotoY;
accYCounter = 0;
runGotoY = false;
yFloat.set(yPos);
if (runGotoX == false) {
_parent.runCheck = true;
_parent.noOfMoving--;
}
}
yFloat.set(yPos);
}
if (runGotoX && (delayTime == 0)) {
if (xInc) {
xPos = xPos + (speed + accXCounter);
} else {
xPos = xPos - (speed + accXCounter);
}
accXCounter = accXCounter + 2;
if (((xPos > gotoX) && (xInc)) || ((xPos < gotoX) && (!xInc))) {
xPos = gotoX;
accXCounter = 0;
runGotoX = false;
xFloat.set(xPos);
if (runGotoY == false) {
_parent.runCheck = true;
_parent.noOfMoving--;
}
}
xFloat.set(xPos);
}
if (spinning) {
spinAnimCounter++;
xPos = xPos + a;
yPos = yPos + b;
a = a + aa;
b = b + bb;
xFloat.set(xPos);
yFloat.set(yPos);
expGoto = spinAnimCounter * 2;
expFloat.set(expGoto);
if (spinAnimCounter == 11) {
xFloat.set(gotoX);
yFloat.set(gotoY);
xFloat.set(gotoX);
yFloat.set(gotoY);
_parent.runCheck = true;
_parent.noOfMoving--;
spinning = false;
if (bonus) {
expGoto = 1;
} else {
expGoto = 1;
}
expFloat.set(expGoto);
expFloat.set(expGoto);
}
rSpinning = true;
}
if (_parent.noOfMoving == 0) {
if (hitTest(_root._xmouse, _root._ymouse) == true) {
var _local3 = y;
var _local4 = x;
if (_ymouse < 0) {
_local3 = _local3 - 1;
}
if (_xmouse < 0) {
_local4 = _local4 - 1;
}
_parent.highLightBricks(_local3, _local4);
}
}
if (explode) {
if (bonus) {
expGoto = 2;
yPos = yPos + bonusGotoMod;
yFloat.set(yPos);
if (bonusGotoMod == 2) {
bonusGotoMod = -2;
} else {
bonusGotoMod = 2;
}
} else {
expPos = _parent.expPos;
expGoto = (expPos % 20) + 3;
}
}
}
function render(tick, alpha) {
if (yPos != _y) {
_y = yFloat.get(alpha);
}
if (xPos != _x) {
_x = xFloat.get(alpha);
}
if (highLighted && (currentFrame == 1)) {
if (bonus) {
mcP.gotoAndStop(2);
} else {
mcP.gotoAndStop(2);
}
currentFrame = 2;
} else if ((!highLighted) && (currentFrame == 2)) {
if (bonus) {
mcP.gotoAndStop(1);
} else {
mcP.gotoAndStop(1);
}
currentFrame = 1;
}
if (rSpinning) {
mcP.gotoAndStop(Math.round(expFloat.get(alpha)));
if (spinning == false) {
rSpinning = false;
}
}
if (explode) {
mcP.gotoAndStop(expGoto);
}
}
function init(yT, xT, tp, delayer, num, bSign, star, lvl) {
level = lvl;
bonus = bSign;
starBonus = star;
y = yT - 1;
x = xT;
type = tp;
gotoAndStop(type + 1);
if (bonus) {
mcBonus._visible = true;
mcP.gotoAndStop(1);
} else {
mcBonus._visible = false;
mcP.gotoAndStop(1);
}
if (starBonus) {
mcStar._visible = true;
} else {
mcStar.gotoAndStop(1);
mcStar._visible = false;
}
id = num;
yPos = ((y * (pHeight - 20)) + 100) - 750;
xPos = (x * (pWidth - 20)) + 80;
expPos = 0;
_x = xPos;
_y = yPos;
accYCounter = 0;
accXCounter = 0;
speed = 1;
runGotoY = false;
runGotoX = false;
runDelay = false;
explode = false;
cfe = false;
yFloat.setTo(yPos);
xFloat.setTo(xPos);
expFloat.setTo(expPos);
}
function initFall() {
goTo(1, y + 1, x);
}
function onPress() {
if (_parent.noOfMoving == 0) {
var _local2 = y;
var _local3 = x;
if (_ymouse < 0) {
_local2 = _local2 - 1;
}
if (_xmouse < 0) {
_local3 = _local3 - 1;
}
_parent.switchBricks(_local2, _local3);
}
}
function goTo(delayer, yVal, xVal) {
accYCounter = 0;
accXCounter = 0;
if (y != yVal) {
yInc = true;
if (y > yVal) {
yInc = false;
}
gotoY = Number((yVal * (pHeight - 20)) + 40);
runGotoY = true;
_parent.noOfMoving++;
}
if (x != xVal) {
xInc = true;
if (x > xVal) {
xInc = false;
}
gotoX = Number((xVal * (pWidth - 20)) + 100);
runGotoX = true;
_parent.noOfMoving++;
}
runDelay = true;
delayTime = delayer;
y = yVal;
x = xVal;
}
function spin(pos, yVal, xVal, gYVal, gXVal) {
spinAnimCounter = 0;
_parent.noOfMoving++;
gotoX = Number((gXVal * (pWidth - 20)) + 80);
a = (Number((xVal * (pWidth - 20)) + 80) - _x) / 10;
gotoY = Number((gYVal * (pHeight - 20)) + 40);
b = (Number((yVal * (pHeight - 20)) + 40) - _y) / 10;
switch (pos) {
case 1 :
aa = 0;
bb = ((Number((yVal * (pHeight - 20)) + 40) - _y) / 10) / -5;
break;
case 2 :
aa = ((Number((xVal * (pWidth - 20)) + 80) - _x) / 10) / -5;
bb = 0;
break;
case 3 :
aa = 0;
bb = ((Number((yVal * (pHeight - 20)) + 40) - _y) / 10) / -5;
break;
case 4 :
aa = ((Number((xVal * (pWidth - 20)) + 80) - _x) / 10) / -5;
bb = 0;
}
x = gXVal;
y = gYVal;
spinning = true;
}
function stopBonusShake() {
explode = false;
mcP.gotoAndStop(1);
yFloat.set(yPos);
yFloat.set(yPos);
}
function explodePiece() {
removePiece();
}
function removePiece() {
removeMovieClip();
}
var gotoX = null;
var gotoY = null;
var highLighted = false;
var currentFrame = 1;
var spinning = false;
var rSpinning = false;
var bonusGotoMod = 2;
}
Symbol 1310 MovieClip [__Packages.com.king.util.Delay] Frame 0
class com.king.util.Delay
{
var m_fn, m_param, m_context, m_delay, m_started, m_timerId;
function Delay (context, fn, delay) {
m_fn = fn;
m_param = new Array();
var _local3 = 3;
while (_local3 < arguments.length) {
m_param.push(arguments[_local3]);
_local3++;
}
m_context = context;
m_delay = delay;
m_started = getTimer();
m_timerId = setInterval(mx.utils.Delegate.create(this, onEvent), delay);
}
function onEvent() {
if (getTimer() >= (m_delay + m_started)) {
clearInterval(m_timerId);
m_fn.apply(m_context, m_param);
m_fn = undefined;
m_param = undefined;
}
}
static function oneShot(context, fn, delay) {
var _local3 = new com.king.util.Delay(context, fn, delay);
_local3.m_param = new Array();
var _local2 = 3;
while (_local2 < arguments.length) {
_local3.m_param.push(arguments[_local2]);
_local2++;
}
}
}
Symbol 1311 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 1312 MovieClip [__Packages.com.king.timing.IFloat] Frame 0
class com.king.timing.IFloat
{
static var alpha;
var ivalue, lastValue;
function IFloat (initial) {
ivalue = initial;
lastValue = initial;
alpha = 0;
}
function setTo(initial) {
ivalue = initial;
lastValue = initial;
}
function set(newValue) {
lastValue = ivalue;
ivalue = newValue;
}
function get(lalpha) {
return(lastValue + ((ivalue - lastValue) * lalpha));
}
static function setAlpha(na) {
alpha = na;
}
function get value() {
return(lastValue + ((ivalue - lastValue) * alpha));
}
function set value(v) {
ivalue = v;
lastValue = v;
//return(value);
}
}
Symbol 1313 MovieClip [__Packages.com.king.FourSeasons.JumpLetter] Frame 0
class com.king.FourSeasons.JumpLetter extends MovieClip
{
var yFloat, xFloat, delayer, currentTick, acc, accMod, yPos, xPos, accModMod, _y, _x, mcText, txtLetter, txtLetter2;
function JumpLetter () {
super();
yFloat = new com.king.timing.IFloat();
xFloat = new com.king.timing.IFloat();
}
function tick(tick, tps) {
counter++;
if (counter > delayer) {
currentTick = tick;
acc = acc + accMod;
yPos = yPos + acc;
xPos = xPos;
yFloat.set(yPos);
xFloat.set(xPos);
if (acc >= 9) {
accMod = -1 * accModMod;
}
if (acc <= -9) {
accMod = 1 * accModMod;
}
}
}
function render(tick, alpha) {
_y = yFloat.get(alpha);
_x = xFloat.get(alpha);
}
function init(theLet, num, totNum) {
mcText.txtLetter.text = theLet;
txtLetter.text = theLet;
txtLetter2.text = theLet;
var _local3 = 377.5 - ((totNum * 40) / 2);
xPos = _local3 + (num * 40);
yPos = 200;
_x = xPos;
_y = yPos;
acc = 0;
accModMod = Math.round(Math.random() * 2) + 1;
accMod = 1 * accModMod;
delayer = Math.round(Math.random() * 10);
}
var counter = 0;
}
Symbol 1314 MovieClip [__Packages.com.king.FourSeasons.Score] Frame 0
class com.king.FourSeasons.Score extends MovieClip
{
var yFloat, aFloat, currentTick, yPos, aPos, _y, _alpha, txtScore, mcText, _x, _parent;
function Score () {
super();
yFloat = new com.king.timing.IFloat();
aFloat = new com.king.timing.IFloat();
}
function tick(tick, tps) {
currentTick = tick;
yPos = yPos - acc;
aPos = aPos - acc;
yFloat.set(yPos);
aFloat.set(aPos);
acc = acc + 0.3;
if (aPos <= 0) {
removeScores();
}
}
function render(tick, alpha) {
_y = yFloat.get(alpha);
_alpha = aFloat.get(alpha);
}
function init(y, x, theScore) {
txtScore.text = "+" + theScore;
mcText.txtScore.text = "+" + theScore;
_y = y;
_x = x;
yPos = y;
aPos = 100;
yFloat.setTo(yPos);
aFloat.setTo(aPos);
}
function removeScores() {
_parent.removeScores();
}
var acc = 0;
}
Symbol 1315 MovieClip [__Packages.com.king.FourSeasons.BonusAnim] Frame 0
class com.king.FourSeasons.BonusAnim extends MovieClip
{
var yFloat, xFloat, animCounter, endX, _x, endY, startX, startY, _y, _rotation, _xscale, _yscale, mcBonus, bLet, gotoAndStop, _parent, removeMovieClip;
function BonusAnim () {
super();
yFloat = new com.king.timing.IFloat();
xFloat = new com.king.timing.IFloat();
}
function tick(tick, tps) {
animCounter++;
if ((_x + 15) >= endX) {
xFloat.set(endX);
xFloat.set(endX);
yFloat.set(endY);
yFloat.set(endY);
endAnim();
} else {
var _local3 = (endX - startX) / 15;
var _local2 = (endY - startY) / _local3;
xFloat.set(_x + 15);
yFloat.set(_y + _local2);
if ((_x - startX) > ((endX - startX) / 2)) {
scaleMod = -2;
yMod = 0.5;
}
scale = Math.min(scale + scaleMod, 150);
}
}
function render(tick, alpha) {
_y = yFloat.get(alpha);
_x = xFloat.get(alpha);
_rotation = _rotation + 5;
_xscale = scale;
_yscale = scale;
mcBonus.gotoAndStop(animCounter % 10);
}
function init(x, y, type) {
_xscale = scale;
_yscale = scale;
bLet = type;
animCounter = 1;
gotoAndStop(type);
mcBonus.gotoAndStop(animCounter);
startX = x;
startY = y;
_y = y;
_x = x;
switch (type) {
case 1 :
endX = 660;
endY = 135;
break;
case 2 :
endX = 660;
endY = 165;
break;
case 3 :
endX = 660;
endY = 220;
break;
case 4 :
endX = 660;
endY = 265;
break;
case 5 :
endX = 660;
endY = 310;
}
yFloat.setTo(y);
xFloat.setTo(x);
}
function endAnim() {
_parent.showBonus(bLet - 1);
removeMovieClip();
}
var scale = 50;
var scaleMod = 10;
var yMod = 2;
}
Symbol 1316 MovieClip [__Packages.com.king.FourSeasons.Particle] Frame 0
class com.king.FourSeasons.Particle extends MovieClip
{
var gotoAndStop, _x, _y, removeMovieClip;
function Particle () {
super();
}
function tick(tick, tps) {
animCounter = animCounter + 2;
}
function render(tick, alpha) {
if (animCounter < 17) {
gotoAndStop(animCounter);
} else {
endAnim();
}
}
function init(x, y) {
gotoAndStop(1);
_x = x;
_y = y;
}
function endAnim() {
removeMovieClip();
}
var animCounter = 1;
}
Symbol 1317 MovieClip [__Packages.com.king.FourSeasons.GameTimer] Frame 0
class com.king.FourSeasons.GameTimer extends MovieClip
{
var mcMask, gotoAndStop;
function GameTimer () {
super();
}
function tick(tick, tps) {
animCounter++;
if (animCounter == 25) {
animGoto++;
animCounter = 0;
}
if (animGoto > 190) {
sirCounter++;
if (sirCounter > 3) {
sirGoto++;
sirCounter = 0;
}
}
}
function render(tick, alpha) {
if (animCounter == 0) {
mcMask.gotoAndStop(animGoto);
}
if (sirCounter == 2) {
gotoAndStop((sirGoto % 2) + 1);
}
}
function init(x, y, type) {
}
var animCounter = 0;
var animGoto = 1;
var sirCounter = 0;
var sirGoto = 1;
}
Symbol 1318 MovieClip [__Packages.com.king.FourSeasons.IntroExpl] Frame 0
class com.king.FourSeasons.IntroExpl extends MovieClip
{
var delay, mcMarker, c, attachMovie;
function IntroExpl () {
super();
delay = new com.king.util.Delay();
}
function tick(tick, tps) {
expPos++;
var _local3 = 0;
while (_local3 < gameGridObj.length) {
var _local2 = 0;
while (_local2 < gameGridObj[_local3].length) {
gameGridObj[_local3][_local2].tick(tick, tps);
_local2++;
}
_local3++;
}
_local3 = 0;
while (_local3 < particleArr.length) {
particleArr[_local3].tick(tick, tps);
_local3++;
}
if (bonusAnimArr.length > 0) {
_local3 = 0;
while (_local3 < bonusAnimArr.length) {
bonusAnimArr[_local3].tick(tick, tps);
_local3++;
}
}
}
function render(tick, alpha) {
var _local3 = 0;
while (_local3 < gameGridObj.length) {
var _local2 = 0;
while (_local2 < gameGridObj[_local3].length) {
gameGridObj[_local3][_local2].render(tick, alpha);
_local2++;
}
_local3++;
}
_local3 = 0;
while (_local3 < particleArr.length) {
particleArr[_local3].render(tick, alpha);
_local3++;
}
if (bonusAnimArr.length > 0) {
_local3 = 0;
while (_local3 < bonusAnimArr.length) {
bonusAnimArr[_local3].render(tick, alpha);
_local3++;
}
}
}
function init() {
mcMarker._x = 50;
mcMarker._y = 10;
typeArr = [1, 2, 1, 1, 1, 1, 2, 3, 3, 4, 1, 1];
c = 0;
var _local7 = 0;
var _local5 = false;
var _local4 = 0;
while (_local4 < 3) {
var _local6 = new Array();
var _local2 = 0;
while (_local2 < 4) {
_local7++;
if (_local7 == 4) {
_local5 = true;
} else {
_local5 = false;
}
var _local3 = attachMovie("Pieces", "introExpieces_" + piecesCounter, pDepthCounter);
_local3.init(_local4, _local2, typeArr[c], Number(((_local4 * 10) + _local2) + 1), piecesCounter, _local5, false, 1);
piecesCounter++;
pDepthCounter++;
c++;
_local6[_local2] = _local3;
_local2++;
}
gameGridObj[_local4] = _local6;
_local4++;
}
_local4 = 0;
while (_local4 < gameGridObj.length) {
var _local2 = 0;
while (_local2 < gameGridObj[_local4].length) {
gameGridObj[_local4][_local2].initFall();
_local2++;
}
_local4++;
}
com.king.util.Delay.oneShot(this, stepOne, 2000);
com.king.util.Delay.oneShot(this, stepTwo, 2400);
com.king.util.Delay.oneShot(this, stepThree, 3500);
com.king.util.Delay.oneShot(this, stepFour, 3900);
com.king.util.Delay.oneShot(this, stepFive, 5000);
com.king.util.Delay.oneShot(this, stepSix, 7500);
com.king.util.Delay.oneShot(this, init, 8000);
}
function stepOne() {
var _local2 = 0;
var _local3 = 0;
gameGridObj[_local2][_local3].spin(1, _local2 - 1, _local3 + 1, _local2, _local3 + 1);
gameGridObj[_local2][_local3 + 1].spin(2, _local2 + 1, _local3 + 2, _local2 + 1, _local3 + 1);
gameGridObj[_local2 + 1][_local3 + 1].spin(3, _local2 + 2, _local3, _local2 + 1, _local3);
gameGridObj[_local2 + 1][_local3].spin(4, _local2, _local3 - 1, _local2, _local3);
}
function stepTwo() {
gameGridObj[0][0].explode = true;
gameGridObj[0][2].explode = true;
gameGridObj[0][3].explode = true;
gameGridObj[1][0].explode = true;
gameGridObj[1][1].explode = true;
}
function stepThree() {
mcMarker._x = 150;
mcMarker._y = 60;
var _local2 = 1;
var _local3 = 2;
gameGridObj[_local2][_local3].spin(1, _local2 - 1, _local3 + 1, _local2, _local3 + 1);
gameGridObj[_local2][_local3 + 1].spin(2, _local2 + 1, _local3 + 2, _local2 + 1, _local3 + 1);
gameGridObj[_local2 + 1][_local3 + 1].spin(3, _local2 + 2, _local3, _local2 + 1, _local3);
gameGridObj[_local2 + 1][_local3].spin(4, _local2, _local3 - 1, _local2, _local3);
}
function stepFour() {
sendBonus(gameGridObj[0][3]);
gameGridObj[0][3].bonus = false;
gameGridObj[2][2].explode = true;
gameGridObj[2][3].explode = true;
}
function stepFive() {
particleArr = [];
gameGridObj[0][0]._visible = false;
gameGridObj[0][2]._visible = false;
gameGridObj[0][3]._visible = false;
gameGridObj[1][0]._visible = false;
gameGridObj[1][1]._visible = false;
gameGridObj[2][2]._visible = false;
gameGridObj[2][3]._visible = false;
part(0, 0);
part(0, 2);
part(0, 3);
part(1, 0);
part(1, 1);
part(2, 2);
part(2, 3);
}
function stepSix() {
var _local3 = 0;
while (_local3 < gameGridObj.length) {
var _local2 = 0;
while (_local2 < gameGridObj[_local3].length) {
gameGridObj[_local3][_local2].removePiece();
_local2++;
}
_local3++;
}
}
function part(y, x) {
var _local2 = attachMovie("Particle", "particle_" + particleCounter, particleDepthCounter);
particleCounter++;
particleDepthCounter++;
_local2.init(gameGridObj[y][x]._x - 40, gameGridObj[y][x]._y - 40);
particleArr.push(_local2);
}
function sendBonus(obj) {
var _local3 = attachMovie("BonusAnim", "bonusAnim_" + bonusCounter, bDepthCounter);
var _local4 = (obj.type + 1) - 0;
_local3.init(obj._x, obj._y, _local4);
obj.mcBonus._visible = false;
bonusAnimArr.push(_local3);
bDepthCounter++;
bonusCounter++;
}
var piecesCounter = 0;
var pDepthCounter = 0;
var typeArr = new Array();
var gameGridObj = new Array();
var expPos = 0;
var particleCounter = 0;
var particleDepthCounter = 1000;
var particleArr = new Array();
var bonusAnimArr = new Array();
var bDepthCounter = 500;
var bonusCounter = 0;
}
Symbol 1319 MovieClip [__Packages.com.king.FourSeasons.Marker] Frame 0
class com.king.FourSeasons.Marker extends MovieClip
{
var _visible, roundStarted, currentTick, yPos, xPos, vis, _y, _x;
function Marker () {
super();
}
function Pieces() {
_visible = false;
roundStarted = false;
}
function tick(tick, tps) {
currentTick = tick;
yPos = (Math.round((_root._ymouse - 15) / 50) * 50) + 15;
xPos = (Math.round((_root._xmouse - 5) / 50) * 50) + 5;
if (((((yPos < 40) || (yPos > 400)) || (xPos < 100)) || (xPos > 550)) || (roundStarted == false)) {
vis = false;
} else {
vis = true;
}
}
function render(tick, alpha) {
_y = yPos;
_x = xPos;
_visible = vis;
}
function init() {
}
}
Symbol 1320 MovieClip [__Packages.com.king.FourSeasons.Game] Frame 0
class com.king.FourSeasons.Game extends MovieClip
{
var communicator, delay, gameState, score, expPos, mcBonusLetters, currentTick, _parent, mcMarker, progressBarGoto, levelProgressCap, levelProgress, noOfMoving, explodeTimer, barHeight, origBarHeight, explodeTimerReset, level, resetBar, endLvlCounter, mcProgress, mcTimerBar, random, bonusRandom, userType, lvlScore, ticks_per_sec, scoreMod, isBoom, mcBackGround, creatingBoard, bonusColor, attachMovie, noOfExpl, scoreConsecMod, test;
function Game () {
super();
communicator = new com.king.util.Communicator();
delay = new com.king.util.Delay();
gameState = STATE_NOT_RUNNING;
score = 0;
expPos = 0;
mcBonusLetters._visible = false;
}
function tick(tick, tps) {
currentTick = tick;
expPos++;
if (particleArr.length > 0) {
var _local5 = 0;
while (_local5 < particleArr.length) {
particleArr[_local5].tick(tick, tps);
_local5++;
}
}
if (_parent.gameTime <= 0) {
gameState = STATE_NOT_RUNNING;
}
if (gameState == STATE_RUNNING) {
mcMarker.tick(tick, tps);
progressBarGoto = Math.round((levelProgress / levelProgressCap) * 100) + 1;
var _local5 = 0;
while (_local5 < gameGridObj.length) {
var _local2 = 0;
while (_local2 < gameGridObj[_local5].length) {
gameGridObj[_local5][_local2].tick(tick, tps);
_local2++;
}
_local5++;
}
if ((noOfMoving == 0) && (runCheck == true)) {
mcMarker.roundStarted = true;
checkForPairs();
}
if (explosionCheck == true) {
explodeTimer = explodeTimer - 1;
barHeight.set((explodeTimer / explodeTimerReset) * origBarHeight);
if ((explodeTimer <= 0) && (noOfMoving == 0)) {
com.king.util.SoundManager.stop("active");
if (bigSet) {
com.king.util.SoundManager.play("children", 70, false);
} else {
com.king.util.SoundManager.play("dream", 60, false);
}
createScore();
createParticle();
explodeBoard();
updateProgress();
if (levelProgress < levelProgressCap) {
refillBoard();
} else {
if (level < 4) {
com.king.util.SoundManager.play("levelCleared", 70, false);
}
lvlFinished = true;
_parent.mcEndGame.mcExitGame._visible = false;
gameState = STATE_NOT_RUNNING;
}
explodeTimer = explodeTimerReset;
explosionCheck = false;
resetBar = true;
}
}
if (scoreArr.length > 0) {
_local5 = 0;
while (_local5 < scoreArr.length) {
scoreArr[_local5].tick(tick, tps);
_local5++;
}
}
if (bonusAnimArr.length > 0) {
_local5 = 0;
while (_local5 < bonusAnimArr.length) {
bonusAnimArr[_local5].tick(tick, tps);
_local5++;
}
}
} else if (gameState == STATE_NOT_RUNNING) {
if (endLvlCounter >= 0) {
endLvlCounter = endLvlCounter - 4;
if (endLvlCounter == 0) {
endRound();
}
}
}
}
function render(tick, alpha) {
mcProgress.gotoAndStop(progressBarGoto);
if (particleArr.length > 0) {
var _local5 = 0;
while (_local5 < particleArr.length) {
particleArr[_local5].render(tick, alpha);
_local5++;
}
}
if (gameState == STATE_RUNNING) {
mcMarker.render(tick, alpha);
var _local5 = 0;
while (_local5 < gameGridObj.length) {
var _local2 = 0;
while (_local2 < gameGridObj[_local5].length) {
gameGridObj[_local5][_local2].render(tick, alpha);
_local2++;
}
_local5++;
}
if ((explosionCheck == true) || (resetBar)) {
mcTimerBar._height = barHeight.get(alpha);
resetBar = false;
}
if (scoreArr.length > 0) {
_local5 = 0;
while (_local5 < scoreArr.length) {
scoreArr[_local5].render(tick, alpha);
_local5++;
}
}
if (bonusAnimArr.length > 0) {
_local5 = 0;
while (_local5 < bonusAnimArr.length) {
bonusAnimArr[_local5].render(tick, alpha);
_local5++;
}
}
} else if (gameState == STATE_NOT_RUNNING) {
if (endLvlCounter < 100) {
var _local5 = 0;
while (_local5 < gameGridObj.length) {
var _local2 = 0;
while (_local2 < gameGridObj[_local5].length) {
gameGridObj[_local5][_local2]._alpha = endLvlCounter;
_local2++;
}
_local5++;
}
_local5 = 0;
while (_local5 < scoreArr.length) {
scoreArr[_local5]._alpha = endLvlCounter;
_local5++;
}
}
}
}
function startRound(lvl, rnd, tps, bnsRnd, lvlProgCap, usr, scr) {
com.king.util.SoundManager.play("loop", 35, true);
level = lvl;
random = rnd;
bonusRandom = bnsRnd;
userType = usr;
lvlFinished = false;
plusTime = false;
lvlScore = 0;
score = scr;
levelProgress = 1;
levelProgressCap = lvlProgCap;
endLvlCounter = 100;
noOfMoving = 0;
runCheck = false;
ticks_per_sec = tps;
explodeTimerReset = 3 * ticks_per_sec;
explodeTimer = explodeTimerReset;
origBarHeight = mcTimerBar._height;
barHeight = new com.king.timing.IFloat();
barHeight.setTo(origBarHeight);
resetBar = false;
scoreMod = 1;
gotBonus = false;
var _local2 = 0;
while (_local2 < 5) {
bonusArr[_local2] = 0;
_local2++;
}
isBoom = true;
updateScore(0);
setBackGround();
createBoard();
mcBonusLetters.gotoAndStop(level);
mcProgress.gotoAndStop(1);
bonusGraphicsArr[0] = mcBonusLetters.mcBonus_B;
bonusGraphicsArr[1] = mcBonusLetters.mcBonus_O;
bonusGraphicsArr[2] = mcBonusLetters.mcBonus_N;
bonusGraphicsArr[3] = mcBonusLetters.mcBonus_U;
bonusGraphicsArr[4] = mcBonusLetters.mcBonus_S;
_local2 = 0;
while (_local2 < bonusGraphicsArr.length) {
bonusGraphicsArr[_local2]._visible = false;
_local2++;
}
mcBonusLetters._visible = true;
if ((level == 2) && (userType == 0)) {
noOfMoving = 5;
com.king.util.Delay.oneShot(this, openUserEnd, 1500);
}
gameState = STATE_RUNNING;
}
function openUserEnd() {
gameState = STATE_NOT_RUNNING;
}
function setBackGround() {
mcBackGround.gotoAndStop(level);
mcMarker.gotoAndStop(level);
}
function createBoard() {
isBoom = true;
creatingBoard = true;
while (isBoom == true) {
var _local10 = 0;
while (_local10 < BOARD_HEIGHT) {
var _local8 = new Array();
var _local9 = new Array();
var _local7 = 0;
while (_local7 < BOARD_WIDTH) {
if (random.nextInt(100) < (BONUS_SPAWN_CHANCE / 2)) {
createBonus = true;
bonusColor = bonusRandom.nextInt(5) + ((level - 1) * 5);
}
var _local6 = random.nextInt(5) + ((level - 1) * 5);
var _local2 = false;
if ((createBonus == true) && (_local6 == bonusColor)) {
_local2 = true;
createBonus = false;
}
var _local5 = false;
if (_local2 == false) {
if (random.nextInt(100) < 2) {
_local5 = true;
}
}
var _local3 = new com.king.FourSeasons.tmpPieces();
_local3.init(_local10, _local7, _local6, Number(((_local10 * 10) + _local7) + 1), piecesCounter, _local2, _local5, level);
_local8[_local7] = 1;
_local9[_local7] = _local3;
_local7++;
}
gameGrid[_local10] = _local8;
gameGridObj[_local10] = _local9;
_local10++;
}
checkForPairs();
if (!isBoom) {
_local10 = 0;
while (_local10 < BOARD_HEIGHT) {
var _local7 = 0;
while (_local7 < BOARD_WIDTH) {
var _local4 = attachMovie("Pieces", "pieces_" + piecesCounter, pDepthCounter);
_local4.init(_local10, _local7, gameGridObj[_local10][_local7].type, Number(((_local10 * 10) + _local7) + 1), piecesCounter, gameGridObj[_local10][_local7].bonus, gameGridObj[_local10][_local7].starBonus, level);
piecesCounter++;
pDepthCounter++;
gameGridObj[_local10][_local7] = _local4;
_local7++;
}
_local10++;
}
}
}
creatingBoard = false;
var _local10 = 0;
while (_local10 < BOARD_HEIGHT) {
var _local7 = 0;
while (_local7 < BOARD_WIDTH) {
gameGridObj[_local10][_local7].initFall();
_local7++;
}
_local10++;
}
}
function checkForPairs() {
isBoom = false;
bigSet = false;
if (noOfMoving == 0) {
var _local4 = getTimer();
explosionCheck = false;
var _local3 = 0;
while (_local3 < explArr.length) {
var _local2 = 0;
while (_local2 < explArr[_local3].length) {
explArr[_local3][_local2].explode = false;
_local2++;
}
_local3++;
}
explArr = [];
_local3 = 0;
while (_local3 < BOARD_HEIGHT) {
var _local2 = 0;
while (_local2 < BOARD_WIDTH) {
noOfExpl = 0;
explStrArr = [];
if (gameGridObj[_local3][_local2].explode == false) {
explStrArr.push(gameGridObj[_local3][_local2]);
gameGridObj[_local3][_local2].cfe = true;
noOfExpl++;
checkConnections(_local3, _local2);
if (noOfExpl > 4) {
if (noOfExpl > 9) {
bigSet = true;
}
explArr.push(explStrArr);
noOfExpl = 0;
explosionCheck = true;
} else {
noOfExpl = 0;
}
}
_local2++;
}
_local3++;
}
if (explArr.length == 0) {
explodeTimer = explodeTimerReset;
scoreMod = 1;
scoreConsecMod = 0;
} else {
isBoom = true;
if (creatingBoard == false) {
_local3 = 0;
while (_local3 < explArr.length) {
var _local2 = 0;
while (_local2 < explArr[_local3].length) {
explArr[_local3][_local2].explode = true;
if (explArr[_local3][_local2].bonus && (explArr[_local3].length > 5)) {
explArr[_local3][_local2].bonus = false;
sendBonus(explArr[_local3][_local2]);
bonusArr[explArr[_local3][_local2].type - ((level - 1) * 5)] = 1;
}
_local2++;
}
_local3++;
}
}
}
_local3 = 0;
while (_local3 < BOARD_HEIGHT) {
var _local2 = 0;
while (_local2 < BOARD_WIDTH) {
gameGridObj[_local3][_local2].cfe = false;
_local2++;
}
_local3++;
}
}
runCheck = false;
}
function checkConnections(y, x) {
if (y > 0) {
if ((gameGridObj[y - 1][x].type == gameGridObj[y][x].type) && (gameGridObj[y - 1][x].cfe == false)) {
gameGridObj[y - 1][x].cfe = true;
explStrArr.push(gameGridObj[y - 1][x]);
noOfExpl++;
checkConnections(y - 1, x);
}
}
if (y < BOARD_HEIGHT) {
if ((gameGridObj[y + 1][x].type == gameGridObj[y][x].type) && (gameGridObj[y + 1][x].cfe == false)) {
gameGridObj[y + 1][x].cfe = true;
explStrArr.push(gameGridObj[y + 1][x]);
noOfExpl++;
checkConnections(y + 1, x);
}
}
if (x > 0) {
if ((gameGridObj[y][x - 1].type == gameGridObj[y][x].type) && (gameGridObj[y][x - 1].cfe == false)) {
gameGridObj[y][x - 1].cfe = true;
explStrArr.push(gameGridObj[y][x - 1]);
noOfExpl++;
checkConnections(y, x - 1);
}
}
if (x < BOARD_WIDTH) {
if ((gameGridObj[y][x + 1].type == gameGridObj[y][x].type) && (gameGridObj[y][x + 1].cfe == false)) {
gameGridObj[y][x + 1].cfe = true;
explStrArr.push(gameGridObj[y][x + 1]);
noOfExpl++;
checkConnections(y, x + 1);
}
}
}
function createScore() {
scoreArr = [];
var _local6;
var _local2 = 0;
while (_local2 < explArr.length) {
_local6 = 1;
var _local4 = 100;
var _local3 = 0;
while (_local3 < explArr[_local2].length) {
if (explArr[_local2][_local3].starBonus == true) {
_local6 = _local6 + 0.5;
}
_local3++;
}
if (explArr[_local2].length > 5) {
_local3 = 0;
while (_local3 < (explArr[_local2].length - 5)) {
_local4 = _local4 + ((_local3 + 1) * 50);
_local3++;
}
}
_local4 = _local4 + (scoreConsecMod * SCORE_CONSEC_MOD_SCORE);
_local4 = Math.round(_local4 * _local6);
updateScore(_local4);
var _local5 = attachMovie("Score", "score_" + scoreCounter, sDepthCounter);
_local5.init(explArr[_local2][Math.round(explArr.length / 2)]._y, explArr[_local2][Math.round(explArr.length / 2)]._x, _local4);
scoreArr.push(_local5);
test = _local5;
scoreCounter++;
sDepthCounter++;
scoreConsecMod++;
_local2++;
}
}
function updateScore(num) {
if (currentTick > 0) {
communicator.sendUpdateScore(currentTick, num);
}
lvlScore = lvlScore + num;
score = score + num;
_parent.txtScore.text = score;
}
function updateProgress() {
var _local2 = 0;
while (_local2 < explArr.length) {
levelProgress = levelProgress + (explArr[_local2].length * explArr[_local2].length);
_local2++;
}
}
function removeScores() {
var _local2 = 0;
while (_local2 < scoreArr.length) {
scoreArr[_local2].removeMovieClip();
_local2++;
}
scoreArr = [];
}
function explodeBoard() {
var _local3 = 0;
while (_local3 < BOARD_HEIGHT) {
var _local2 = 0;
while (_local2 < BOARD_WIDTH) {
if (gameGridObj[_local3][_local2].explode) {
if (gameGridObj[_local3][_local2].bonus == false) {
gameGrid[_local3][_local2] = 0;
gameGridObj[_local3][_local2].explodePiece();
} else {
gameGridObj[_local3][_local2].stopBonusShake();
}
}
_local2++;
}
_local3++;
}
}
function createParticle() {
particleArr = [];
var _local3 = 0;
while (_local3 < explArr.length) {
var _local2 = 0;
while (_local2 < explArr[_local3].length) {
var _local4 = attachMovie("Particle", "particle_" + particleCounter, particleDepthCounter);
particleCounter++;
particleDepthCounter++;
_local4.init(explArr[_local3][_local2]._x - 40, explArr[_local3][_local2]._y - 40);
particleArr.push(_local4);
_local2++;
}
_local3++;
}
}
function sendBonus(obj) {
com.king.util.SoundManager.play("bonusLetter", 65, false);
var _local3 = attachMovie("BonusAnim", "bonusAnim_" + bonusCounter, bDepthCounter);
var _local4 = (obj.type + 1) - ((level - 1) * 5);
_local3.init(obj._x, obj._y, _local4);
obj.mcBonus._visible = false;
bonusAnimArr.push(_local3);
bDepthCounter++;
bonusCounter++;
}
function showBonus(num) {
bonusGraphicsArr[num]._visible = true;
var _local3 = true;
var _local2 = 0;
while (_local2 < bonusArr.length) {
if (bonusArr[_local2] == 0) {
_local3 = false;
}
_local2++;
}
if (_local3 && (!gotBonus)) {
com.king.util.SoundManager.play("bonus", 80, false);
gotBonus = true;
}
}
function refillBoard() {
var _local3 = BOARD_HEIGHT - 1;
while (_local3 >= 0) {
var _local2 = BOARD_WIDTH - 1;
while (_local2 >= 0) {
if (gameGrid[_local3][_local2] == 0) {
var _local5 = _local3;
while (_local5 >= 0) {
if (gameGrid[_local5][_local2] == 1) {
gameGridObj[_local3][_local2] = gameGridObj[_local5][_local2];
gameGrid[_local5][_local2] = 0;
gameGrid[_local3][_local2] = 1;
gameGridObj[_local3][_local2].goTo(1, _local3, gameGridObj[_local3][_local2].x);
break;
}
if (_local5 == 0) {
var _local4 = _local3;
while (_local4 >= 0) {
if (random.nextInt(100) < BONUS_SPAWN_CHANCE) {
createBonus = true;
bonusColor = bonusRandom.nextInt(5) + ((level - 1) * 5);
}
var _local9 = random.nextInt(5) + ((level - 1) * 5);
var _local6 = false;
if ((createBonus == true) && (_local9 == bonusColor)) {
_local6 = true;
createBonus = false;
}
var _local8 = false;
if (_local6 == false) {
if (random.nextInt(100) < 2) {
_local8 = true;
}
}
var _local7 = attachMovie("Pieces", "pieces_" + piecesCounter, pDepthCounter);
_local7.init(_local4, _local2, _local9, Number(((_local3 * 10) + _local2) + 1), piecesCounter, _local6, _local8, level);
_local7.initFall();
gameGridObj[_local4][_local2] = _local7;
piecesCounter++;
pDepthCounter++;
gameGrid[_local4][_local2] = 1;
_local4--;
}
}
_local5--;
}
}
_local2--;
}
_local3--;
}
}
function switchBricks(y, x) {
communicator.sendBrickClicked(currentTick + 1, x, y);
if ((((y >= 0) && (y < (BOARD_HEIGHT - 1))) && (x >= 0)) && (x < (BOARD_WIDTH - 1))) {
var _local4 = false;
if (((gameGridObj[y][x].explode || (gameGridObj[y][x + 1].explode)) || (gameGridObj[y + 1][x + 1].explode)) || (gameGridObj[y + 1][x].explode)) {
_local4 = true;
}
if ((_local4 == false) && (gameState == STATE_RUNNING)) {
com.king.util.SoundManager.play("rotation", 65, false);
gameGridObj[y][x].spin(1, y - 1, x + 1, y, x + 1);
gameGridObj[y][x + 1].spin(2, y + 1, x + 2, y + 1, x + 1);
gameGridObj[y + 1][x + 1].spin(3, y + 2, x, y + 1, x);
gameGridObj[y + 1][x].spin(4, y, x - 1, y, x);
var _local8 = gameGridObj[y][x];
var _local7 = gameGridObj[y][x + 1];
var _local6 = gameGridObj[y + 1][x + 1];
var _local5 = gameGridObj[y + 1][x];
gameGridObj[y][x + 1] = _local8;
gameGridObj[y + 1][x + 1] = _local7;
gameGridObj[y + 1][x] = _local6;
gameGridObj[y][x] = _local5;
} else {
com.king.util.SoundManager.play("locked", 100, false);
}
}
}
function highLightBricks(y, x) {
clearHighLightedBricks();
gameGridObj[y][x].highLighted = true;
gameGridObj[y][x + 1].highLighted = true;
gameGridObj[y + 1][x + 1].highLighted = true;
gameGridObj[y + 1][x].highLighted = true;
}
function clearHighLightedBricks() {
var _local3 = 0;
while (_local3 < BOARD_HEIGHT) {
var _local2 = 0;
while (_local2 < BOARD_WIDTH) {
gameGridObj[_local3][_local2].highLighted = false;
_local2++;
}
_local3++;
}
}
function endRound() {
plusTime = false;
com.king.util.SoundManager.stop("loop");
com.king.util.SoundManager.stop("active");
var _local3 = true;
var _local2 = 0;
while (_local2 < bonusArr.length) {
if (bonusArr[_local2] == 0) {
_local3 = false;
}
_local2++;
}
clearLevel();
_parent.endRound(lvlScore, _local3);
}
function exitGamePressed() {
var _local3 = true;
var _local2 = 0;
while (_local2 < bonusArr.length) {
if (bonusArr[_local2] == 0) {
_local3 = false;
}
_local2++;
}
clearLevel();
gameState = STATE_NOT_RUNNING;
}
function clearLevel() {
mcMarker.roundStarted = false;
mcMarker._visible = false;
mcBonusLetters._visible = true;
removeScores();
var _local3 = 0;
while (_local3 < bonusAnimArr.length) {
bonusAnimArr[_local3].removeMovieClip();
_local3++;
}
bonusAnimArr = [];
_local3 = 0;
while (_local3 < BOARD_HEIGHT) {
var _local2 = 0;
while (_local2 < BOARD_WIDTH) {
gameGridObj[_local3][_local2].removePiece();
_local2++;
}
_local3++;
}
gameGridObj = [];
gameGrid = [];
bonusArr = [];
}
static var STATE_RUNNING = 0;
static var STATE_NOT_RUNNING = 1;
static var BOARD_HEIGHT = 8;
static var BOARD_WIDTH = 10;
static var SCORE_CONSEC_MOD_SCORE = 25;
static var BONUS_SPAWN_CHANCE = 16;
var runCheck = false;
var piecesCounter = 0;
var particleCounter = 0;
var pDepthCounter = 10000;
var particleDepthCounter = 20000;
var sDepthCounter = 30000;
var bDepthCounter = 40000;
var gameGrid = new Array();
var gameTypeGrid = new Array();
var gameGridObj = new Array();
var explArr = new Array();
var explStrArr = new Array();
var scoreArr = new Array();
var bonusAnimArr = new Array();
var bonusGraphicsArr = new Array();
var bonusArr = new Array();
var particleArr = new Array();
var explosionCheck = false;
var scoreCounter = 0;
var bonusCounter = 0;
var createBonus = false;
var bigSet = false;
var gotBonus = false;
var plusTime = false;
var lvlFinished = false;
}
Symbol 1321 MovieClip [__Packages.com.king.util.Communicator] Frame 0
class com.king.util.Communicator
{
var levelDatas, randomSeed, lang;
function Communicator () {
levelDatas = new Array();
}
function gameStarted() {
trace("GAME START");
if (!hasSentGameStart) {
hasSentGameStart = true;
fscommand ("gameStart");
}
}
function gameQuit() {
trace("GAME QUIT");
if (!hasSentGameOver) {
hasSentGameOver = true;
fscommand ("gameQuit");
}
}
function gameEnd(score) {
trace("GAME ENDS");
if (!hasSentGameEnd) {
hasSentGameEnd = true;
fscommand ("gameEnd", score);
}
}
function startRound(tick, gTime, cVer, ltc) {
fscommand ("playData", (((((((CMD_START_ROUND + ",") + tick) + " ") + gTime) + " ") + cVer) + " ") + ltc);
}
function sendBrickClicked(tick, x, y) {
fscommand ("playData", (((((CMD_BRICK_CLICKED + ",") + tick) + " ") + x) + " ") + y);
}
function sendGameTime(tick, gameTime) {
fscommand ("playData", (((CMD_GAME_TIME + ",") + tick) + " ") + gameTime);
}
function gameLastTick(tick, gTime) {
if (!hasSentLastTick) {
hasSentLastTick = true;
fscommand ("playData", (((CMD_LAST_TICK + ",") + tick) + " ") + gTime);
}
}
function sendUpdateScore(tick, scr) {
fscommand ("playData", (((CMD_SEND_SCORE + ",") + tick) + " ") + scr);
}
function parseGameData(gameData) {
var _local6 = new XML(_root.gameData);
_global.textMappings = new Object();
_global.userType = new Object();
var _local5 = _local6.childNodes[0].childNodes;
randomSeed = new Number(_local6.childNodes[0].attributes.randomseed).valueOf();
lang = _local6.childNodes[0].attributes.lang.valueOf();
var _local4 = 0;
while (_local4 < _local5.length) {
_root.debugText.text = _root.debugText.text + ("\r" + _local5[_local4].nodeName);
if (_local5[_local4].nodeName == "text") {
_global.textMappings[_local5[_local4].attributes.id] = new String(_local5[_local4].firstChild.nodeValue);
}
if (_local5[_local4].nodeName == "level") {
levelDatas[_local5[_local4].attributes.id] = new String(_local5[_local4].firstChild.nodeValue);
}
if (_local5[_local4].nodeName == "userType") {
_global.userType[_local5[_local4].attributes.id] = new String(_local5[_local4].firstChild.nodeValue);
}
_local4++;
}
}
static var CMD_START_ROUND = 266;
static var CMD_BRICK_CLICKED = 389;
static var CMD_GAME_TIME = 111;
static var CMD_LAST_TICK = 912;
static var CMD_SEND_SCORE = 428;
static var CMD_SCORE_UPDATE = 397;
static var CMD_CLIENT_SPAWN = 13;
static var CMD_SEND_RANDOM_NUM = 99;
var hasSentGameStart = false;
var hasSentGameEnd = false;
var hasSentGameOver = false;
var hasSentLastTick = false;
}
Symbol 1322 MovieClip [__Packages.com.king.util.Map] Frame 0
class com.king.util.Map
{
var map, lastSize;
function Map (init) {
map = new Object();
for (var _local3 in init) {
map["" + _local3] = init[_local3];
}
lastSize = -1;
}
function put(key, value) {
map["" + key] = value;
lastSize = -1;
}
function get(key) {
return(map["" + key]);
}
function remove(key) {
var _local2 = "" + key;
var _local3 = map[_local2];
delete map[_local2];
lastSize = -1;
return(_local3);
}
function contains(key) {
return(map["" + key] != undefined);
}
function count() {
if (lastSize < 0) {
lastSize = 0;
for (var _local2 in map) {
lastSize++;
}
}
return(lastSize);
}
function size() {
return(count());
}
function clear() {
map = {};
lastSize = 0;
}
function dump() {
var _local2 = "";
for (var _local3 in map) {
_local2 = _local2 + (((_local3 + "=>") + map[_local3]) + newline);
}
trace(_local2);
}
function toArray() {
var _local2 = [];
for (var _local3 in map) {
_local2[_local2.length] = map[_local3];
}
return(_local2);
}
function keySet() {
var _local2 = [];
for (var _local3 in map) {
_local2[_local2.length] = _local3;
}
return(_local2);
}
function get iterator() {
return(new com.king.util.MapIterator(this));
}
function get valueIterator() {
return(new com.king.util.MapValueIterator(this));
}
function foreach(fn) {
var _local3 = arguments.slice(1);
if (_local3.length > 0) {
do {
if ((in map) == null) {
break;
}
var _local5 = in map;
} while (fn(_local5, map[_local5], _local3[0], _local3[1], _local3[2], _local3[3], _local3[4]) != false);
do {
} while ("foreach" != null);
} else {
do {
if ((in map) == null) {
break;
}
var _local5 = in map;
} while (fn(_local5, map[_local5]) != false);
do {
} while (_local2 != null);
}
lastSize = -1;
}
function get _content() {
return(map);
}
}
Symbol 1323 MovieClip [__Packages.com.king.util.Iterator] Frame 0
interface com.king.util.Iterator
{
}
Symbol 1324 MovieClip [__Packages.com.king.util.MapIterator] Frame 0
class com.king.util.MapIterator implements com.king.util.Iterator
{
var map, keys, ptr;
function MapIterator (map) {
this.map = map;
keys = map.keySet();
ptr = 0;
}
function next() {
if (ptr < keys.length) {
return(keys[ptr++]);
}
return(undefined);
}
function hasNext() {
return(ptr != keys.length);
}
function remove() {
if (ptr == 0) {
return(undefined);
}
map.remove(keys[ptr - 1]);
}
}
Symbol 1325 MovieClip [__Packages.com.king.util.MapValueIterator] Frame 0
class com.king.util.MapValueIterator implements com.king.util.Iterator
{
var map, mapRef, keys, ptr;
function MapValueIterator (map) {
this.map = map;
mapRef = map._content;
keys = map.keySet();
ptr = 0;
}
function next() {
return(mapRef[keys[ptr++]]);
}
function hasNext() {
return(ptr != keys.length);
}
function remove() {
if (ptr == 0) {
return(undefined);
}
map.remove(keys[ptr - 1]);
}
}
Symbol 1326 MovieClip [__Packages.com.king.util.SoundManager] Frame 0
class com.king.util.SoundManager
{
static var globalSound;
function SoundManager () {
}
static function isSoundEnabled() {
return(soundEnabled);
}
static function enableSounds(enabled) {
soundEnabled = enabled;
if (!enabled) {
muteAll();
} else {
restoreMuteAll();
}
}
static function toggleSound() {
if (globalSound == undefined) {
globalSound = new Sound(_root);
}
soundOn = !soundOn;
globalSound.setVolume((soundOn ? 100 : 0));
}
static function stopAll() {
sounds.foreach(function (name, soundEntry) {
soundEntry.sound.stop();
soundEntry.playStatus = false;
});
}
static function muteAll() {
sounds.foreach(function (name, soundEntry) {
soundEntry.sound.setVolume(0);
soundEntry.isMuted = true;
});
}
static function restoreMuteAll() {
sounds.foreach(function (name, soundEntry) {
soundEntry.sound.setVolume(soundEntry.realVol);
soundEntry.isMuted = false;
});
}
static function stop(resource) {
var _local1 = sounds.get(resource);
if (_local1 != undefined) {
_local1.sound.stop();
_local1.playStatus = false;
}
}
static function getCalibratedVolume(flashVolume) {
flashVolume = Math.min(100, flashVolume);
flashVolume = Math.max(0, flashVolume);
return(Math.ceil(Math.pow(flashVolume / 100, 1.46) * 100));
}
static function setVolume(resource, percent) {
var _local1 = sounds.get(resource);
if ((_local1 != undefined) && (_local1.playStatus == true)) {
var _local2 = getCalibratedVolume(percent);
if (!_local1.isMuted) {
_local1.sound.setVolume(_local2);
}
_local1.realVol = _local2;
}
}
static function isPlaying(resource) {
var _local1 = sounds.get(resource);
return((_local1 != undefined) && (_local1.playStatus == true));
}
static function initialize(list) {
for (var _local9 in list) {
var resource = list[_local9];
var _local3 = _root.getNextHighestDepth();
var _local2 = new Sound(_root.createEmptyMovieClip("sm_sndhold_" + _local3, _local3));
_local2.attachSound(resource);
_local2.onSoundComplete = function () {
var _local1 = com.king.util.SoundManager.sounds.get(resource);
_local1.playStatus = false;
};
sounds.put(resource, {realVol:100, sound:_local2, playStatus:false});
}
}
static function play(resource, volume, isLoop, fn) {
if (volume == undefined) {
volume = 100;
}
if (isLoop == undefined) {
isLoop = false;
}
volume = getCalibratedVolume(volume);
var _local2 = sounds.get(resource);
if (_local2 != undefined) {
_local2.sound.setVolume((soundEnabled ? (volume) : 0));
_local2.realVol = volume;
_local2.isMuted = !soundEnabled;
_local2.playStatus = true;
_local2.onPlayedFn = fn;
_local2.sound.start(0, (isLoop ? 32767 : 1));
} else {
var _local6 = _root.getNextHighestDepth();
var _local4 = new Sound(_root.createEmptyMovieClip("sm_sndhold_" + _local6, _local6));
_local4.attachSound(resource);
_local4.onSoundComplete = function () {
var _local1 = com.king.util.SoundManager.sounds.get(resource);
_local1.playStatus = false;
com.king.util.SoundManager.onPlayed_(resource);
};
_local4.setVolume((soundEnabled ? (volume) : 0));
_local4.start(0, (isLoop ? 32767 : 1));
sounds.put(resource, {isMuted:!soundEnabled, realVol:volume, onPlayedFn:fn, sound:_local4, playStatus:true});
}
}
static function onPlayed_(name) {
var _local1 = sounds.get(name);
if ((_local1 != undefined) && (_local1.onPlayedFn != undefined)) {
_local1.onPlayedFn();
}
}
static var sounds = new com.king.util.Map();
static var soundEnabled = true;
static var soundOn = true;
}
Symbol 1327 MovieClip [__Packages.com.king.FourSeasons.tmpPieces] Frame 0
class com.king.FourSeasons.tmpPieces
{
var y, x, type, delayer, id, bonus, starBonus, level, explode, cfe;
function tmpPieces () {
}
function init(yT, xT, tp, del, num, bSign, star, lvl) {
y = yT;
x = xT;
type = tp;
delayer = del;
id = num;
bonus = bSign;
starBonus = star;
level = lvl;
explode = false;
cfe = false;
}
var gotoX = null;
var gotoY = null;
var highLighted = false;
var currentFrame = 1;
var spinning = false;
var rSpinning = false;
var bonusGotoMod = 2;
}
Symbol 1328 MovieClip [__Packages.com.king.timing.Timeable] Frame 0
interface com.king.timing.Timeable
{
}
Symbol 1329 MovieClip [__Packages.com.king.FourSeasons.FourSeasons] Frame 0
class com.king.FourSeasons.FourSeasons extends MovieClip implements com.king.timing.Timeable
{
var m_mainTimer, onEnterFrame, communicator, delay, mcInfoSign, noOfRend, mcEndGame, gameState, currentTick, random, bonusRandom, userType, txtIntro, txtOpenUserEnd, txtGotBonus, txtNotGetBonus, txtTimeUp, txtGratsText, txtRScore, txtTScore, ticksLeft, mcGame, mcTimer, lastTick, txtFPS, txtTime, attachMovie;
function FourSeasons () {
super();
m_mainTimer = new com.king.timing.Timer(this, TICKS_PER_SEC);
onEnterFrame = mx.utils.Delegate.create(this, drive);
communicator = new com.king.util.Communicator();
delay = new com.king.util.Delay();
mcInfoSign.onPress = function () {
this._parent.ticksLeft = 1;
};
noOfRend = 0;
mcEndGame.mcSoundToggle.onPress = function () {
com.king.util.SoundManager.toggleSound();
if (_root.mcFourSeasons.soundOn) {
this.txtSoundToggle.text = _global.textMappings.sound_on;
this.mcSound.gotoAndStop("off");
_root.mcFourSeasons.soundOn = false;
} else {
this.txtSoundToggle.text = _global.textMappings.sound_off;
this.mcSound.gotoAndStop("on");
_root.mcFourSeasons.soundOn = true;
}
};
mcEndGame.mcExitGame.onPress = function () {
if (_root.mcFourSeasons.exitPressed == false) {
_root.mcFourSeasons.exitGamePressed();
_root.mcFourSeasons.exitPressed = true;
}
};
gameState = STATE_WAIT_FOR_GAMEDATA;
}
function drive() {
m_mainTimer.advanceTime2();
}
function tick(tick) {
currentTick = tick;
switch (gameState) {
case STATE_WAIT_FOR_GAMEDATA :
if (DEBUG_MODE) {
_root.gameData = DEBUG_GAME_DATA;
}
if (_root.gameData != undefined) {
communicator.gameStarted();
communicator.parseGameData(_root.gameData);
random = new com.king.util.Random(communicator.randomSeed);
bonusRandom = new com.king.util.Random(random.nextInt(5000));
userType = _global.userType[0];
txtIntro = _global.textMappings.intro;
txtOpenUserEnd = _global.textMappings.open_user_end;
txtGotBonus = _global.textMappings.got_bonus;
txtNotGetBonus = _global.textMappings.not_get_bonus;
txtTimeUp = _global.textMappings.time_up;
txtGratsText = _global.textMappings.congratulations;
txtRScore = _global.textMappings.round_score;
txtTScore = _global.textMappings.total_score;
mcEndGame.mcSoundToggle.txtSoundToggle.text = _global.textMappings.sound_off;
mcEndGame.mcExitGame.txtExitGame.text = _global.textMappings.exit_game;
showInfoScreen();
}
break;
case STATE_SHOW_INFO_SCREEN :
ticksLeft = ticksLeft - 1;
mcInfoSign.mcIntroExpl.tick(tick, TICKS_PER_SEC);
mcInfoSign.txtCounter.text = _global.textMappings.game_starts_in.split("[0]").join("" + Math.round(ticksLeft / TICKS_PER_SEC));
if (ticksLeft <= 0) {
communicator.startRound(tick + 1, gameTime, clientVersion, 0);
gameStarted = true;
mcInfoSign.mcIntroExpl.stepSix();
startRound();
}
break;
case STATE_PLAY_GAME :
if (mcGame.lvlFinished == false) {
gameTime = gameTime - 1;
}
mcGame.tick(tick, TICKS_PER_SEC);
mcTimer.tick(tick, TICKS_PER_SEC);
break;
case STATE_BETWEEN_ROUNDS :
ticksLeft = ticksLeft - 1;
mcInfoSign.txtCounter.text = _global.textMappings.game_next_screen.split("[0]").join("" + Math.round(ticksLeft / TICKS_PER_SEC));
if (ticksLeft == 0) {
communicator.startRound(tick + 1, gameTime, clientVersion, 0);
startRound();
}
break;
case STATE_END_GAME :
ticksLeft = ticksLeft - 1;
mcInfoSign.txtCounter.text = _global.textMappings.game_ends.split("[0]").join("" + Math.round(ticksLeft / TICKS_PER_SEC));
if (ticksLeft == 0) {
gamePreQuit();
}
break;
case STATE_NOT_RUNNING :
if (jlArr.length <= 0) {
break;
}
var _local4 = 0;
for(;;){
if (_local4 >= jlArr.length) {
break;
}
jlArr[_local4].tick(tick, TICKS_PER_SEC);
_local4++;
};
}
}
function render(tick, alpha) {
noOfRend++;
if (((currentTick % TICKS_PER_SEC) == 0) && (lastTick == 24)) {
txtFPS.text = noOfRend;
txtTime.text = Math.round(getTimer() / 1000);
noOfRend = 0;
}
switch (gameState) {
case STATE_PLAY_GAME :
mcGame.render(tick, alpha);
mcTimer.render(tick, alpha);
break;
case STATE_NOT_RUNNING :
if (jlArr.length > 0) {
var _local2 = 0;
while (_local2 < jlArr.length) {
jlArr[_local2].render(tick, alpha);
_local2++;
}
}
break;
case STATE_SHOW_INFO_SCREEN :
mcInfoSign.mcIntroExpl.render(tick, alpha);
}
lastTick = currentTick % TICKS_PER_SEC;
}
function showInfoScreen() {
mcInfoSign.mcIntroExpl.init();
com.king.util.SoundManager.play("intro", 80, false);
ticksLeft = TICKS_PER_SEC * 15;
mcInfoSign._visible = true;
gameState = STATE_SHOW_INFO_SCREEN;
}
function endGame(num) {
ticksLeft = TICKS_PER_SEC * 10;
gameState = STATE_END_GAME;
}
function startRound() {
com.king.util.SoundManager.stop("intro");
com.king.util.SoundManager.stop("levelCleared");
level++;
var _local2;
switch (level) {
case 1 :
_local2 = 500;
break;
case 2 :
_local2 = 600;
break;
case 3 :
_local2 = 750;
break;
case 4 :
_local2 = 1000;
}
mcInfoSign._visible = false;
gameState = STATE_PLAY_GAME;
mcGame.startRound(level, random, TICKS_PER_SEC, bonusRandom, _local2, userType, score);
}
function endRound(scr, gotBonus) {
mcEndGame.mcExitGame._visible = true;
ticksLeft = TICKS_PER_SEC * 10;
if (gotBonus && (gameTime > 0)) {
scr = Math.round(scr * 1.2);
}
score = score + scr;
trace("GAME TIME = " + gameTime);
if ((level == 4) && (gameTime > 0)) {
com.king.util.SoundManager.play("gameCompleted", 100, false);
mcInfoSign.gotoAndStop(3);
mcInfoSign.txtRoundScore.text = scr;
mcInfoSign.txtTotalScore.text = score;
if (gotBonus) {
mcInfoSign.txtInfo.text = txtGotBonus;
} else {
mcInfoSign.txtInfo.text = txtNotGetBonus;
}
mcInfoSign._visible = true;
gameState = STATE_END_GAME;
} else if ((level == 2) && (userType == 0)) {
com.king.util.SoundManager.play("gameEnd", 100, false);
mcInfoSign.gotoAndStop(3);
mcInfoSign.txtRoundScore.text = scr;
mcInfoSign.txtTotalScore.text = score;
mcInfoSign.txtInfo.text = txtOpenUserEnd;
mcInfoSign._visible = true;
gameState = STATE_END_GAME;
} else if (gameTime <= 0) {
com.king.util.SoundManager.play("gameEnd", 100, false);
mcInfoSign.gotoAndStop(3);
mcInfoSign.txtRoundScore.text = scr;
mcInfoSign.txtTotalScore.text = score;
mcInfoSign.txtInfo.text = txtTimeUp;
mcInfoSign._visible = true;
gameState = STATE_END_GAME;
} else {
mcInfoSign.gotoAndStop(2);
if (gotBonus) {
mcInfoSign.txtInfo.text = txtGotBonus;
} else {
mcInfoSign.txtInfo.text = txtNotGetBonus;
}
mcInfoSign.txtRoundScore.text = scr;
mcInfoSign.txtTotalScore.text = score;
mcInfoSign._visible = true;
gameState = STATE_BETWEEN_ROUNDS;
}
}
function exitGamePressed() {
if (!gameStarted) {
communicator.startRound(currentTick, gameTime, clientVersion, 0);
} else if (gameState == STATE_PLAY_GAME) {
score = score + mcGame.lvlScore;
}
mcGame.exitGamePressed();
egp = true;
gamePreQuit();
}
function gamePreQuit() {
gameState = STATE_NOT_RUNNING;
communicator.gameLastTick(currentTick, gameTime);
communicator.gameEnd(score);
if (((level == 4) && (gameTime > 0)) && (egp == false)) {
var _local2 = 0;
while (_local2 < txtGratsText.length) {
var _local3 = attachMovie("JumpLetter", "jl_" + JLCounter, jlDepthCounter);
jlDepthCounter++;
JLCounter++;
jlArr.push(_local3);
var _local5 = txtGratsText;
var _local4 = _local5.slice(_local2, _local2 + 1);
_local3.init(_local4, _local2, txtGratsText.length);
_local2++;
}
mcInfoSign.gotoAndStop(4);
}
com.king.util.Delay.oneShot(this, gameQuit, 4000);
}
function gameQuit() {
communicator.gameQuit();
}
static var STATE_WAIT_FOR_GAMEDATA = 0;
static var STATE_SHOW_INFO_SCREEN = 1;
static var STATE_PLAY_GAME = 2;
static var STATE_BETWEEN_ROUNDS = 3;
static var STATE_END_GAME = 4;
static var STATE_NOT_RUNNING = 5;
static var TICKS_PER_SEC = 25;
static var GAME_PLAY_TIME = 220;
var soundOn = true;
var score = 0;
var gameTime = GAME_PLAY_TIME * TICKS_PER_SEC;
var level = 0;
var exitPressed = false;
var gameStarted = false;
var jlDepthCounter = 60000;
var JLCounter = 0;
var jlArr = new Array();
var egp = false;
var clientVersion = "2.06";
static var DEBUG_MODE = false;
static var DEBUG_GAME_DATA = "<gamedata randomseed=\"5\" timelimit=\"660\" lang=\"de\"><text id=\"game_starts_in\">The game starts in [0] seconds!</text><text id=\"game_next_screen\">Next info screen in [0] seconds!</text><text id=\"game_ends\">Game ends in [0] seconds!</text><text id=\"intro\">Try to create chains of same colored children. Once created, Trogdor will eat them and turn the left overs into bacon which u may bring back for extra bonus points. Cheer up :)</text><text id=\"open_user_end\">Register to play more.</text><text id=\"got_bonus\">Congratulations, you cleared the level and got the bonus.</text><text id=\"not_get_bonus\">Congrats, you cleared the lvl.</text><text id=\"time_up\">Time us up!</text><text id=\"exit_game\">EXIT GAME</text><text id=\"sound_on\">SOUND ON</text><text id=\"sound_off\">SOUND OFF</text><text id=\"round_score\">Round Score:</text><text id=\"total_score\">Total Score:</text><text id=\"congratulations\">Congratulation</text><userType id=\"0\">1</userType></gamedata>";
}
Symbol 1330 MovieClip [__Packages.com.king.timing.Timer] Frame 0
class com.king.timing.Timer
{
var timeable;
function Timer (timeable, gameTicksPerSecond) {
millisPerGameTick = 1000 / gameTicksPerSecond;
this.timeable = timeable;
maxTickTime = 500;
}
function getMillisPerTick() {
return(millisPerGameTick);
}
function setMaxTickTime(millis) {
maxTickTime = millis;
}
function advanceTime2() {
var _local3 = getTimer();
if (startTime < 0) {
startTime = _local3;
unprocessedTime = millisPerGameTick;
}
time = _local3 - startTime;
var _local5 = time - lastTime;
lastTime = time;
unprocessedTime = unprocessedTime + _local5;
if (unprocessedTime >= millisPerGameTick) {
var _local2 = maxTickTime + _local3;
do {
timeable.tick(tick);
tick++;
unprocessedTime = unprocessedTime - millisPerGameTick;
} while ((unprocessedTime >= millisPerGameTick) && (getTimer() < _local2));
}
var _local4 = (unprocessedTime % millisPerGameTick) / millisPerGameTick;
com.king.timing.IFloat.setAlpha(_local4);
timeable.render(tick, _local4);
}
function advanceTime() {
time = getTimer();
var _local3 = time - lastTime;
lastTime = time;
unprocessedTime = unprocessedTime + _local3;
var _local2 = 0;
while (unprocessedTime > millisPerGameTick) {
unprocessedTime = unprocessedTime - millisPerGameTick;
timeable.tick(tick);
tick++;
_local2++;
if (_local2 >= 10) {
unprocessedTime = 0;
}
}
var _local4 = unprocessedTime / millisPerGameTick;
timeable.render(tick, _local4);
}
var time = 0;
var startTime = -1;
var lastTime = 0;
var unprocessedTime = 0;
var tick = 0;
var millisPerGameTick = 0;
var maxTickTime = -1;
}
Symbol 1331 MovieClip [__Packages.com.king.util.Random] Frame 0
class com.king.util.Random
{
var mta, mti, lastSeed;
function Random (aSeed) {
mta = new Array(N);
mti = N + 1;
if (aSeed != undefined) {
init_genrand(aSeed);
}
}
function set seed(s) {
init_genrand(s);
//return(seed);
}
function get seed() {
return(lastSeed);
}
function nextInt(n) {
return((genrand_int32() & 2147483647) % n);
}
function nextFloat() {
return(next(24) / 16777216);
}
function next(bits) {
if (bits < 32) {
return(genrand_int32() & ((1 << bits) - 1));
}
return(genrand_int32());
}
function init_genrand(s) {
s = int(s);
var _local5 = getTimer();
lastSeed = s;
mta[0] = s;
var _local2 = s;
var _local3 = new com.king.util.Integer64();
mti = 1;
while (mti < N) {
_local3.init32((_local2 >>> 30) ^ _local2);
_local3.mulu32(1812433253);
_local2 = (mta[mti] = int(_local3.lsb + mti));
mti++;
}
var _local6 = getTimer();
}
function genrand_int32() {
var _local3 = 0;
if (mti >= N) {
if (mti == (N + 1)) {
init_genrand(5489);
}
var _local4 = getTimer();
var _local2 = 0;
_local2 = 0;
while (_local2 < (N - M)) {
_local3 = (mta[_local2] & UPPER_MASK) | (mta[_local2 + 1] & LOWER_MASK);
mta[_local2] = (mta[_local2 + M] ^ (_local3 >>> 1)) ^ mag01[_local3 & 1];
_local2++;
}
while (_local2 < (N - 1)) {
_local3 = (mta[_local2] & UPPER_MASK) | (mta[_local2 + 1] & LOWER_MASK);
mta[_local2] = (mta[_local2 + (M - N)] ^ (_local3 >>> 1)) ^ mag01[_local3 & 1];
_local2++;
}
_local3 = (mta[N - 1] & UPPER_MASK) | (mta[0] & LOWER_MASK);
mta[N - 1] = (mta[M - 1] ^ (_local3 >>> 1)) ^ mag01[_local3 & 1];
mti = 0;
var _local5 = getTimer();
}
_local3 = mta[mti++];
_local3 = _local3 ^ (_local3 >>> 11);
_local3 = _local3 ^ ((_local3 << 7) & 2636928640);
_local3 = _local3 ^ ((_local3 << 15) & 4022730752);
_local3 = _local3 ^ (_local3 >>> 18);
return(_local3);
}
static var N = 624;
static var M = 397;
static var MATRIX_A = 2567483615;
static var UPPER_MASK = 2147483648;
static var LOWER_MASK = 2147483647;
static var mag01 = [0, 2567483615];
}
Symbol 1332 MovieClip [__Packages.com.king.util.Integer64] Frame 0
class com.king.util.Integer64
{
var r, p, s;
function Integer64 (lowInt) {
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 (lowInt != undefined) {
merge(lowInt);
}
}
function init(v) {
var _local2 = 0;
while (_local2 < p.length) {
p[_local2] = v.p[_local2];
_local2++;
}
}
function init32(n) {
p[0] = n & 32767;
n = n >>> 15;
p[1] = n & 32767;
n = n >>> 15;
p[2] = n & 3;
p[3] = 0;
p[4] = 0;
}
function get lsb() {
return((p[0] | (p[1] << SH)) | ((p[2] & 3) << 30));
}
function get msb() {
return((((p[2] >> 2) | ((p[3] << SH) >> 2)) | ((p[4] << (SH * 2)) >> 2)) & 2147483647);
}
function binaryShiftLeft(step) {
var _local2 = 0;
while (_local2 < step) {
shl();
_local2++;
}
}
function binaryShiftRight(step) {
var _local4 = (step / SH) >> 0;
var _local5 = step - (_local4 * SH);
var _local2 = p.length - 1;
while (_local2 > 0) {
var _local3 = 0;
while (_local3 < _local4) {
p[_local3] = p[_local3 + 1];
_local3++;
}
p[_local2--] = 0;
}
if (_local5 > 0) {
var _local3 = 0;
while (_local3 < _local5) {
shr();
_local3++;
}
}
}
function binaryNot(o) {
p[0] = p[0] ^ o.p[0];
p[1] = p[1] ^ o.p[1];
p[2] = p[2] ^ o.p[2];
p[3] = p[3] ^ o.p[3];
p[4] = p[4] ^ o.p[4];
}
function add64(o) {
var _local4 = 0;
var _local3 = 1;
var _local2 = 0;
while ((_local3 < p.length) && (o.p[_local2] != 0)) {
_local3++;
}
_local2 = 0;
while (_local2 < _local3) {
_local4 = _local4 + (p[_local2] + o.p[_local2]);
p[_local2] = _local4 & MASK;
_local4 = _local4 >> SH;
_local2++;
}
}
function add32(num) {
var _local2 = 0;
var _local5 = num & MASK;
num = num >> SH;
var _local6 = num & MASK;
num = num >> SH;
var _local4 = num & 3;
_local2 = _local2 + (p[0] + _local5);
p[0] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (p[1] + _local6);
p[1] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (p[2] + _local4);
p[2] = _local2 & MASK;
}
function mulu32(num) {
var _local3 = 0;
s[0] = num & MASK;
num = num >>> 15;
s[1] = num & MASK;
num = num >>> 15;
s[2] = num & 3;
var _local2 = 0;
while (_local2 < 3) {
var _local4 = s[_local2];
_local3 = _local4 * p[0];
r[_local2][0] = _local3 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + (_local4 * p[1]);
r[_local2][1] = _local3 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + (_local4 * p[2]);
r[_local2][2] = _local3 & 3;
_local2++;
}
_local3 = r[0][0];
p[0] = _local3 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + (r[0][1] + r[1][0]);
p[1] = _local3 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + ((r[0][2] + r[1][1]) + r[2][0]);
p[2] = _local3 & 3;
p[3] = 0;
p[4] = 0;
}
function mul64(o) {
var _local2 = 0;
var _local3 = 0;
while (_local3 < 5) {
var _local4 = o.p[_local3];
_local2 = _local4 * p[0];
r[_local3][0] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[1]);
r[_local3][1] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[2]);
r[_local3][2] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[3]);
r[_local3][3] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[4]);
r[_local3][4] = _local2 & MASK;
_local3++;
}
_local2 = r[0][0];
p[0] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (r[0][1] + r[1][0]);
p[1] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + ((r[0][2] + r[1][1]) + r[2][0]);
p[2] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (((r[0][3] + r[1][2]) + r[2][1]) + r[3][0]);
p[3] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + ((((r[0][4] + r[1][3]) + r[2][2]) + r[3][1]) + r[4][0]);
p[4] = _local2 & 7;
}
function mul32(value) {
mul64(new com.king.util.Integer64(value));
}
function merge(a) {
var _local2 = 0;
while (_local2 < 3) {
p[_local2] = p[_local2] + (a & 32767);
a = a >>> 15;
_local2++;
}
return(a);
}
function shl() {
var _local5 = 0;
var _local4 = 0;
var _local2 = 0;
var _local3 = p.length;
while (_local2 < _local3) {
_local5 = (p[_local2] & 16384) >> 14;
p[_local2] = p[_local2] << 1;
p[_local2] = (p[_local2] | _local4) & 32767;
_local2++;
_local4 = _local5;
}
}
function shr() {
var _local4 = 0;
var _local3 = 0;
var _local2 = p.length - 1;
while (_local2 >= 0) {
_local4 = (p[_local2] & 1) << 14;
p[_local2] = p[_local2] >> 1;
p[_local2] = (p[_local2] | _local3) & 32767;
_local2--;
_local3 = _local4;
}
}
static var MASK = 32767;
static var SH = 15;
}
Symbol 1333 MovieClip [__Packages.com.king.FourSeasons.Star] Frame 0
class com.king.FourSeasons.Star extends MovieClip
{
var yFloat, xFloat, animCounter, endX, _x, endY, startX, startY, _y, _rotation, _xscale, _yscale, mcBonus, bLet, gotoAndStop, _parent, removeMovieClip;
function Star () {
super();
yFloat = new com.king.timing.IFloat();
xFloat = new com.king.timing.IFloat();
}
function tick(tick, tps) {
animCounter++;
if ((_x + 15) >= endX) {
xFloat.set(endX);
xFloat.set(endX);
yFloat.set(endY);
yFloat.set(endY);
endAnim();
} else {
var _local3 = (endX - startX) / 15;
var _local2 = (endY - startY) / _local3;
xFloat.set(_x + 15);
yFloat.set(_y + _local2);
if ((_x - startX) > ((endX - startX) / 2)) {
scaleMod = -2;
yMod = 0.5;
}
scale = Math.min(scale + scaleMod, 150);
}
}
function render(tick, alpha) {
_y = yFloat.get(alpha);
_x = xFloat.get(alpha);
_rotation = _rotation + 5;
_xscale = scale;
_yscale = scale;
mcBonus.gotoAndStop(animCounter % 10);
}
function init(x, y, type) {
_xscale = scale;
_yscale = scale;
bLet = type;
animCounter = 1;
trace(type);
gotoAndStop(type);
mcBonus.gotoAndStop(animCounter);
startX = x;
startY = y;
_y = y;
_x = x;
switch (type) {
case 1 :
endX = 660;
endY = 135;
break;
case 2 :
endX = 660;
endY = 165;
break;
case 3 :
endX = 660;
endY = 220;
break;
case 4 :
endX = 660;
endY = 265;
break;
case 5 :
endX = 660;
endY = 310;
}
yFloat.setTo(y);
xFloat.setTo(x);
}
function endAnim() {
_parent.showBonus(bLet - 1);
removeMovieClip();
}
var scale = 50;
var scaleMod = 10;
var yMod = 2;
}