Symbol 23 MovieClip Frame 1
stop();
Symbol 23 MovieClip Frame 2
stop();
Symbol 23 MovieClip Frame 3
stop();
Symbol 23 MovieClip Frame 4
stop();
Symbol 23 MovieClip Frame 5
stop();
Symbol 23 MovieClip Frame 6
stop();
Symbol 23 MovieClip Frame 7
play();
Symbol 23 MovieClip Frame 20
gotoAndPlay ("rulla");
Symbol 25 MovieClip Frame 1
stop();
Symbol 25 MovieClip Frame 10
stop();
Symbol 25 MovieClip Frame 20
stop();
Symbol 30 MovieClip Frame 1
stop();
Symbol 30 MovieClip Frame 10
stop();
Symbol 38 MovieClip Frame 1
play();
Symbol 38 MovieClip Frame 31
stop();
Symbol 39 MovieClip Frame 1
stop();
Symbol 39 MovieClip Frame 6
stop();
Symbol 39 MovieClip Frame 12
play();
Symbol 39 MovieClip Frame 86
stop();
Symbol 39 MovieClip Frame 99
play();
Symbol 39 MovieClip Frame 158
gotoAndPlay ("flyga");
Symbol 39 MovieClip Frame 165
play();
Symbol 39 MovieClip Frame 192
stop();
Symbol 39 MovieClip Frame 197
play();
Symbol 39 MovieClip Frame 214
stop();
Symbol 44 MovieClip Frame 5
stop();
Symbol 48 MovieClip Frame 1
play();
Symbol 48 MovieClip Frame 15
gotoAndPlay (1);
Symbol 51 MovieClip Frame 1
stop();
Symbol 51 MovieClip Frame 10
stop();
Symbol 53 MovieClip Frame 1
stop();
Symbol 53 MovieClip Frame 26
stop();
Symbol 63 MovieClip Frame 1
stop();
Symbol 63 MovieClip Frame 2
stop();
Symbol 63 MovieClip Frame 3
stop();
Symbol 63 MovieClip Frame 4
stop();
Symbol 63 MovieClip Frame 5
stop();
Symbol 63 MovieClip Frame 6
stop();
Symbol 63 MovieClip Frame 7
stop();
Symbol 65 MovieClip Frame 1
stop();
Symbol 65 MovieClip Frame 6
stop();
Symbol 65 MovieClip Frame 11
play();
Symbol 65 MovieClip Frame 70
gotoAndPlay ("flyga");
Symbol 65 MovieClip Frame 77
play();
Symbol 65 MovieClip Frame 104
stop();
Symbol 65 MovieClip Frame 110
play();
Symbol 65 MovieClip Frame 127
stop();
Symbol 66 MovieClip Frame 1
stop();
Symbol 66 MovieClip Frame 26
stop();
Symbol 70 MovieClip Frame 1
stop();
Symbol 70 MovieClip Frame 6
stop();
Symbol 70 MovieClip Frame 11
play();
Symbol 70 MovieClip Frame 70
gotoAndPlay ("flyga");
Symbol 70 MovieClip Frame 77
play();
Symbol 70 MovieClip Frame 104
stop();
Symbol 70 MovieClip Frame 110
play();
Symbol 70 MovieClip Frame 127
stop();
Symbol 71 MovieClip Frame 1
stop();
Symbol 71 MovieClip Frame 26
stop();
Symbol 75 MovieClip Frame 1
stop();
Symbol 75 MovieClip Frame 6
stop();
Symbol 75 MovieClip Frame 11
play();
Symbol 75 MovieClip Frame 70
gotoAndPlay ("flyga");
Symbol 75 MovieClip Frame 77
play();
Symbol 75 MovieClip Frame 104
stop();
Symbol 75 MovieClip Frame 110
play();
Symbol 75 MovieClip Frame 127
stop();
Symbol 76 MovieClip Frame 1
stop();
Symbol 76 MovieClip Frame 26
stop();
Symbol 80 MovieClip Frame 1
stop();
Symbol 80 MovieClip Frame 6
stop();
Symbol 80 MovieClip Frame 11
play();
Symbol 80 MovieClip Frame 70
gotoAndPlay ("flyga");
Symbol 80 MovieClip Frame 77
play();
Symbol 80 MovieClip Frame 104
stop();
Symbol 80 MovieClip Frame 110
play();
Symbol 80 MovieClip Frame 127
stop();
Symbol 81 MovieClip [TheBugs] Frame 1
#initclip 23
Object.registerClass("TheBugs", com.king.bugs.TheBugs);
#endinitclip
Symbol 86 MovieClip Frame 1
play();
Symbol 86 MovieClip Frame 40
gotoAndPlay ("anim");
Symbol 91 MovieClip Frame 1
play();
Symbol 91 MovieClip Frame 49
stop();
Symbol 92 MovieClip Frame 1
stop();
Symbol 92 MovieClip Frame 10
play();
Symbol 92 MovieClip Frame 65
stop();
Symbol 92 MovieClip Frame 66
play();
Symbol 92 MovieClip Frame 117
stop();
Symbol 92 MovieClip Frame 118
play();
Symbol 92 MovieClip Frame 162
stop();
Symbol 92 MovieClip Frame 163
play();
Symbol 92 MovieClip Frame 201
stop();
Symbol 92 MovieClip Frame 202
play();
Symbol 92 MovieClip Frame 234
stop();
Symbol 92 MovieClip Frame 317
stop();
Symbol 92 MovieClip Frame 393
stop();
Symbol 92 MovieClip Frame 467
stop();
Symbol 92 MovieClip Frame 533
stop();
Symbol 92 MovieClip Frame 581
stop();
Symbol 93 MovieClip [LifeBar] Frame 1
#initclip 20
Object.registerClass("LifeBar", com.king.bugs.LifeBar);
#endinitclip
stop();
Symbol 105 MovieClip Frame 1
play();
Symbol 105 MovieClip Frame 74
gotoAndPlay (1);
Symbol 108 MovieClip Frame 1
stop();
Symbol 108 MovieClip Frame 91
stop();
Symbol 127 MovieClip Frame 1
stop();
Symbol 127 MovieClip Frame 2
stop();
Symbol 127 MovieClip Frame 3
stop();
Symbol 127 MovieClip Frame 4
stop();
Symbol 127 MovieClip Frame 5
stop();
Symbol 127 MovieClip Frame 6
stop();
Symbol 127 MovieClip Frame 7
stop();
Symbol 127 MovieClip Frame 8
stop();
Symbol 127 MovieClip Frame 9
stop();
Symbol 127 MovieClip Frame 10
stop();
Symbol 127 MovieClip Frame 11
stop();
Symbol 127 MovieClip Frame 12
stop();
Symbol 127 MovieClip Frame 13
stop();
Symbol 127 MovieClip Frame 14
stop();
Symbol 127 MovieClip Frame 15
stop();
Symbol 127 MovieClip Frame 16
stop();
Symbol 127 MovieClip Frame 17
stop();
Symbol 127 MovieClip Frame 18
stop();
Symbol 127 MovieClip Frame 19
stop();
Symbol 127 MovieClip Frame 20
stop();
Symbol 127 MovieClip Frame 21
stop();
Symbol 127 MovieClip Frame 22
stop();
Symbol 127 MovieClip Frame 23
stop();
Symbol 127 MovieClip Frame 24
stop();
Symbol 127 MovieClip Frame 25
stop();
Symbol 127 MovieClip Frame 26
stop();
Symbol 127 MovieClip Frame 27
stop();
Symbol 127 MovieClip Frame 28
stop();
Symbol 134 MovieClip Frame 1
stop();
Symbol 134 MovieClip Frame 10
stop();
Symbol 134 MovieClip Frame 20
stop();
Symbol 134 MovieClip Frame 30
stop();
Symbol 135 MovieClip [Game] Frame 1
#initclip 21
Object.registerClass("Game", com.king.bugs.Game);
#endinitclip
Symbol 147 MovieClip Frame 1
stop();
Symbol 147 MovieClip Frame 5
stop();
Symbol 153 MovieClip Frame 1
stop();
Symbol 165 MovieClip Frame 1
stop();
Symbol 165 MovieClip Frame 2
stop();
Symbol 169 MovieClip Frame 1
stop();
Symbol 169 MovieClip Frame 2
stop();
Symbol 172 MovieClip Frame 1
stop();
Symbol 172 MovieClip Frame 2
stop();
Symbol 175 MovieClip Frame 1
stop();
Symbol 175 MovieClip Frame 2
stop();
Symbol 179 MovieClip Frame 1
stop();
Symbol 179 MovieClip Frame 2
stop();
Symbol 185 MovieClip Frame 1
stop();
Symbol 185 MovieClip Frame 10
stop();
Symbol 202 MovieClip Frame 198
stop();
Symbol 203 MovieClip [Bugs] Frame 1
#initclip 22
Object.registerClass("Bugs", com.king.bugs.Bugs);
#endinitclip
stop();
Symbol 204 MovieClip [__Packages.com.king.bugs.LifeBar] Frame 0
class com.king.bugs.LifeBar extends MovieClip
{
var updatingBar, now, startTimer, timeLeft, lastTime, playerLastLife, playerLife, animTime, gotoAndStop, lifeSurplus, updateScore, _parent;
function LifeBar () {
super();
updatingBar = false;
}
function onEnterFrame() {
if (updatingBar) {
now = getTimer() - startTimer;
timeLeft = timeLeft - (now - lastTime);
if (playerLife < playerLastLife) {
trace("life DEcreasing");
var _local4 = (playerLastLife - playerLife) / animTime;
var _local3 = Math.round(101 - (playerLastLife - (_local4 * (animTime - timeLeft))));
if (_local3 >= (100 - playerLife)) {
_local3 = 101 - playerLife;
updatingBar = false;
}
(gotoAndStop(_local3));// not popped
} else if ((playerLife > playerLastLife) || (lifeSurplus > 0)) {
trace("life increasing");
var _local4 = (playerLife - playerLastLife) / animTime;
var _local3 = Math.round((101 - playerLastLife) - (_local4 * (animTime - timeLeft)));
if (_local3 <= (101 - playerLife)) {
_local3 = 101 - playerLife;
updatingBar = false;
lifeBoostSurplus();
}
(gotoAndStop(_local3));// not popped
}
lastTime = now;
}
if (updateScore) {
now = getTimer() - startTimer;
_parent.txtScoreTotal.text = Math.round(_root.mcBugs.playerScoreTotal + ((lifeSurplus * (now / animTime)) * 10));
if (Number(_parent.txtScoreTotal.text) >= (_root.mcBugs.playerScoreTotal + (lifeSurplus * 10))) {
updateScore = false;
_parent.txtScoreTotal.text = _root.mcBugs.playerScoreTotal + (lifeSurplus * 10);
_root.mcBugs.playerScoreTotal = _root.mcBugs.playerScoreTotal + (lifeSurplus * 10);
}
}
}
function updateBar(life, lastLife, extraLife) {
playerLife = life;
playerLastLife = lastLife;
lifeSurplus = extraLife;
updatingBar = true;
updateScore = false;
startTimer = getTimer();
animTime = 1000;
timeLeft = animTime;
lastTime = 0;
}
function lifeBoostSurplus() {
updateScore = true;
startTimer = getTimer() - 1;
animTime = 1000;
timeLeft = animTime;
lastTime = 0;
}
}
Symbol 205 MovieClip [__Packages.com.king.bugs.Game] Frame 0
class com.king.bugs.Game extends MovieClip
{
var gameState, bgCount, rewinding, delay, mcBackGround, waitTime, now, startTimer, lastTime, readyTime, mcStartLight, random, goTime, yellowLight, reactionTimer, startJump, bgSpeed, player, camTarget, bromsStracka, theoreticalEndPos, bugsStartPosY, time, perc, decelTime, accelTime, speed, maxSpeed, accel, pos, lastPos, increase, bgMaxDrop, bugsEndPosY, _parent, playerLife, timeLeft, bgPlace, rewindClear, lastBgPlace, lifeBoostingClear, level, maxLevels, minDecelSpeedFactor, jumpIsOver, attachMovie, getNextHighestDepth;
function Game () {
super();
gameState = STATE_NOT_RUNNING;
bgCount = 0;
rewinding = false;
delay = new com.king.util.Delay();
mcBackGround.mcEndGame._visible = false;
}
function onEnterFrame() {
switch (gameState) {
case STATE_NOT_RUNNING :
break;
case STATE_INTRO :
break;
case STATE_RUNNING :
if (waitTime > 0) {
now = getTimer() - startTimer;
waitTime = waitTime - (now - lastTime);
lastTime = now;
if (waitTime <= 0) {
com.king.bugs.SoundManager.play("countdown", 60);
}
} else if (readyTime > 0) {
now = getTimer() - startTimer;
readyTime = readyTime - (now - lastTime);
lastTime = now;
mcStartLight.gotoAndStop("ready");
if (random.nextInt(100) < 5) {
bugsArr[random.nextInt(3)].mcBug.mcEyes.mcPupil.gotoAndStop(random.nextInt(6) + 1);
}
}
if ((readyTime <= 0) && (goTime > 0)) {
if (yellowLight) {
com.king.bugs.SoundManager.play("countdown", 60);
mcStartLight.gotoAndStop("steady");
yellowLight = false;
}
now = getTimer() - startTimer;
goTime = goTime - (now - lastTime);
lastTime = now;
if (goTime <= 0) {
startTimer = getTimer();
reactionTimer = getTimer();
startJump = true;
com.king.bugs.SoundManager.play("start", 85);
mcStartLight.gotoAndStop("GO");
}
if (random.nextInt(100) < 8) {
bugsArr[random.nextInt(3)].mcBug.mcEyes.mcPupil.gotoAndStop(random.nextInt(6) + 1);
}
var _local2 = 1;
while (_local2 < 4) {
if (bugsArr[_local2].falseStart && (goTime <= bugsArr[_local2].startTime)) {
bugsArr[_local2].mcFalseStart._visible = true;
bugsArr[_local2].mcBug._visible = false;
bugsArr[_local2].landed = true;
bugsArr[_local2].falseStart = false;
bugsArr[_local2].startTime = 9999999 /* 0x98967F */;
com.king.bugs.SoundManager.play("falseStart");
bugsArr[_local2].mcFalseStart.gotoAndPlay(1);
}
_local2++;
}
}
if (startJump) {
now = getTimer() - startTimer;
bgSpeed = 0;
if (camTarget != player) {
if (((camTarget.startTime < now) && (camTarget.jumping == false)) && (camTarget.landed == false)) {
camTarget.jumping = true;
camTarget.jumpAccel = true;
camTarget.mcBug.gotoAndStop("med");
camTarget.mcBug.mcEyes.gotoAndStop("blink");
com.king.bugs.SoundManager.play("falling", 30);
}
if ((((camTarget._y - bugsStartPosY) - mcBackGround._y) > ((theoreticalEndPos - bromsStracka) + camTarget.decelDelay)) && (camTarget.jumpDecel == false)) {
camTarget.jumping = true;
camTarget.jumpAccel = false;
camTarget.jumpMaxSpeed = false;
camTarget.jumpDecel = true;
camTarget.startTime = now;
camTarget.yPos = camTarget._y;
camTarget.decelLastPos = camTarget._y;
camTarget.mcBug.seed.gotoAndStop("ut");
camTarget.mcBug.seed2.gotoAndStop("ut");
camTarget.mcBug.mcEyes.gotoAndStop("normal");
}
} else if (((now > 5000) && (camTarget.jumping == false)) && (camTarget.landed == false)) {
camTarget.jumping = true;
camTarget.jumpAccel = true;
camTarget.startTime = getTimer() - startTimer;
camTarget.mcBug.gotoAndStop("med");
camTarget.mcBug.mcEyes.gotoAndStop("blink");
}
if (camTarget.jumping) {
time = now - camTarget.startTime;
if (camTarget.jumpDecel) {
perc = Math.min(time / decelTime, 0.8);
} else {
perc = Math.min(time / accelTime, 1);
}
speed = maxSpeed * perc;
accel = speed / time;
if ((perc < 1) && (camTarget.jumpAccel)) {
pos = bugsStartPosY + ((0 + (0 * time)) + ((accel * (time * time)) / 2));
lastPos = camTarget._y;
increase = pos - lastPos;
mcBackGround.mcBgBlur._alpha = 0;
} else if ((perc >= 0) && (camTarget.jumpDecel)) {
camTarget.mcBug.seed.gotoAndStop("ut");
camTarget.mcBug.seed2.gotoAndStop("ut");
pos = camTarget.yPos + ((0 + (0 * time)) + ((accel * (time * time)) / 2));
if (perc >= 0.8) {
increase = (maxSpeed * (now - lastTime)) - (speed * (now - lastTime));
} else {
increase = (maxSpeed * (now - lastTime)) - (pos - camTarget.decelLastPos);
}
bgSpeed = increase;
camTarget.decelLastPos = pos;
mcBackGround.mcBgBlur._alpha = 0;
} else {
mcBackGround.mcBgBlur._alpha = 100;
camTarget.jumpMaxSpeed = true;
increase = speed * (now - lastTime);
if ((mcBackGround._y + bgMaxDrop) > 0) {
bgSpeed = increase;
}
}
if (((mcBackGround._y - bgSpeed) + bgMaxDrop) < 0) {
mcBackGround._y = bgMaxDrop * -1;
}
if ((mcBackGround._y + bgMaxDrop) <= 0) {
bgSpeed = 0;
}
if ((camTarget._y + (increase - bgSpeed)) > bugsEndPosY) {
mcBackGround.mcBgBlur._alpha = 0;
camTarget._y = bugsEndPosY;
camTarget.jumping = false;
placeArr.push(camTarget.bug);
camTarget.mcPlaceNums.gotoAndStop(placeArr.length);
camTarget.landed = true;
camTarget.mcBug.gotoAndPlay("landa");
if (camTarget == player) {
calcDamage(perc);
_parent.updateLife(playerLife);
}
}
if ((bugsEndPosY - camTarget._y) <= 0) {
increase = 0;
}
mcBackGround._y = mcBackGround._y - bgSpeed;
mcStartLight._y = mcStartLight._y - bgSpeed;
camTarget._y = camTarget._y + (increase - bgSpeed);
}
var _local2 = 0;
while (_local2 < bugsArr.length) {
if (bugsArr[_local2] != camTarget) {
if (((((now > bugsArr[_local2].startTime) && (bugsArr[_local2].jumping == false)) && (bugsArr[_local2].jumpAccel == false)) && (bugsArr[_local2].jumpMaxSpeed == false)) && (bugsArr[_local2].jumpDecel == false)) {
bugsArr[_local2].jumping = true;
bugsArr[_local2].jumpAccel = true;
bugsArr[_local2].mcBug.gotoAndStop("med");
bugsArr[_local2].mcBug.mcEyes.gotoAndStop("blink");
}
if ((((bugsArr[_local2]._y - bugsStartPosY) - mcBackGround._y) > ((theoreticalEndPos - bromsStracka) + bugsArr[_local2].decelDelay)) && (bugsArr[_local2].jumpDecel == false)) {
bugsArr[_local2].jumping = true;
bugsArr[_local2].jumpAccel = false;
bugsArr[_local2].jumpMaxSpeed = false;
bugsArr[_local2].jumpDecel = true;
bugsArr[_local2].startTime = now;
bugsArr[_local2].yPos = bugsArr[_local2]._y;
bugsArr[_local2].decelLastPos = bugsArr[_local2]._y;
bugsArr[_local2].mcBug.seed.gotoAndStop("ut");
bugsArr[_local2].mcBug.seed2.gotoAndStop("ut");
bugsArr[_local2].mcBug.mcEyes.gotoAndStop("normal");
bugsArr[_local2].mcBug.gotoAndPlay("flyga");
}
if ((bugsArr[_local2]._y >= (bugsEndPosY + (bgMaxDrop + mcBackGround._y))) && (bugsArr[_local2].jumping == true)) {
bugsArr[_local2].jumping = false;
bugsArr[_local2].landed = true;
placeArr.push(_local2);
bugsArr[_local2].mcPlaceNums.gotoAndStop(placeArr.length);
bugsArr[_local2].mcBug.gotoAndPlay("landaSoft");
if (random.nextInt(2) > 0) {
bugsArr[_local2].mcBug.mcDust.gotoAndPlay("start");
} else {
var _local3 = new Color(bugsArr[_local2].mcBug.mcDust);
var _local4 = {ra:204, ga:102, ba:0};
_local3.setTransform(_local4);
bugsArr[_local2].mcBug.mcDust.gotoAndPlay("start");
}
}
if (bugsArr[_local2]._y >= (bugsEndPosY + (bgMaxDrop + mcBackGround._y))) {
bugsArr[_local2]._y = bugsEndPosY + (bgMaxDrop + mcBackGround._y);
} else if (bugsArr[_local2].jumping == true) {
time = now - bugsArr[_local2].startTime;
if (bugsArr[_local2].jumpDecel) {
perc = Math.min(time / decelTime, 0.8);
} else {
perc = Math.min(time / accelTime, 1);
}
speed = maxSpeed * perc;
accel = speed / time;
if ((perc < 1) && (bugsArr[_local2].jumpAccel)) {
pos = (bugsStartPosY + ((0 + (0 * time)) + ((accel * (time * time)) / 2))) + mcBackGround._y;
lastPos = bugsArr[_local2]._y;
increase = pos - lastPos;
} else if ((perc >= 0) && bugsArr[_local2].jumpDecel) {
pos = bugsArr[_local2].yPos + ((0 + (0 * time)) + ((accel * (time * time)) / 2));
if (perc >= 0.8) {
increase = (maxSpeed * (now - lastTime)) - (speed * (now - lastTime));
} else {
increase = (maxSpeed * (now - lastTime)) - (pos - bugsArr[_local2].decelLastPos);
}
bugsArr[_local2].decelLastPos = pos;
} else {
increase = speed * (now - lastTime);
bugsArr[_local2].jumpAccel = false;
}
if (bugsArr[_local2].jumpAccel && (bgSpeed == 0)) {
bugsArr[_local2]._y = bugsArr[_local2]._y + increase;
} else {
bugsArr[_local2]._y = bugsArr[_local2]._y + (increase - bgSpeed);
}
} else {
bugsArr[_local2]._y = bugsStartPosY + mcBackGround._y;
}
}
_local2++;
}
lastTime = now;
_local2 = 0;
while (_local2 < bugsArr.length) {
if (bugsArr[_local2].landed) {
startJump = false;
} else {
startJump = true;
_local2 = bugsArr.length;
}
_local2++;
}
} else if (goTime <= 0) {
gameState = STATE_NOT_RUNNING;
com.king.util.Delay.oneShot(this, jumpOver, 500);
}
break;
case STATE_REWIND :
now = getTimer() - startTimer;
timeLeft = timeLeft - (now - lastTime);
lastTime = now;
bgPlace = Math.round(((-bgMaxDrop) / 3000) * timeLeft);
if ((timeLeft < 2550) && (rewindClear == false)) {
clearBoard();
setBugs(lastBgPlace);
_parent.lifeBoost();
rewindClear = true;
} else if ((timeLeft < 1800) && (lifeBoostingClear == false)) {
lifeBoostingClear = true;
_parent.updateLife(_parent.playerLife);
bgCount++;
mcBackGround.gotoAndStop(bgCount);
}
if (bgPlace > 0) {
bgPlace = 0;
rewinding = false;
_parent.mcClickArea._visible = true;
waitTime = 500;
gameState = STATE_RUNNING;
}
if (bgPlace > -200) {
_parent.txtInfo = "";
}
mcBackGround._y = bgPlace;
mcStartLight._y = bgPlace + 260;
var _local2 = 0;
while (_local2 < 4) {
bugsArr[_local2]._y = bugsArr[_local2]._y + (bgPlace - lastBgPlace);
_local2++;
}
lastBgPlace = bgPlace;
}
}
function startRound(rnd, lvl, life, league, mxLvl) {
random = rnd;
level = lvl;
waitTime = 1500;
readyTime = 1500;
goTime = random.nextInt(2500) + 500;
startTimer = getTimer();
lastTime = 0;
maxLevels = mxLvl;
mcStartLight.gotoAndStop("inaktiv");
startJump = false;
yellowLight = true;
bgSpeed = 0;
maxSpeed = 0.6;
accelTime = 600;
decelTime = 1100;
bgMaxDrop = 1340;
bugsStartPosY = 125;
bugsEndPosY = 370;
minDecelSpeedFactor = 0.2;
playerLife = life;
jumpIsOver = false;
if ((level == 1) && (league == 1)) {
setBugs(0);
} else {
rewind();
}
bromsStracka = ((maxSpeed / decelTime) * (decelTime * decelTime)) / 2;
theoreticalEndPos = (bugsEndPosY - bugsStartPosY) + bgMaxDrop;
if ((level == 1) && (league == 1)) {
gameState = STATE_RUNNING;
}
}
function endRound() {
_parent.endRound(placeArr, playerLife);
}
function clearBoard() {
var _local2 = 0;
while (_local2 < 4) {
bugsArr[_local2].removeMovieClip();
_local2++;
}
bugsArr = [];
placeArr = [];
}
function setBugs(yDiff) {
var _local6 = -1;
if (((random.nextInt(100) <= 15) && (level > 1)) && (level != _parent.maxLevel)) {
_local6 = random.nextInt(4) + 1;
_local6 = 1;
}
var _local2 = 0;
while (_local2 < 4) {
var _local4 = attachMovie("TheBugs", "bug_" + _local2, getNextHighestDepth());
bugsArr[_local2] = _local4;
var _local5 = (random.nextInt(80) - 40) + (15 * level);
var _local3 = Math.max((random.nextInt(500) + 300) - (50 * level), 0);
if (level == maxLevels) {
_local3 = Math.max((random.nextInt(350) + 200) - (50 * level), 0);
}
if (_local6 == _local2) {
_local3 = random.nextInt(goTime - 50);
}
if ((level == maxLevels) && (_local2 > 0)) {
_local4.init(5, _local2, PLAYER_NUM, _local3, bugsStartPosY + yDiff, _local5, _local6, level);
_local2 = 4;
} else {
_local4.init(_local2 + 1, _local2, PLAYER_NUM, _local3, bugsStartPosY + yDiff, _local5, _local6, level);
}
_local2++;
}
camTarget = bugsArr[PLAYER_NUM];
player = bugsArr[PLAYER_NUM];
}
function rewind() {
_parent.mcClickArea._visible = false;
startTimer = getTimer();
lastTime = 0;
timeLeft = 3000;
lastBgPlace = -bgMaxDrop;
rewindClear = false;
lifeBoostingClear = false;
rewinding = true;
gameState = STATE_REWIND;
}
function showPlaces() {
var _local2 = 0;
while (_local2 < 4) {
bugsArr[placeArr[_local2]].mcPlaceNums.gotoAndStop(_local2 + 1);
_local2++;
}
}
function jumpOver() {
jumpIsOver = true;
endRound();
}
function calcDamage(dmg) {
var _local2 = dmg;
if (_local2 < 1) {
_local2 = ((1 - _local2) - 0.2) * 1;
} else {
_local2 = 1;
}
playerLife = playerLife - Math.round(100 * _local2);
if (_local2 >= 0.3) {
player.mcBug.gotoAndPlay("landaMedium");
var _local3 = new Color(player.mcBug.mcDust);
if (_local2 >= 0.5) {
com.king.bugs.SoundManager.play("skada=med");
var _local4 = {ra:153, ga:0, ba:0};
} else {
com.king.bugs.SoundManager.play("skada=max");
var _local4 = {ra:204, ga:102, ba:0};
}
_local3.setTransform(_local4);
player.mcBug.mcDust.gotoAndPlay("start");
} else {
com.king.bugs.SoundManager.play("skada=min");
player.mcBug.gotoAndPlay("landaSoft");
player.mcBug.mcDust.gotoAndPlay("start");
}
if (playerLife <= 0) {
com.king.bugs.SoundManager.stop("loop");
com.king.bugs.SoundManager.play("krasch");
player.mcBug.gotoAndPlay("krasch");
}
}
static var STATE_NOT_RUNNING = 0;
static var STATE_RUNNING = 1;
static var STATE_INTRO = 2;
static var STATE_REWIND = 3;
static var PLAYER_NUM = 0;
var bugsArr = new Array();
var placeArr = new Array();
var pointsArr = new Array();
var blur = false;
}
Symbol 206 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 207 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 208 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 209 MovieClip [__Packages.com.king.util.Iterator] Frame 0
interface com.king.util.Iterator
{
}
Symbol 210 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 211 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 212 MovieClip [__Packages.com.king.bugs.SoundManager] Frame 0
class com.king.bugs.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.bugs.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.bugs.SoundManager.sounds.get(resource);
_local1.playStatus = false;
com.king.bugs.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 213 MovieClip [__Packages.com.king.bugs.Bugs] Frame 0
class com.king.bugs.Bugs extends MovieClip
{
var mcGame, mcScoreBoard, playerWon, txtInfo, txtLevelCount, txtStartCount, txtClickCont, level, league, leaguesPerLevel, maxLevel, playerLife, playerLastLife, playerScoreTotal, soundOn, healthPills, lastHealthCheck, communicator, delay, mcClickArea, mcIntroScreen, mcExitGame, mcSoundToggle, mcBlue, frames, lastFps, gameState, fpsTimer, fps, txtFPS, random, mcInfo, mcGameOver, now, startTimer, timeLeft, lastTime, introTime, mcIntro, cntTime, playerPlace, getURL, lifeSurplus;
function Bugs () {
super();
mcGame.mcStartLight._visible = false;
mcScoreBoard._visible = false;
playerWon = false;
txtInfo = "";
txtLevelCount = "";
txtStartCount = "";
txtClickCont = "";
level = 1;
league = 0;
leaguesPerLevel = 4;
maxLevel = 5;
playerLife = 100;
playerLastLife = 100;
playerScoreTotal = 0;
mcScoreBoard.txtScoreTotal.text = 0;
soundOn = true;
placeScoresArr[0] = 400;
placeScoresArr[1] = 280;
placeScoresArr[2] = 160;
placeScoresArr[3] = 80;
placeScoresArr[4] = 80;
bugsScoreArr[0] = mcScoreBoard.mcScoreBug_1;
bugsScoreArr[1] = mcScoreBoard.mcScoreBug_2;
bugsScoreArr[2] = mcScoreBoard.mcScoreBug_3;
bugsScoreArr[3] = mcScoreBoard.mcScoreBug_4;
bugsScorePosArr[0] = bugsScoreArr[0]._y;
bugsScorePosArr[1] = bugsScoreArr[1]._y;
bugsScorePosArr[2] = bugsScoreArr[2]._y;
bugsScorePosArr[3] = bugsScoreArr[3]._y;
healthPills = 0;
lastHealthCheck = 0;
communicator = new com.king.bugs.Communicator();
delay = new com.king.util.Delay();
mcClickArea.onPress = function () {
this._parent.clickArea();
};
mcIntroScreen.mcStartBug.onRollOver = function () {
this._yscale = 110;
this._xscale = 110;
};
mcIntroScreen.mcStartBug.onRollOut = function () {
this._yscale = 100;
this._xscale = 100;
};
mcIntroScreen.mcStartBug.onDragOut = function () {
this._yscale = 100;
this._xscale = 100;
};
mcIntroScreen.mcStartBug.onPress = function () {
if (_root.mcBugs.timeLeft < 6) {
_root.mcBugs.timeLeft = 0;
}
};
mcExitGame.onRollOver = function () {
this.mcPlay._height = this.mcPlay._height + 3;
this.mcPlay._width = this.mcPlay._width + 3;
};
mcExitGame.onRollOut = function () {
this.mcPlay._height = this.mcPlay._height - 3;
this.mcPlay._width = this.mcPlay._width - 3;
};
mcExitGame.onDragOut = function () {
this.mcPlay._height = this.mcPlay._height - 3;
this.mcPlay._width = this.mcPlay._width - 3;
};
mcSoundToggle.onRollOver = function () {
this.mcSound._height = this.mcSound._height + 4;
this.mcSound._width = this.mcSound._width + 4;
};
mcSoundToggle.onRollOut = function () {
this.mcSound._height = this.mcSound._height - 4;
this.mcSound._width = this.mcSound._width - 4;
};
mcSoundToggle.onDragOut = function () {
this.mcSound._height = this.mcSound._height - 4;
this.mcSound._width = this.mcSound._width - 4;
};
mcExitGame.onPress = function () {
if (this._parent.gameState != com.king.bugs.Bugs.STATE_GAME_OVER) {
this._parent.gameOver();
}
};
mcSoundToggle.onPress = function () {
com.king.bugs.SoundManager.toggleSound();
if (this._parent.soundOn) {
this.mcSound.gotoAndStop("off");
this.txtSoundToggle.text = _global.textMappings.sound_on;
this._parent.soundOn = false;
} else {
this.mcSound.gotoAndStop("on");
this.txtSoundToggle.text = _global.textMappings.sound_off;
this._parent.soundOn = true;
}
};
mcBlue._visible = false;
frames = 0;
lastFps = 0;
gameState = STATE_WAIT_FOR_GAMEDATA;
}
function onEnterFrame() {
fpsTimer = getTimer();
frames++;
if ((fpsTimer - lastFps) > 250) {
fps = (1000 / (fpsTimer - lastFps)) * frames;
txtFPS.text = Math.round(fps);
frames = 0;
lastFps = fpsTimer;
}
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(Math.random(10000));
mcIntroScreen.txtIntroText.text = _global.textMappings.intro_info;
mcIntroScreen.txtClickCont.text = _global.textMappings.click_to_contineu;
mcScoreBoard.txtTotalScoreTitle.text = _global.textMappings.total_score;
mcInfo.mcNextLevel.txtInfo.text = _global.textMappings.next_level;
mcGameOver.txtGameOver.text = _global.textMappings.game_over;
mcGameOver.txtYourScore.text = _global.textMappings.your_score;
mcGameOver.txtClickToEnd.text = _global.textMappings.click_to_end;
mcExitGame.txtExitGame.text = _global.textMappings.exit_game;
mcSoundToggle.txtSoundToggle.text = _global.textMappings.sound_off;
showInfoScreen();
}
break;
case STATE_SHOW_INFO_SCREEN :
now = getTimer() - startTimer;
timeLeft = timeLeft - ((now - lastTime) / 1000);
introTime = introTime - (now - lastTime);
lastTime = now;
var _local4 = Math.round(0.0495 * (4000 - introTime));
txtStartCount = _global.textMappings.game_start_count.split("[0]").join("" + Math.round(timeLeft));
if (timeLeft < 0) {
timeLeft = 0;
}
mcIntroScreen.txtCountDown.text = Math.round(timeLeft);
if (timeLeft <= 0) {
mcIntro.gotoAndStop("end");
txtStartCount = "";
com.king.bugs.SoundManager.stop("intro");
com.king.bugs.SoundManager.play("loop", 50, true);
startGame();
} else {
mcIntro.gotoAndStop(_local4);
}
break;
case STATE_PLAY_GAME :
break;
case STATE_BETWEEN_ROUNDS :
now = getTimer() - startTimer;
timeLeft = timeLeft - ((now - lastTime) / 1000);
lastTime = now;
txtLevelCount = _global.textMappings.level_count.split("[0]").join("" + Math.round(timeLeft));
if (timeLeft > 8) {
mcClickArea._visible = false;
} else {
mcClickArea._visible = true;
txtClickCont = _global.textMappings.click_to_contineu;
}
if (timeLeft <= 0) {
txtLevelCount = "";
if ((league == leaguesPerLevel) && (playerLife > 0)) {
var _local5 = new mx.transitions.Tween(mcInfo.mcNextLevel, "_y", mx.transitions.easing.Elastic.easeInOut, mcInfo.mcNextLevel._y, mcInfo.mcNextLevel._y - 360, 1.5, true);
}
startGame();
}
break;
case STATE_GAME_OVER :
now = getTimer() - startTimer;
timeLeft = timeLeft - ((now - lastTime) / 1000);
lastTime = now;
mcGameOver.txtGameEnds.text = _global.textMappings.game_ends_in.split("[0]").join("" + Math.round(timeLeft));
if (timeLeft <= 0) {
gamePreQuit();
}
break;
case STATE_GAME_WON :
now = getTimer() - startTimer;
timeLeft = timeLeft - ((now - lastTime) / 1000);
lastTime = now;
if (timeLeft < 0) {
gameState = STATE_NOT_RUNNING;
mcGame.clearBoard();
mcGame.mcBackGround.mcEndGame._visible = true;
mcGame.mcBackGround.mcEndGame.gotoAndPlay(1);
gameOver();
}
break;
case STATE_NOT_RUNNING :
}
}
function showInfoScreen() {
resetScoreBoard();
com.king.bugs.SoundManager.play("intro", 100, false);
startTimer = getTimer();
mcIntroScreen._visible = true;
mcIntroScreen._y = 5;
mcIntroScreen._x = 0;
timeLeft = 12;
introTime = 4000;
cntTime = 10000;
lastTime = 0;
gameState = STATE_SHOW_INFO_SCREEN;
}
function startGame() {
mcBlue._visible = true;
mcGame.mcStartLight._visible = true;
mcScoreBoard._visible = true;
mcIntroScreen._visible = false;
txtInfo = "";
txtClickCont = "";
gameState = STATE_PLAY_GAME;
league++;
if (league > leaguesPerLevel) {
league = 1;
level++;
resetScoreBoard();
}
if (level == maxLevel) {
leaguesPerLevel = 3;
}
mcScoreBoard.txtJump.text = (((_global.textMappings.jump + " ") + league) + "/") + leaguesPerLevel;
mcGame.startRound(random, level, playerLife, league, maxLevel);
}
function endRound(placeArr, life) {
if (playerLife <= 0) {
gameOver();
} else {
updateScoreBoard(placeArr);
if (league == leaguesPerLevel) {
if (playerPlace != 0) {
com.king.util.Delay.oneShot(this, gameOver, 1000);
} else if (level == maxLevel) {
gameWon();
} else {
startTimer = getTimer();
timeLeft = 10;
lastTime = 0;
gameState = STATE_BETWEEN_ROUNDS;
com.king.util.Delay.oneShot(this, nextLevelSign, 500);
}
} else {
startTimer = getTimer();
timeLeft = 10;
lastTime = 0;
gameState = STATE_BETWEEN_ROUNDS;
}
}
}
function nextLevelSign() {
if ((level + 1) == maxLevel) {
mcInfo.mcNextLevel.gotoAndStop("topLevel");
mcInfo.mcNextLevel.txtInfo.text = _global.textMappings.top_level_sign;
com.king.bugs.SoundManager.play("bossLevel");
} else {
com.king.bugs.SoundManager.play("newLevel");
}
var _local3 = new mx.transitions.Tween(mcInfo.mcNextLevel, "_y", mx.transitions.easing.Elastic.easeInOut, -360, 0, 1.5, true);
txtInfo = _global.textMappings.next_level;
}
function gameOverSign() {
}
function gameWon() {
startTimer = getTimer();
timeLeft = 2;
lastTime = 0;
mcGameOver.txtGameOver.text = _global.textMappings.game_end;
playerWon = true;
gameState = STATE_GAME_WON;
}
function showNextLevelScreen(placeArr, life) {
}
function gameOver() {
com.king.bugs.SoundManager.stop("loop");
com.king.bugs.SoundManager.stop("intro");
com.king.bugs.SoundManager.play("outro");
mcGame.gameState = mcGame.STATE_NOT_RUNNING;
mcGameOver.txtScoreTotal.text = playerScoreTotal;
if (playerWon) {
mcGameOver._x = mcGameOver._x + 50;
var _local2 = new mx.transitions.Tween(mcGameOver, "_y", mx.transitions.easing.Elastic.easeInOut, -450, 150, 1.5, true);
} else {
var _local2 = new mx.transitions.Tween(mcGameOver, "_y", mx.transitions.easing.Elastic.easeInOut, -450, -50, 1.5, true);
}
startTimer = getTimer();
timeLeft = 10;
lastTime = 0;
communicator.gameEnd(playerScoreTotal);
gameState = STATE_GAME_OVER;
}
function gamePreQuit() {
gameState = STATE_NOT_RUNNING;
com.king.util.Delay.oneShot(this, gameQuit, 1500);
}
function gameQuit() {
com.king.bugs.SoundManager.toggleSound();
(getURL("javascript:window.location.reload()"));// not popped
communicator.gameQuit();
}
function updateLife(life) {
playerLife = life;
mcGame.playerLife = playerLife;
if (playerLife > playerLastLife) {
com.king.bugs.SoundManager.play("powerBoost");
}
mcScoreBoard.mcLife.updateBar(playerLife, playerLastLife, lifeSurplus);
playerLastLife = playerLife;
}
function lifeBoost() {
if (Number(playerScoreTotal - lastHealthCheck) >= HEALTH_CHECK) {
lifeSurplus = Math.max((playerLife + (HEALTH_PER_PILL * healthPills)) - 100, 0);
playerLife = Math.min(playerLife + (HEALTH_PER_PILL * healthPills), 100);
lastHealthCheck = lastHealthCheck + HEALTH_CHECK;
txtInfo = _global.textMappings.life_refil;
switch (healthPills) {
case 1 :
mcScoreBoard.mcLife.mcPillAnim.gotoAndPlay("enUt");
break;
case 2 :
mcScoreBoard.mcLife.mcPillAnim.gotoAndPlay("tvaUt");
break;
case 3 :
mcScoreBoard.mcLife.mcPillAnim.gotoAndPlay("treUt");
break;
case 4 :
mcScoreBoard.mcLife.mcPillAnim.gotoAndPlay("fyraUt");
break;
case 5 :
mcScoreBoard.mcLife.mcPillAnim.gotoAndPlay("femUt");
}
healthPills = 0;
}
}
function updateScoreBoard(placeArr) {
com.king.bugs.SoundManager.play("powerPill");
if (league == 1) {
var _local3 = 0;
while (_local3 < 4) {
bugsScoreArr[_local3].txtScore.text = 0;
bugsScoreArr[_local3].gotoAndStop(1);
bugsScoreArr[_local3].mcScoreBug.mcBug.mcLeague.gotoAndStop(level);
_local3++;
}
}
var _local3 = 0;
while (_local3 < 4) {
var _local5 = Number(bugsScoreArr[placeArr[_local3]].txtScore.text);
bugsScoreArr[placeArr[_local3]].txtScore.text = _local5 + placeScoresArr[_local3];
if (placeArr[_local3] == 0) {
playerScoreTotal = playerScoreTotal + placeScoresArr[_local3];
if (_local3 == 0) {
healthPills++;
switch (healthPills) {
case 1 :
mcScoreBoard.mcLife.mcPillAnim.gotoAndPlay("en");
break;
case 2 :
mcScoreBoard.mcLife.mcPillAnim.gotoAndPlay("tva");
break;
case 3 :
mcScoreBoard.mcLife.mcPillAnim.gotoAndPlay("tre");
break;
case 4 :
mcScoreBoard.mcLife.mcPillAnim.gotoAndPlay("fyra");
break;
case 5 :
mcScoreBoard.mcLife.mcPillAnim.gotoAndPlay("fem");
}
}
}
_local3++;
}
mcScoreBoard.txtScoreTotal.text = playerScoreTotal;
_local3 = 0;
while (_local3 < 4) {
var _local4 = 3;
var _local2 = 0;
while (_local2 < 4) {
if (_local3 != _local2) {
if (Number(bugsScoreArr[_local3].txtScore.text) > Number(bugsScoreArr[_local2].txtScore.text)) {
_local4--;
}
if (Number(bugsScoreArr[_local3].txtScore.text) == Number(bugsScoreArr[_local2].txtScore.text)) {
if (_local3 < _local2) {
_local4--;
}
}
}
_local2++;
}
if (_local3 == 0) {
playerPlace = _local4;
}
var _local7 = new mx.transitions.Tween(bugsScoreArr[_local3], "_y", mx.transitions.easing.None.easeOut, bugsScoreArr[_local3]._y, bugsScorePosArr[_local4], 0.5, true);
_local3++;
}
}
function resetScoreBoard() {
if (level == maxLevel) {
bugsScoreArr[1]._visible = false;
bugsScoreArr[2]._visible = false;
bugsScoreArr[3]._visible = false;
bugsScoreArr[1] = mcScoreBoard.mcScoreBug_5;
bugsScoreArr[1]._y = 242;
bugsScorePosArr[1] = bugsScoreArr[1]._y;
}
var _local3 = 0;
while (_local3 < 4) {
bugsScoreArr[_local3].txtScore.text = "";
bugsScoreArr[_local3].gotoAndStop(2);
_local3++;
}
mcScoreBoard.txtLevel.text = (_global.textMappings.level + " ") + level;
}
function clickArea() {
switch (gameState) {
case STATE_SHOW_INFO_SCREEN :
timeLeft = 0;
break;
case STATE_PLAY_GAME :
if ((((mcGame.player.falseStart == false) && (mcGame.jumpIsOver == false)) && (mcGame.player.jumpDecel == false)) && (mcGame.rewinding == false)) {
if (mcGame.player.jumping == true) {
mcGame.player.jumpAccel = false;
mcGame.player.jumpMaxSpeed = false;
mcGame.player.jumpDecel = true;
mcGame.player.startTime = getTimer() - mcGame.startTimer;
mcGame.player.yPos = mcGame.player._y;
mcGame.player.decelLastPos = mcGame.player._y;
mcGame.camTarget.mcBug.mcEyes.gotoAndStop("normal");
mcGame.player.mcBug.gotoAndPlay("flyga");
} else if (mcGame.startJump) {
trace("Reaction: " + Number(getTimer() - mcGame.reactionTimer));
mcGame.camTarget.jumping = true;
mcGame.camTarget.jumpAccel = true;
mcGame.camTarget.startTime = getTimer() - mcGame.startTimer;
mcGame.camTarget.mcBug.gotoAndStop("med");
mcGame.camTarget.mcBug.mcEyes.gotoAndStop("blink");
com.king.bugs.SoundManager.play("falling", 30);
} else {
mcGame.camTarget.falseStart = true;
mcGame.camTarget.landed = true;
mcGame.camTarget.mcFalseStart._visible = true;
com.king.bugs.SoundManager.play("falseStart");
mcGame.camTarget.mcFalseStart.gotoAndPlay(2);
mcGame.camTarget.mcBug._visible = false;
var _local2 = 1;
while (_local2 < 4) {
if (mcGame.bugsArr[_local2].startTime < mcGame.camTarget.startTime) {
mcGame.camTarget = mcGame.bugsArr[_local2];
}
_local2++;
}
}
}
break;
case STATE_BETWEEN_ROUNDS :
if (timeLeft < 8) {
timeLeft = 0;
}
break;
case STATE_GAME_OVER :
if (timeLeft >= 8) {
break;
}
timeLeft = 0;
}
}
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_GAME_OVER = 4;
static var STATE_GAME_WON = 5;
static var STATE_NOT_RUNNING = 6;
static var HEALTH_PER_PILL = 20;
static var HEALTH_CHECK = 1000;
var placeScoresArr = new Array();
var bugsScoreArr = new Array();
var bugsScorePosArr = new Array();
static var DEBUG_MODE = false;
static var DEBUG_GAME_DATA = "<gamedata randomseed=\"1024\" timelimit=\"660\"><text id=\"game_start_count\">The game starts in [0] seconds!</text><text id=\"next_level\">You made it to the next level!</text><text id=\"top_level_sign\">You made it to he last level!</text><text id=\"life_refil\">Refilling life!</text><text id=\"level_count\">Start in [0] seconds!</text><text id=\"click_to_contineu\">Click to contineu</text><text id=\"intro_info\">Click the mouse as soon as possible after the countdown to jump. If you click too early you are disqualified from that race. Click the mouse again to release the parachute. Wait as long as possible to gain speed, but don't wait to long as this will prevent you from land safely.If power is down to zero the game is over.. Oh yea.. Dont forget to bring back the bacon..</text><text id=\"total_score\">Total Score</text><text id=\"level\">Level</text><text id=\"jump\">Jump</text><text id=\"your_score\">Your score</text><text id=\"game_over\">Game Over</text><text id=\"game_end\">Game Ending</text><text id=\"game_ends_in\">Game ends in [0] seconds</text><text id=\"click_to_end\">Click to end the game</text><text id=\"exit_game\">Exit Game</text><text id=\"sound_on\">Sound On</text><text id=\"sound_off\">Sound Off</text></gamedata>";
}
Symbol 214 MovieClip [__Packages.com.king.bugs.Communicator] Frame 0
class com.king.bugs.Communicator
{
var levelDatas, randomSeed;
function Communicator () {
levelDatas = new Array();
}
function gameStarted() {
trace("GAME START");
if (!hasSentGameStart) {
hasSentGameStart = true;
fscommand ("gameStart");
fscommand ("playData", "200=0");
}
}
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 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();
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++;
}
}
var hasSentGameStart = false;
var hasSentGameEnd = false;
var hasSentGameOver = false;
}
Symbol 215 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 216 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 217 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 218 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 219 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 220 MovieClip [__Packages.mx.transitions.easing.Elastic] Frame 0
class mx.transitions.easing.Elastic
{
function Elastic () {
}
static function easeIn(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / d;
if (t == 1) {
return(b + c);
}
if (!p) {
p = d * 0.3;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
t = t - 1;
return((-((a * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p))) + b);
}
static function easeOut(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / d;
if (t == 1) {
return(b + c);
}
if (!p) {
p = d * 0.3;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
return((((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p)) + c) + b);
}
static function easeInOut(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / (d / 2);
if (t == 2) {
return(b + c);
}
if (!p) {
p = d * 0.45;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
if (t < 1) {
t = t - 1;
return((-0.5 * ((a * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p))) + b);
}
t = t - 1;
return(((((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p)) * 0.5) + c) + b);
}
static var version = "1.1.0.52";
}
Symbol 221 MovieClip [__Packages.mx.transitions.easing.None] Frame 0
class mx.transitions.easing.None
{
function None () {
}
static function easeNone(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeIn(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeInOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static var version = "1.1.0.52";
}
Symbol 222 MovieClip [__Packages.com.king.bugs.TheBugs] Frame 0
class com.king.bugs.TheBugs extends MovieClip
{
var gotoAndStop, mcPlaceNums, mcBug, mcFalseStart, _y, _x, bug, jumping, jumpAccel, jumpMaxSpeed, jumpDecel, falseStart, landed, decelDelay, startTime;
function TheBugs () {
super();
}
function init(bugGoto, bugNum, player, delay, startPosY, decDelay, falseStarter, level) {
gotoAndStop(bugGoto);
mcPlaceNums.gotoAndStop(5);
mcBug.mcBugBody.mcLeague.gotoAndStop(level);
mcFalseStart.mcBug.mcBugBody.mcLeague.gotoAndStop(level);
mcFalseStart._visible = false;
if (level == _root.mcBugs.maxLevel) {
_y = startPosY;
_x = (bugNum + 1) * 100;
} else {
_y = startPosY;
_x = 60 * (bugNum + 1);
}
bug = bugNum;
jumping = false;
jumpAccel = false;
jumpMaxSpeed = false;
jumpDecel = false;
falseStart = false;
landed = false;
decelDelay = decDelay;
if (bugNum != player) {
startTime = delay;
} else {
startTime = 999999 /* 0x0F423F */;
}
if (falseStarter == bugNum) {
falseStart = true;
}
}
}