Frame 2
stop();
_quality = "LOW";
System.security.allowDomain("juicyfruit.com");
Frame 10
_global.gameOver = false;
Frame 18
stop();
Frame 41
stop();
Frame 49
_global.startGame = function () {
gotoAndPlay (76);
};
Frame 76
enemy = function (depth, type, xpos, ypos) {
var _local1 = this;
var _local2 = _global;
var _local3 = depth;
_local1.depth = _local3;
_local1.name = "enemy_" + _local3;
_local1.clip = mainLevel.enemy_mc.attachMovie(type, _local1.name, _local3);
_local1.clip.instanceObject = _local1;
_local1.framesClip = _local1.clip.animation;
_local1.boundingBox = _local1.framesClip.boundingBox;
_local1.hitBox = _local1.framesClip.hitBox;
_local1.isInjured = false;
_local1.position = {x:xpos, y:ypos};
_local1.initialPosition = {x:xpos, y:ypos};
_local1.clip._x = _local1.position.x;
_local1.clip._y = _local1.position.y;
_local1.power = 0;
_local1.stepping = 0;
_local1.paused = true;
_local1.child = new _local1[type](_local1);
_local1.update = function () {
var _local1 = this;
var _local2 = _global;
_local1.position.x = _local1.initialPosition.x + _local2.levelObj.x;
if ((_local1.position.x < 350) && (_local1.position.x > -100)) {
_local1.stepping++;
_local1.child.step(_local1.stepping, _local1);
_local1.position.x = (_local1.initialPosition.x + _local2.levelObj.x) + _local1.child.localPosition.x;
_local1.position.y = _local1.initialPosition.y + _local1.child.localPosition.y;
_local1.clip._x = _local1.position.x;
_local1.clip._y = _local1.position.y;
}
if (Math.abs(_local1.position.x - player.position.x) < 200) {
if ((_local1.boundingBox.hitTest(player.boundingBox) && (player.keyMatrix.hit == false)) && (!_local1.isInjured)) {
_local2.player.keyMatrix.hit = true;
_local1.child.hitPlayer();
if (_local1.child.direction != undefined) {
_local2.player.velocity = 20 * _local1.child.direction;
} else {
_local2.player.velocity = -20;
}
}
if (_local1.isBoss) {
if (_local1.hitBox.hitTest(player.hitBox) && (_local2.player.checkForSwing)) {
_local2.gameSound.enemyHit_sound.start();
_local1.child.bossHit();
}
} else if (_local1.boundingBox.hitTest(player.hitBox) && (_local2.player.checkForSwing)) {
_local1.die();
}
}
if (_local1.position.x < -200) {
removeMovieClip(_local1.clip);
delete enemyList[_local1.name];
}
};
};
enemy.prototype.die = function () {
var _local1 = this;
_global.gameSound.enemyHit_sound.start();
_local1.framesClip.gotoAndPlay("die");
delete _global.enemyList[_local1.name];
setScore(_local1.child.pointValue, _local1.clip._x, _local1.clip._y, _local1.depth);
if (_local1.isBoss) {
_global.gameSound.bossDie_sound.start();
var _local3 = 4;
_global.levelObj.intervalID = setInterval(_global.levelObj, "endLevel", 5000);
} else if (random(4) == 1) {
var _local3 = 1;
} else {
var _local3 = 0;
}
var _local2 = 1;
while (_local2 <= _local3) {
_local1.explosionclip = mainLevel.enemy_mc.attachMovie("gum_bonus", "gumbonus" + (_local1.depth + _local2), _local1.depth + _local2);
_local1.explosionClip._x = _local1.position.x;
_local1.explosionClip._y = _local1.position.y;
_local2++;
}
};
enemy.prototype.frog = function (parent) {
var _local1 = this;
_local1.pointValue = 750;
_local1.jumpHeight = 20;
_local1.jumpFrame = 1;
_local1.maxJumpFrames = 20;
_local1.jumpXIncr = 3;
_local1.parent = parent;
_local1.parent.power = 3;
_local1.localPosition = {x:0, y:0};
_local1.step = function (stepping) {
var _local1 = this;
var _local2 = stepping;
if ((_local2 >= 10) && (_local2 < (10 + _local1.maxJumpFrames))) {
_local1.jump();
} else if (_local2 == 30) {
_local1.parent.framesClip.gotoAndPlay("attack");
} else if (_local2 == 80) {
_local1.parent.framesClip.gotoAndStop("idle");
_local1.parent.stepping = 0;
}
};
_local1.jump = function () {
var _local1 = this;
_local1.parent.framesClip.gotoAndStop("jump");
var _local2 = ((_local1.jumpHeight * 2) * (_local1.jumpFrame / (_local1.maxJumpFrames + 1))) - _local1.jumpHeight;
_local1.localPosition.y = _local1.localPosition.y + _local2;
_local1.localPosition.x = _local1.localPosition.x - _local1.jumpXIncr;
_local1.jumpFrame++;
if (_local1.jumpFrame > _local1.maxJumpFrames) {
_local1.jumpFrame = 1;
_local1.parent.framesClip.gotoAndStop("idle");
}
};
};
enemy.prototype.donkey = function (parent) {
var _local1 = this;
_local1.pointValue = 500;
_local1.direction = -1;
_local1.velocity = -4;
_local1.accel = 0.5;
_local1.maxVel = -4;
_local1.changeDirectionFrames = Math.abs((_local1.velocity / _local1.accel) * 2);
_local1.changedDirection = 0;
_local1.parent = parent;
_local1.localPosition = {x:0, y:0};
_local1.step = function (stepping) {
var _local1 = this;
_local1.velocity = _local1.velocity + (_local1.accel * _local1.direction);
if (_local1.velocity < _local1.maxVel) {
_local1.velocity = _local1.maxVel;
}
_local1.localPosition.x = _local1.localPosition.x + _local1.velocity;
};
_local1.switchDirections = function () {
var _local1 = this;
if (_local1.direction != 1) {
(_local1.parent.clip.gotoAndStop("right"));// not popped
} else {
(_local1.parent.clip.gotoAndStop("left"));// not popped
}
_local1.velocity = _local1.velocity - (_local1.accel * _local1.direction);
_local1 = "switchDirections";
};
_local1.hitPlayer = function () {
this.velocity = 8;
};
};
enemy.prototype.chicken = function (parent) {
var _local1 = this;
_local1.pointValue = 300;
_local1.direction = -1;
_local1.speed = -1 * (random(3) + 1);
_local1.velocity = {x:_local1.speed, y:0};
_local1.accel = 0.5;
_local1.parent = parent;
_local1.parent.power = 2;
_local1.localPosition = {x:0, y:0};
_local1.step = function (stepping) {
var _local1 = this;
var _local2 = stepping;
if ((_local2 == 25) || (_local2 == 100)) {
_local1.changeDirection();
}
if ((_local2 >= 25) && (_local2 < 35)) {
_local1.takeOff();
} else if ((_local2 >= 35) && (_local2 < 90)) {
_local1.fly();
} else if ((_local2 >= 90) && (_local2 < 100)) {
_local1.land();
} else if (_local2 == 100) {
_local1.parent.stepping = 0;
_local1.velocity.y = 0;
_local1.localPosition.y = 0;
_local1.parent.framesClip.gotoAndStop("run");
}
_local1.localPosition.x = _local1.localPosition.x + _local1.velocity.x;
_local1.localPosition.y = _local1.localPosition.y + _local1.velocity.y;
};
_local1.changeDirection = function () {
var _local1 = this;
var _local2 = Math.floor(Math.random() * 3) == 1;
if (_local2) {
_local1.velocity.x = _local1.speed * -1;
_local1.direction = 1;
_local1.parent.clip.gotoAndStop("right");
} else {
_local1.velocity.x = _local1.speed;
_local1.direction = -1;
_local1.parent.clip.gotoAndStop("left");
}
};
_local1.takeOff = function () {
this.velocity.y = this.velocity.y + -1;
this.parent.framesClip.gotoAndStop("fly");
};
_local1.land = function () {
this.velocity.y = this.velocity.y + 1;
this.parent.framesClip.gotoAndStop("fly");
};
_local1.fly = function () {
var _local1 = this;
_local1.parent.framesClip.gotoAndStop("fly");
_local1.velocity.y = Math.cos(_local1.localPosition.x * 0.1) * 3;
};
};
enemy.prototype.parrot = function (parent) {
var _local1 = this;
_local1.pointValue = 500;
_local1.velocity = {x:-4, y:9};
_local1.changeVelY = 0.2;
_local1.parent = parent;
_local1.localPosition = {x:0, y:-200};
_local1.step = function (stepping) {
var _local1 = this;
_local1.localPosition.x = _local1.localPosition.x + _local1.velocity.x;
_local1.velocity.y = _local1.velocity.y - _local1.changeVelY;
_local1.localPosition.y = _local1.localPosition.y + _local1.velocity.y;
if (_local1.velocity.y < 0) {
_local1.parent.framesClip.gotoAndStop("climb");
}
};
};
enemy.prototype.bull = function (parent) {
var _local1 = this;
var _local2 = _global;
_local1.pointValue = 2000;
parent.isBoss = true;
_local1.power = 4;
_local1.shakeAmount = 2;
_local1.direction = -1;
_local1.velocity = -8;
_local1.accel = 1;
_local1.isHurt = false;
_local1.parent = parent;
_local1.localPosition = {x:0, y:0};
_local1.step = function (stepping) {
var _local1 = stepping;
var _local2 = this;
var _local3 = _global;
if (_local1 == 1) {
stopAllSounds();
_local3.gameSound.boss_music.start(0, 999);
}
_local3.levelObj.showBoss = true;
if (_local1 < 50) {
_local3.levelObj.x--;
player.position.x--;
} else if (_local1 == 60) {
_local2.parent.framesClip.gotoAndStop("warn");
} else if ((_local1 > 75) && (_local1 <= 95)) {
_local2.charge();
} else if ((_local1 > 95) && (_local1 <= 100)) {
_local2.attack();
} else if ((_local1 > 100) && (_local1 <= 160)) {
_local2.retreat();
} else if (_local1 == 230) {
_local2.isHurt = false;
parent.stepping = 101;
}
};
_local1.charge = function () {
var _local1 = this;
_local1.parent.framesClip.gotoAndStop("charge");
_local1.localPosition.x = _local1.localPosition.x + _local1.velocity;
_local1.shakeAmount = _local1.shakeAmount * -1;
_global.levelObj.clip._y = _local1.shakeAmount;
};
_local1.attack = function () {
var _local1 = this;
_local1.velocity = _local1.velocity + _local1.accel;
_local1.localPosition.x = _local1.localPosition.x + _local1.velocity;
_local1.parent.framesClip.gotoAndStop("attack");
_global.levelObj.clip._y = 0;
};
_local1.retreat = function () {
var _local1 = this;
_local1.velocity = 5;
_local1.parent.framesClip.gotoAndStop("warn");
_local1.localPosition.x = _local1.localPosition.x + _local1.velocity;
if (_local1.localPosition.x >= -10) {
_local1.velocity = -8;
_local1.parent.framesClip.gotoAndStop("idle");
parent.stepping = 50;
}
};
_local1.bossHit = function () {
var _local1 = this;
if ((!_local1.isHurt) && (parent.stepping >= 50)) {
_local1.power--;
_local1.isHurt = true;
parent.stepping = 201;
if (_local1.power != 0) {
_local1.parent.framesClip.gotoAndStop("hit");
} else {
_local1.parent.die();
}
}
};
};
enemy.prototype.bee = function (parent) {
var _local1 = this;
_local1.pointValue = 4000;
_local1.power = 4;
_local1.isHurt = false;
_local1.parent = parent;
parent.isBoss = true;
_local1.localPosition = {x:0, y:-75};
_local1.step = function (stepping) {
var _local1 = stepping;
var _local2 = this;
var _local3 = _global;
if (_local1 == 1) {
stopAllSounds();
_local3.gameSound.boss_music.start(0, 999);
}
_local3.levelObj.showBoss = true;
if (_local1 < 50) {
_local3.levelObj.x--;
player.position.x--;
} else if (_local1 == 75) {
_local2.getRandomPoint();
} else if ((_local1 >= 76) && (_local1 <= 100)) {
_local2.moveToPoint();
} else if (_local1 == 101) {
if (Math.floor(Math.random() * 2) == 1) {
_local2.parent.framesClip.gotoAndStop("attack");
_local2.prepareAttack();
} else {
_local2.parent.stepping = 70;
}
} else if ((_local1 > 101) && (_local1 <= 115)) {
_local2.attack();
} else if ((_local1 > 115) && (_local1 <= 130)) {
_local2.retreat();
} else if (_local1 == 131) {
_local2.parent.framesClip.gotoAndStop("fly");
_local2.parent.stepping = 51;
} else if ((_local1 >= 201) && (_local1 < 225)) {
_local2.hurt();
} else if (_local1 == 225) {
_local2.isHurt = false;
_local2.parent.framesClip.gotoAndStop("fly");
_local2.parent.stepping = 51;
}
};
_local1.getRandomPoint = function () {
var _local2 = this;
var _local1 = {x:random(50) - 150, y:random(100) - 150};
_local2.moveStep = {x:(_local1.x - _local2.localPosition.x) / 25, y:(_local1.y - _local2.localPosition.y) / 25};
};
_local1.moveToPoint = function () {
var _local1 = this;
_local1.localPosition.x = _local1.localPosition.x + _local1.moveStep.x;
_local1.localPosition.y = _local1.localPosition.y + _local1.moveStep.y;
};
_local1.prepareAttack = function () {
var _local2 = this;
var _local1 = {x:-200, y:-50};
_local2.attackStep = {x:(_local1.x - _local2.localPosition.x) / 15, y:(_local1.y - _local2.localPosition.y) / 15};
};
_local1.attack = function () {
var _local1 = this;
_local1.localPosition.x = _local1.localPosition.x + _local1.attackStep.x;
_local1.localPosition.y = _local1.localPosition.y + _local1.attackStep.y;
};
_local1.retreat = function () {
this.localPosition.x = this.localPosition.x + 10;
this.localPosition.y = this.localPosition.y - 5;
};
_local1.hurt = function () {
this.localPosition.x = this.localPosition.x + 1;
this.localPosition.y = this.localPosition.y - 0.5;
};
_local1.bossHit = function () {
var _local1 = this;
if ((!_local1.isHurt) && (parent.stepping >= 50)) {
_local1.power--;
if (_local1.power != 0) {
_local1.parent.framesClip.gotoAndStop("hit");
_local1.isHurt = true;
_local1.parent.stepping = 201;
} else {
_local1.parent.die();
}
}
};
};
enemy.prototype.dinosaur = function (parent) {
var _local1 = this;
var _local3 = _global;
_local1.pointValue = 6000;
_local1.power = 5;
_local1.isHurt = false;
_local1.parent = parent;
parent.isBoss = true;
_local1.localPosition = {x:0, y:0};
_local1.step = function (stepping) {
var _local1 = this;
var _local2 = stepping;
var _local3 = _global;
if (_local2 == 1) {
stopAllSounds();
_local3.gameSound.boss_music.start(0, 999);
}
_local3.levelObj.showBoss = true;
if (_local2 < 50) {
_local3.levelObj.x--;
player.position.x--;
} else if (_local2 == 75) {
_local1.getRandomPoint();
} else if ((_local2 >= 76) && (_local2 <= 100)) {
_local1.moveToPoint();
} else if (_local2 == 101) {
if (Math.floor(Math.random() * 2) == 0) {
_local1.parent.framesClip.gotoAndStop("attack");
} else {
_local1.parent.framesClip.gotoAndStop("idle");
_local1.parent.stepping = 51;
}
} else if ((_local2 > 101) && (_local2 <= 130)) {
_local1.parent.framesClip.gotoAndStop("attack");
} else if (_local2 == 131) {
_local1.parent.framesClip.gotoAndStop("idle");
_local1.parent.stepping = 51;
} else if ((_local2 >= 201) && (_local2 < 225)) {
_local1.hurt();
} else if (_local2 == 225) {
_local1.isHurt = false;
_local1.parent.framesClip.gotoAndStop("idle");
_local1.parent.stepping = 51;
}
};
_local1.getRandomPoint = function () {
var _local2 = this;
var _local1 = {x:random(75) - 100, y:0};
_local2.moveStep = {x:(_local1.x - _local2.localPosition.x) / 25, y:(_local1.y - _local2.localPosition.y) / 25};
};
_local1.moveToPoint = function () {
var _local1 = this;
_local1.parent.framesClip.gotoAndStop("walk");
_local1.localPosition.x = _local1.localPosition.x + _local1.moveStep.x;
_local1.localPosition.y = _local1.localPosition.y + _local1.moveStep.y;
};
_local1.hurt = function () {
this.parent.framesClip.gotoAndStop("hit");
this.localPosition.x = this.localPosition.x + 1;
};
_local1.bossHit = function () {
var _local1 = this;
if ((!_local1.isHurt) && (parent.stepping >= 50)) {
_local1.power--;
if (_local1.power != 0) {
_local1.parent.framesClip.gotoAndStop("hit");
_local1.isHurt = true;
_local1.parent.stepping = 201;
} else {
_local1.parent.die();
}
}
};
};
enemy.prototype.gorilla = function (parent) {
var _local1 = this;
var _local2 = _global;
_local1.pointValue = 8000;
_local1.power = 5;
_local1.isHurt = false;
_local1.parent = parent;
parent.isBoss = true;
_local1.shakeAmount = 4;
_local1.jumpHeight = 15;
_local1.maxJumpFrames = 30;
_local1.jumpFrame = 1;
_local1.localPosition = {x:0, y:0};
_local1.step = function (stepping) {
var _local1 = this;
var _local2 = stepping;
var _local3 = _global;
if (_local2 == 1) {
stopAllSounds();
_local3.gameSound.boss_music.start(0, 999);
}
_local3.levelObj.showBoss = true;
if (_local2 < 50) {
_local3.levelObj.x--;
player.position.x--;
} else if (_local2 == 75) {
_local1.getRandomPoint();
} else if ((_local2 >= 76) && (_local2 <= 100)) {
_local1.moveToPoint();
} else if (_local2 == 101) {
var rand = Math.floor(Math.random() * 5);
if (rand == 1) {
_local1.parent.framesClip.gotoAndStop("throw");
} else if (rand == 3) {
_local1.parent.stepping = 201;
} else {
_local1.parent.framesClip.gotoAndStop("idle");
_local1.parent.stepping = 51;
}
} else if ((_local2 > 101) && (_local2 <= 130)) {
parent.boundingBox._x = parent.boundingBox._x - 12;
parent.boundingBox._y = -20;
} else if (_local2 == 131) {
_local1.parent.framesClip.gotoAndStop("idle");
_local1.parent.stepping = 51;
} else if ((_local2 >= 201) && (_local2 <= (201 + _local1.maxJumpFrames))) {
_local1.jump();
} else if ((_local2 > (201 + _local1.maxJumpFrames)) && (_local2 < ((201 + _local1.maxJumpFrames) + 10))) {
_local1.shakeAmount = _local1.shakeAmount * -1;
_local3.levelObj.clip._y = _local1.shakeAmount;
} else if (_local2 == ((201 + _local1.maxJumpFrames) + 10)) {
_local1.parent.stepping = 51;
} else if ((_local2 >= 301) && (_local2 < 325)) {
_local1.hurt();
} else if (_local2 == 325) {
_local1.isHurt = false;
_local1.parent.framesClip.gotoAndStop("idle");
_local1.parent.stepping = 51;
}
};
_local1.getRandomPoint = function () {
var _local2 = this;
var _local1 = {x:10 - random(75), y:0};
_local2.moveStep = {x:(_local1.x - _local2.localPosition.x) / 25, y:(_local1.y - _local2.localPosition.y) / 25};
};
_local1.moveToPoint = function () {
var _local1 = this;
_local1.parent.framesClip.gotoAndStop("walk");
_local1.localPosition.x = _local1.localPosition.x + _local1.moveStep.x;
_local1.localPosition.y = _local1.localPosition.y + _local1.moveStep.y;
};
_local1.jump = function () {
var _local1 = this;
_local1.parent.framesClip.gotoAndStop("jump");
var _local2 = ((_local1.jumpHeight * 2) * (_local1.jumpFrame / (_local1.maxJumpFrames + 1))) - _local1.jumpHeight;
_local1.localPosition.y = _local1.localPosition.y + _local2;
_local1.jumpFrame++;
if (_local1.jumpFrame > _local1.maxJumpFrames) {
_local1.jumpFrame = 1;
_local1.localPosition.y = 0;
_local1.parent.framesClip.gotoAndStop("idle");
}
};
_local1.hurt = function () {
this.parent.framesClip.gotoAndStop("hit");
};
_local1.bossHit = function () {
var _local1 = this;
if ((!_local1.isHurt) && (parent.stepping >= 50)) {
_local1.power--;
if (_local1.power != 0) {
_local1.parent.framesClip.gotoAndStop("hit");
_local1.isHurt = true;
_local1.parent.stepping = 301;
} else {
_local1.parent.die();
}
}
};
};
playerObj = function (playerType) {
var _local1 = this;
_local1.clip = mainLevel.attachMovie(playerType, "player_mc", 14);
_local1.startingPos = {x:73, y:186};
_local1.clip._x = _local1.startingPos.x;
_local1.clip._y = _local1.startingPos.y;
_local1.shadowClip = mainLevel.attachMovie("shadow", "playerShadow", 13);
_local1.shadowClip._x = _local1.clip._x;
_local1.shadowClip._y = _local1.clip._y + 25;
_local1.framesClip = _local1.clip.body;
_local1.boundingBox = _local1.framesClip.boundingBox;
_local1.hitBox = _local1.framesClip.hitBox;
_local1.checkForSwing = false;
_local1.keyMatrix = {run:0, jump:0, swing:0, squat:0, hit:0};
_local1.playerState = "idle";
_local1.position = {x:_local1.clip._x, y:_local1.clip._y};
_local1.velocity = 0;
_local1.maxVelocity = 8;
_local1.accel = 2;
_local1.deAccel = 0.5;
_local1.jumpHeight = 30;
_local1.maxJumpFrames = 15;
_local1.jumpFrame = 1;
_local1.hitFrame = 0;
_local1.hitInvincibleTime = 30;
_local1.hitColorTransform = new Color(_local1.clip);
_local1.noColor = {ra:"100", rb:"0", ga:"100", gb:"0", ba:"100", bb:"0", aa:"100", ab:"0"};
_local1.blinkColor = {ra:"50", rb:"128", ga:"50", gb:"0", ba:"50", bb:"0", aa:"100", ab:"0"};
};
playerObj.prototype.update = function () {
var _local1 = this;
var _local2 = _global;
if (_local1.keyMatrix.run != 0) {
if (_local1.keyMatrix.run == 1) {
_local1.clip.gotoAndStop("right");
} else {
_local1.clip.gotoAndStop("left");
}
_local1.velocity = _local1.velocity + (_local1.accel * _local1.keyMatrix.run);
if (Math.abs(_local1.velocity) > _local1.maxVelocity) {
_local1.velocity = _local1.maxVelocity * _local1.keyMatrix.run;
}
} else if (Math.abs(_local1.velocity) > 0.1) {
_local1.velocity = _local1.velocity * _local1.deAccel;
} else {
_local1.velocity = 0;
}
if (_local1.keyMatrix.jump) {
_local1.playerState = "jump";
} else if (_local1.keyMatrix.squat) {
_local1.playerState = "squat";
_local1.velocity = 0;
} else if (_local1.keyMatrix.run != 0) {
_local1.playerState = "run";
} else {
_local1.playerState = "idle";
}
if (_local1.keyMatrix.jump) {
var _local3 = ((_local1.jumpHeight * 2) * (_local1.jumpFrame / (_local1.maxJumpFrames + 1))) - _local1.jumpHeight;
_local1.position.y = _local1.position.y + _local3;
_local1.jumpFrame++;
if (_local1.jumpFrame > _local1.maxJumpFrames) {
_local1.keyMatrix.jump = false;
_local1.jumpFrame = 1;
}
}
_local1.swing = function () {
this.framesClip.animation.arms.play();
this.keyMatrix.swing = false;
};
_local1.die = function () {
_global.levelObj.endLevel(true);
};
if (_local1.keyMatrix.hit) {
_local1.hitFrame++;
if (_local1.hitFrame == 1) {
overlay.powerbar["bar" + _local2.playerHealth]._visible = false;
_local2.playerHealth--;
if (_local2.playerHealth == 0) {
_local1.playerState = "die";
_local1.keyMatrix.hit = false;
_local1.hitFrame = 0;
_local1.die();
}
} else if (_local1.hitFrame < (_local1.hitInvincibleTime / 2)) {
_local1.playerState = "hit";
} else if (_local1.hitFrame <= _local1.hitInvincibleTime) {
if ((_local1.hitFrame % 6) == 0) {
_local1.hitColorTransform.setTransform(_local1.noColor);
} else if ((_local1.hitFrame % 3) == 0) {
_local1.hitColorTransform.setTransform(_local1.blinkColor);
}
} else {
_local1.keyMatrix.hit = false;
_local1.hitFrame = 0;
}
}
_local1.framesClip.gotoAndStop(_local1.playerState);
_local1.position.x = _local1.position.x + _local1.velocity;
player.position.x = Math.max(player.position.x, 20);
if (_local2.levelObj.showBoss) {
if (player.position.x > 300) {
player.position.x = 300;
}
} else if (player.position.x > 170) {
player.position.x = 170;
_local2.levelObj.x = _local2.levelObj.x - Math.floor(player.velocity);
}
};
level1_layers = {sky:null, background:null, background2:["level1_section1_background", "level1_section2_background"], midground:["level1_section1_midground", "level1_section2_midground", "level1_section1_midground"], floor:["level1_floor", "level1_floor", "level1_floor", "level1_floor", "level1_floor"], foreground:["level1_foreground", "level1_foreground", "level1_foreground"]};
level2_layers = {sky:"background_sky", background:["background_hills", "background_hills", "background_hills", "background_hills", "background_hills"], background2:["level2_section1_houses", "level2_section2_houses", "level2_section3_houses"], midground:["level2_midground", "level2_midground", "level2_midground"], floor:["level2_ground", "level2_ground", "level2_ground", "level2_ground", "level2_ground", "level2_ground"], foreground:["level2_foreground", "level2_foreground", "level2_foreground", "level2_foreground", "level2_foreground"]};
level3_layers = {sky:"background_sky", background:["level3_background_city", "level3_background_city", "level3_background_city", "level3_background_city", "level3_background_city", "level3_background_city"], background2:["level3_section1_background2", "level3_section1_background2", "level3_section1_background2"], midground:["level3_section1_buildings", "level3_section2_buildings", "level3_section3_buildings", "level3_section1_buildings", "level3_section2_buildings", "level3_section3_buildings"], floor:["level2_ground", "level2_ground", "level2_ground", "level2_ground", "level2_ground", "level2_ground"], foreground:["level3_foreground", "level3_foreground", "level3_foreground", "level3_foreground", "level3_foreground"]};
level4_layers = {sky:"background_sky", background:["level4_background_hills", "level4_background_transition", "level4_background_dark", "level4_background_dark", "level4_background_dark", "level4_background_dark"], background2:["level4_section1_backtrees", "level4_section1_backtrees", "level4_section1_backtrees", "level4_section1_backtrees", "level4_section1_backtrees", "level4_section1_backtrees", "level4_section1_backtrees", "level4_section1_backtrees"], midground:["level4_section1_midtrees", "level4_section1_midtrees", "level4_section1_midtrees", "level4_section2_eviltrees", "level4_section2_eviltrees", "level4_section2_eviltrees", "level4_section2_eviltrees", "level4_section2_eviltrees"], floor:["level4_ground", "level4_ground", "level4_ground", "level4_ground", "level4_ground", "level4_ground"], foreground:["level4_foreground", "level4_foreground", "level4_foreground", "level4_foreground", "level4_foreground", "level4_foreground", "level4_foreground"]};
level5_layers = {sky:"background_sky", background:["background_hills", "background_hills", "background_hills", "background_hills", "background_hills"], floor:["level4_ground", "level4_ground", "level4_ground", "level4_ground", "level4_ground", "level4_ground"], foreground:["level4_foreground", "level4_foreground", "level4_foreground", "level4_foreground", "level4_foreground", "level4_foreground", "level4_foreground"]};
levelInfo = [level1_layers, level2_layers, level3_layers, level4_layers, level1_layers];
level1_enemyData = [{type:"chicken", x:400, y:200}, {type:"chicken", x:650, y:200}, {type:"chicken", x:800, y:200}, {type:"chicken", x:950, y:200}, {type:"chicken", x:1000, y:200}, {type:"chicken", x:1100, y:200}, {type:"chicken", x:1200, y:200}, {type:"chicken", x:1300, y:200}, {type:"chicken", x:1500, y:200}, {type:"chicken", x:1700, y:200}, {type:"chicken", x:2000, y:200}, {type:"chicken", x:2100, y:200}, {type:"chicken", x:2100, y:200}, {type:"chicken", x:2500, y:200}, {type:"chicken", x:2800, y:200}, {type:"chicken", x:3000, y:200}, {type:"chicken", x:3400, y:200}, {type:"chicken", x:3600, y:200}, {type:"chicken", x:3700, y:200}, {type:"bull", x:4000, y:215}];
level2_enemyData = [{type:"chicken", x:300, y:200}, {type:"chicken", x:500, y:200}, {type:"donkey", x:650, y:200}, {type:"chicken", x:700, y:200}, {type:"donkey", x:800, y:200}, {type:"chicken", x:900, y:200}, {type:"chicken", x:1000, y:200}, {type:"chicken", x:1150, y:200}, {type:"chicken", x:1200, y:200}, {type:"donkey", x:1400, y:200}, {type:"chicken", x:1500, y:200}, {type:"donkey", x:1800, y:200}, {type:"donkey", x:2200, y:200}, {type:"donkey", x:2500, y:200}, {type:"chicken", x:2500, y:200}, {type:"chicken", x:2675, y:200}, {type:"chicken", x:2750, y:200}, {type:"chicken", x:2900, y:200}, {type:"donkey", x:3100, y:200}, {type:"donkey", x:3150, y:200}, {type:"donkey", x:3400, y:200}, {type:"chicken", x:3700, y:200}, {type:"chicken", x:4150, y:200}, {type:"chicken", x:4200, y:200}, {type:"donkey", x:4300, y:200}, {type:"donkey", x:4450, y:200}, {type:"donkey", x:4500, y:200}, {type:"chicken", x:4700, y:200}, {type:"donkey", x:5100, y:200}, {type:"chicken", x:5500, y:200}, {type:"chicken", x:5700, y:200}, {type:"donkey", x:5900, y:200}, {type:"bee", x:6000, y:215}];
level3_enemyData = [{type:"chicken", x:300, y:200}, {type:"chicken", x:500, y:200}, {type:"donkey", x:650, y:200}, {type:"parrot", x:700, y:200}, {type:"donkey", x:800, y:200}, {type:"chicken", x:900, y:200}, {type:"parrot", x:1000, y:200}, {type:"chicken", x:1150, y:200}, {type:"chicken", x:1200, y:200}, {type:"parrot", x:1400, y:200}, {type:"chicken", x:1500, y:200}, {type:"donkey", x:1800, y:200}, {type:"donkey", x:2200, y:200}, {type:"parrot", x:2500, y:200}, {type:"chicken", x:2500, y:200}, {type:"chicken", x:2675, y:200}, {type:"chicken", x:2750, y:200}, {type:"parrot", x:2900, y:200}, {type:"donkey", x:3100, y:200}, {type:"parrot", x:3150, y:200}, {type:"donkey", x:3400, y:200}, {type:"parrot", x:3700, y:200}, {type:"parrot", x:4150, y:200}, {type:"chicken", x:4200, y:200}, {type:"parrot", x:4300, y:200}, {type:"donkey", x:4450, y:200}, {type:"parrot", x:4500, y:200}, {type:"chicken", x:4700, y:200}, {type:"parrot", x:5000, y:200}, {type:"chicken", x:5200, y:200}, {type:"chicken", x:5300, y:200}, {type:"donkey", x:5500, y:200}, {type:"chicken", x:5700, y:200}, {type:"parrot", x:6000, y:200}, {type:"parrot", x:6100, y:200}, {type:"parrot", x:6200, y:200}, {type:"dinosaur", x:6600, y:215}];
level4_enemyData = [{type:"frog", x:300, y:200}, {type:"chicken", x:500, y:200}, {type:"donkey", x:650, y:200}, {type:"parrot", x:700, y:200}, {type:"donkey", x:800, y:200}, {type:"chicken", x:900, y:200}, {type:"parrot", x:1000, y:200}, {type:"frog", x:1150, y:200}, {type:"chicken", x:1200, y:200}, {type:"parrot", x:1400, y:200}, {type:"frog", x:1500, y:200}, {type:"donkey", x:1800, y:200}, {type:"donkey", x:2200, y:200}, {type:"parrot", x:2500, y:200}, {type:"chicken", x:2500, y:200}, {type:"frog", x:2675, y:200}, {type:"frog", x:2750, y:200}, {type:"parrot", x:2900, y:200}, {type:"donkey", x:3100, y:200}, {type:"frog", x:3150, y:200}, {type:"donkey", x:3400, y:200}, {type:"parrot", x:3700, y:200}, {type:"frog", x:4150, y:200}, {type:"chicken", x:4200, y:200}, {type:"frog", x:4300, y:200}, {type:"donkey", x:4450, y:200}, {type:"parrot", x:4500, y:200}, {type:"parrot", x:4600, y:200}, {type:"frog", x:4650, y:200}, {type:"chicken", x:4700, y:200}, {type:"parrot", x:4800, y:200}, {type:"frog", x:5000, y:200}, {type:"chicken", x:5050, y:200}, {type:"frog", x:5500, y:200}, {type:"donkey", x:5650, y:200}, {type:"parrot", x:5700, y:200}, {type:"parrot", x:5800, y:200}, {type:"frog", x:5900, y:200}, {type:"frog", x:5950, y:200}, {type:"frog", x:6000, y:200}, {type:"parrot", x:6000, y:200}, {type:"frog", x:6050, y:200}, {type:"donkey", x:6100, y:200}, {type:"frog", x:6500, y:200}, {type:"gorilla", x:7000, y:215}];
enemyInfo = [level1_enemyData, level2_enemyData, level3_enemyData, level4_enemyData];
levelClass = function () {
var _local1 = this;
_local1.clip = mainLevel;
_local1.scrollingLayers = [];
_local1.levelEndTransition = false;
_local1.levelEndTransitionFrames = 24;
};
levelClass.prototype.newLevel = function (levelNum) {
var _local1 = this;
stopAllSounds();
_global.gameSound[("level" + levelNum) + "_sound"].start(0, 999);
if (_global.enemyList != undefined) {
delete _global.enemyList;
}
_global.enemyList = new Object();
_local1.x = 0;
_local1.showBoss = false;
_local1.juicyFruitsCaught = 0;
_global.player = new playerObj(_global.playerType);
_global.timer = new timer_class();
_global.timer.start();
var _local2 = levelInfo[levelNum - 1];
var enemyData = enemyInfo[levelNum - 1];
if (_local2.sky != null) {
_local1.clip.attachMovie(_local2.sky, "sky", 1);
}
_local1.clip.createEmptyMovieClip("background_mc", 2);
var a = 0;
while (a < _local2.background.length) {
var tempClip = _local1.clip.background_mc.attachMovie(_local2.background[a], "background" + a, a);
tempClip._x = _local1.clip.background_mc["background" + (a - 1)]._width * a;
a++;
}
_local1.clip.createEmptyMovieClip("background2_mc", 3);
var a = 0;
while (a < _local2.background2.length) {
var tempClip = _local1.clip.background2_mc.attachMovie(_local2.background2[a], "background2" + a, a);
tempClip._x = _local1.clip.background2_mc["background2" + (a - 1)]._x + _local1.clip.background2_mc["background2" + (a - 1)]._width;
a++;
}
_local1.clip.createEmptyMovieClip("floor_mc", 4);
var b = 0;
while (b < _local2.floor.length) {
var tempClip = _local1.clip.floor_mc.attachMovie(_local2.floor[b], "floor" + b, b);
tempClip._x = _local1.clip.floor_mc["floor" + (b - 1)]._width * b;
b++;
}
_local1.clip.createEmptyMovieClip("midground_mc", 5);
var c = 0;
while (c < _local2.midground.length) {
var tempClip = _local1.clip.midground_mc.attachMovie(_local2.midground[c], "midground" + c, c);
tempClip._x = _local1.clip.midground_mc["midground" + (c - 1)]._width * c;
c++;
}
_local1.clip.createEmptyMovieClip("foreground_mc", 50);
var _local3 = 0;
while (_local3 < _local2.foreground.length) {
var tempClip = _local1.clip.foreground_mc.attachMovie(_local2.foreground[_local3], "foreground" + _local3, _local3);
tempClip._x = _local1.clip.foreground_mc["foreground" + (_local3 - 1)]._width * _local3;
_local3++;
}
_local1.clip.createEmptyMovieClip("enemy_mc", 15);
var i = 0;
while (i < enemyData.length) {
var count = (i * 5);
_global.enemyList["enemy_" + count] = new enemy(count, enemyData[i].type, enemyData[i].x, enemyData[i].y);
i++;
}
};
levelClass.prototype.update = function () {
var _local1 = this;
_local1.clip.background_mc._x = Math.floor(_local1.x * 0.5);
_local1.clip.background2_mc._x = Math.floor(_local1.x * 0.75);
_local1.clip.midground_mc._x = Math.floor(_local1.x);
_local1.clip.floor_mc._x = _local1.x;
_local1.clip.foreground_mc._x = Math.floor(_local1.x);
if (_local1.levelEndTransition) {
_local1.levelEndFrames++;
if (_local1.levelEndFrames > _local1.levelEndTransitionFrames) {
if (!_local1.playerHasDied) {
_local1.playerDummyClip.body.gotoAndStop("run");
_local1.playerDummyClip._x = _local1.playerDummyClip._x + 5;
if (_local1.playerDummyClip._x > 400) {
_local1.levelEndTransition = false;
overlay.endBonus.play();
}
} else if (_local1.levelEndFrames > (_local1.levelEndTransitionFrames + 35)) {
_global.gameOver = true;
_local1.levelEndTransition = false;
gotoAndPlay ("highscore");
}
} else {
_local1.maskClip._x = _local1.maskClip._x + _local1.levelEndStep.x;
_local1.maskClip._y = _local1.maskClip._y + _local1.levelEndStep.y;
_local1.maskClip._xscale = (_local1.maskClip._yscale = _local1.maskClip._yscale - _local1.levelEndScaleStep);
}
}
};
levelClass.prototype.endLevel = function (isDie) {
var _local1 = this;
var _local2 = _global;
_local2.timer.paused = true;
_local1.maskClip = _local1.clip.circle_mask;
_local1.maskClip._x = 160;
_local1.maskClip._y = 120;
_local1.maskClip._width = (_local1.maskClip._height = 350);
_local1.clip.setMask(_local1.maskClip);
_local1.levelEndStep = {x:(_local2.player.clip._x - _local1.maskClip._x) / _local1.levelEndTransitionFrames, y:(_local2.player.clip._y - _local1.maskClip._y) / _local1.levelEndTransitionFrames};
_local1.levelEndScaleStep = _local1.maskClip._xscale / _local1.levelEndTransitionFrames;
_local1.levelEndTransition = true;
_local1.levelEndFrames = 0;
removeMovieClip(_local2.player.clip);
_local1.playerDummyClip = attachMovie(_local2.playerType, "playerDummy", 500);
_local1.playerDummyClip._x = _local2.player.position.x;
_local1.playerDummyClip._y = _local2.player.position.y;
delete _local2.player;
stopAllSounds();
if (isDie) {
_local2.gameSound.playerDie_sound.start();
_local1.playerDummyClip.body.gotoAndStop("die");
_local1.playerHasDied = true;
var _local3 = new Color(stage_bg);
_local3.setRGB(4473924);
} else {
clearInterval(_local1.intervalID);
_local2.gameSound.levelEnd_music.start();
_local1.playerHasDied = false;
}
};
levelClass.prototype.gotoWinScene = function () {
var _local1 = _global;
_local1.gameOver = true;
_local1.levelObj.newLevel(5);
_local1.player.clip.body.gotoAndStop("run");
_local1.player.clip._x = 160;
_local1.player.shadowClip._x = 160;
delete _local1.player;
_local1.showWinScene = true;
this.gameEndIntervalFunction = function () {
stopAllSounds();
clearInterval(_global.gameEndingInterval);
gotoAndPlay ("highscore");
};
_local1.gameEndingInterval = setInterval(this.gameEndIntervalFunction, 10000);
gotoAndStop ("winGame");
};
timer_class = function () {
var _local1 = this;
_local1.clip = overlay.timeBar.bar;
_local1.barLength = 96;
_local1.startTime = 0;
_local1.elapsedTime = 0;
_local1.clip._x = 0;
_local1.gameTime = 180000 /* 0x02BF20 */;
_local1.barStep = _local1.barLength / _local1.gameTime;
_local1.paused = false;
};
timer_class.prototype.start = function () {
this.startTime = getTimer();
};
timer_class.prototype.update = function () {
var _local1 = this;
if (!_local1.paused) {
_local1.elapsedTime = getTimer() - _local1.startTime;
_local1.clip._x = -Math.ceil(_local1.barStep * _local1.elapsedTime);
if (_local1.elapsedTime >= _local1.gameTime) {
_global.player.die();
}
}
};
soundObj = function () {
var _local1 = this;
_local1.level1_sound = new Sound();
_local1.level1_sound.attachSound("level1_music");
_local1.level2_sound = new Sound();
_local1.level2_sound.attachSound("level2_music");
_local1.level3_sound = new Sound();
_local1.level3_sound.attachSound("level3_music");
_local1.level4_sound = new Sound();
_local1.level4_sound.attachSound("level4_music");
_local1.boss_music = new Sound();
_local1.boss_music.attachSound("boss_music");
_local1.levelEnd_music = new Sound();
_local1.levelEnd_music.attachSound("levelend_music");
_local1.enemyHit_sound = new Sound();
_local1.enemyHit_sound.attachSound("enemyHit_sound");
_local1.playerHit_sound = new Sound();
_local1.playerHit_sound.attachSound("playerHit_sound");
_local1.playerDie_sound = new Sound();
_local1.playerDie_sound.attachSound("playerDie_sound");
_local1.bossDie_sound = new Sound();
_local1.bossDie_sound.attachSound("bossDie_sound");
_local1.bonus_sound = new Sound();
_local1.bonus_sound.attachSound("bonus_sound");
_local1.pointsCount_sound = new Sound();
_local1.pointsCount_sound.attachSound("pointsCount_sound");
_local1.bonusTwinkle_sound = new Sound();
_local1.bonusTwinkle_sound.attachSound("bonusTwinkle_sound");
_local1.gumPop_sound = new Sound();
_local1.gumPop_sound.attachSound("gumPop_sound");
};
pointsObj = function (points, x, y, depth) {
var _local1 = this;
_local1.clip = overlay.attachMovie("points", "points_" + depth, depth);
_local1.clip._x = x;
_local1.clip._y = y;
_local1.clip.pointsText.points = points;
};
function checkKeys() {
(Key.isDown(keyMappings.squat) ? ((player.keyMatrix.squat = true)) : ((player.keyMatrix.squat = false)));
if (Key.isDown(keyMappings.runRight)) {
player.keyMatrix.run = 1;
} else if (Key.isDown(keyMappings.runLeft)) {
player.keyMatrix.run = -1;
} else {
player.keyMatrix.run = 0;
}
if (Key.isDown(keyMappings.jump) && (keysCleared.jump)) {
player.keyMatrix.jump = true;
keysCleared.jump = false;
}
if (!Key.isDown(keyMappings.jump)) {
keysCleared.jump = true;
}
if (Key.isDown(keyMappings.swing) && (keysCleared.swing)) {
player.swing();
}
if (!Key.isDown(keyMappings.swing)) {
keysCleared.swing = true;
}
}
function updateEnemies() {
for (var _local1 in enemyList) {
enemyList[_local1].update();
}
}
function drawScene() {
player.clip._x = player.position.x;
player.clip._y = player.position.y;
player.shadowClip._x = player.position.x;
_global.levelObj.update();
}
function setScore(pointsAdded, x, y, depth) {
if (!isNaN(pointsAdded)) {
if (isBonusRound) {
pointsAdded = pointsAdded * bonusPiecesCaught;
} else if ((playerLife == 100) && (pointsAdded > 0)) {
pointsAdded = pointsAdded * 5;
}
_global.playerScore = _global.playerScore + pointsAdded;
var _local2 = String(_global.playerScore);
var _local3 = 6 - _local2.length;
var _local1 = 0;
while (_local1 < _local3) {
_local2 = "0" + _local2;
_local1++;
}
overlay.scoreMC.score = _local2;
}
new pointsObj(pointsAdded, x, y, depth);
}
stop();
_quality = "LOW";
keyMappings = {runRight:39, runLeft:37, jump:38, squat:40, swing:32};
keysCleared = {jump:true, swing:true};
_global.player = new playerObj("boy");
_global.levelObj = new levelClass();
_global.gameSound = new SoundObj();
_global.currentLevel = 1;
_global.levelObj.newLevel(currentLevel);
_global.playerScore = 0;
_global.playerHealth = 12;
_global.gumPowerUps = 0;
_global.showWinScene = false;
_global.gotGumPowerUp = function () {
var _local1 = _global;
_local1.gumPowerUps++;
_local1.levelObj.juicyFruitsCaught++;
if (_local1.gumPowerUps == 3) {
_local1.gumPowerUps = 0;
_local1.playerHealth = Math.min(_local1.playerHealth + 1, 12);
overlay.powerbar["bar" + _local1.playerHealth]._visible = true;
}
overlay.gumBonus = "x" + _local1.gumPowerUps;
};
this.onEnterFrame = function () {
var _local1 = _global;
if (!_local1.gameOver) {
checkKeys();
player.update();
updateEnemies();
timer.update();
drawScene();
} else if (_local1.showWinScene) {
_local1.levelObj.x = _local1.levelObj.x - 2;
_local1.levelObj.update();
}
};
Frame 97
function serverTimeout() {
trace("serverTimeout");
clearInterval(_global.serverWaitInterval);
_global.serverPresent = false;
createDefaultHighScoreList();
server_mc._visible = false;
highScoreList.play();
}
function createDefaultHighScoreList() {
this.defaultHighScore_array = [{score:100000, initials:"AAA"}, {score:90000, initials:"BBB"}, {score:80000, initials:"CCC"}, {score:70000, initials:"DDD"}, {score:60000, initials:"EEE"}, {score:50000, initials:"FFF"}, {score:40000, initials:"GGG"}, {score:30000, initials:"HHH"}, {score:20000, initials:"AAA"}, {score:10000, initials:"BBB"}];
_global.highScore_array = this.defaultHighScore_array;
}
function checkForHighScore() {
var _local1 = _global;
trace("check for high score");
server_mc.gameID = _local1.gameID;
server_mc.score = _local1.playerScore;
server_mc.onData = function () {
var _local1 = _global;
if (this.result == "success") {
trace("NEW HIGH SCORE");
_local1.isHighScore = true;
server_mc._visible = false;
initialsBox.play();
clearInterval(_local1.serverWaitInterval);
} else {
_local1.isHighScore = false;
clearInterval(_local1.serverWaitInterval);
getHighScores();
}
};
server_mc.loadVariables(sitePath + "checkScore.php", "POST");
_local1.serverWaitInterval = setInterval(serverTimeout, _local1.serverTimeoutSec);
}
function getHighScores() {
trace("getHighScores");
server_mc.gameID = _global.gameID;
server_mc.onData = function () {
if (this.result == "success") {
var playerID_str = new String(this.players);
var playerInitials_str = new String(this.initials);
var playerScores_str = new String(this.scores);
var playerID_array = playerID_str.split(":");
var playerInitials_array = playerInitials_str.split(":");
var playerScore_array = playerScores_str.split(":");
var _local1 = 1;
while (_local1 <= playerID_array.length) {
_global.highScore_array[_local1 - 1] = {initials:playerInitials_array[_local1 - 1], score:playerScore_array[_local1 - 1]};
_local1++;
}
server_mc._visible = false;
highScoreList.play();
clearInterval(_global.serverWaitInterval);
} else {
createDefaultHighScoreList();
clearInterval(_global.serverWaitInterval);
}
};
server_mc.loadVariables(sitePath + "getScores.php", "POST");
_global.serverWaitInterval = setInterval(serverTimeout, _global.serverTimeoutSec);
}
stop();
_global.gameID = 3;
_global.highScore_array = [];
sitePath = "";
_global.isHighScore = false;
_global.playerInitials = "";
_global.serverTimeoutSec = 4000;
_global.serverPresent = true;
for (var c in this) {
if (typeof(this[c]) == "movieclip") {
removeMovieClip(this[c]);
}
}
server_mc._visible = true;
if (_global.gameOver == true) {
checkForHighScore();
} else {
getHighScores();
}
_global.submitHighScore = function () {
var _local1 = _global;
trace("submit high score");
server_mc.gameID = _local1.gameID;
server_mc.initials = _local1.playerInitials;
server_mc.score = _local1.playerScore;
server_mc.onData = function () {
if (this.result == "success") {
getHighScores();
initialsBox.play();
}
};
server_mc.loadVariables(sitePath + "putScore.php", "POST");
};
_global.scoreForCode = 20000;
if (_global.playerScore >= _global.scoreForCode) {
receiveCode_mc.gotoAndPlay("show");
}
Frame 104
stopAllSounds();
gotoAndPlay ("title");
Symbol 16 Button
on (release) {
_quality = "MEDIUM";
gotoAndPlay ("hide");
}
Symbol 21 Button
on (release) {
getURL ("javascript:gotoCodeSection();");
}
Symbol 26 MovieClip Frame 1
stop();
Symbol 26 MovieClip Frame 12
stop();
Symbol 30 MovieClip Frame 1
stop();
Symbol 30 MovieClip Frame 2
play();
Symbol 30 MovieClip Frame 7
stop();
_quality = "HIGH";
var codeVars = new LoadVars();
codeVars.id = 3;
codeVars.onLoad = function (success) {
if (success) {
var _local1 = new String(codeVars.code);
code_txt.text = _local1.toUpperCase();
} else {
trace("error loading code data");
}
};
codeVars.sendAndLoad("../getCode.php", codeVars, "POST");
Symbol 30 MovieClip Frame 12
gotoAndStop (1);
Symbol 37 MovieClip [balloon_floater] Frame 1
stop();
this.gotoAndStop(random(5) + 1);
this._y = 250;
this._x = random(300) + 10;
this.speed = random(4) + 1;
this.sway = Math.floor(Math.random() * -2) + 2;
this.onEnterFrame = function () {
var _local1 = this;
_local1._y = _local1._y - _local1.speed;
_local1._x = _local1._x + _local1.sway;
if (_local1._y < -20) {
removeMovieClip(_local1);
}
};
Symbol 38 MovieClip Frame 1
balloonNum = 0;
this.onEnterFrame = function () {
if (random(20) == 5) {
balloonNum++;
var balloonClip = this.attachMovie("balloon_floater", "balloon" + balloonNum, balloonNum);
}
};
Symbol 45 MovieClip Frame 1
totalK = Math.round(_root.getBytesTotal() / 1024);
this.onEnterFrame = function () {
loadedK = Math.round(_root.getBytesLoaded() / 1024);
percent = loadedK / totalK;
loadedString = (((loadedK + "k") + " / ") + totalK) + "k";
loader.bar._x = (percent * 97) - 97;
if (percent == 1) {
_parent.gotoAndPlay("title");
}
};
Symbol 115 Button
on (release) {
stopAllSounds();
gotoAndPlay ("highscore");
}
Symbol 119 Button
on (release) {
gotoAndPlay ("instructions");
}
Symbol 123 Button
on (release) {
gotoAndStop ("choose");
}
Symbol 126 Button
on (release) {
_parent.gotoAndStop("choose");
}
Symbol 143 Button
on (press) {
instructionsClip._y = Math.min(instructionsClip._y + 20, 0);
}
Symbol 144 Button
on (press) {
instructionsClip._y = Math.max(instructionsClip._y - 20, -300);
}
Symbol 147 Button
on (release) {
_global.playerType = "boy";
_global.startGame();
}
Symbol 166 MovieClip Frame 1
_global.player.checkForSwing = false;
stop();
Symbol 166 MovieClip Frame 2
_global.player.checkForSwing = false;
Symbol 166 MovieClip Frame 3
_global.player.checkForSwing = false;
Symbol 166 MovieClip Frame 4
_global.player.checkForSwing = true;
Symbol 166 MovieClip Frame 5
_global.player.checkForSwing = true;
Symbol 166 MovieClip Frame 6
_global.player.checkForSwing = false;
Symbol 166 MovieClip Frame 7
_global.player.checkForSwing = false;
_root.keysCleared.swing = false;
gotoAndStop (1);
Symbol 170 Button
on (release) {
_global.playerType = "girl";
_global.startGame();
}
Symbol 173 MovieClip Frame 1
_global.player.checkForSwing = false;
stop();
Symbol 173 MovieClip Frame 2
_global.player.checkForSwing = false;
Symbol 173 MovieClip Frame 3
_global.player.checkForSwing = false;
Symbol 173 MovieClip Frame 4
_global.player.checkForSwing = true;
Symbol 173 MovieClip Frame 5
_global.player.checkForSwing = true;
Symbol 173 MovieClip Frame 6
_global.player.checkForSwing = false;
Symbol 173 MovieClip Frame 7
_global.player.checkForSwing = false;
_root.keysCleared.swing = false;
gotoAndStop (1);
Symbol 180 MovieClip Frame 1
stop();
Symbol 183 MovieClip Frame 10
stop();
Symbol 193 MovieClip Frame 1
stop();
Symbol 194 MovieClip [boy] Frame 1
stop();
Symbol 207 MovieClip [explosion_small] Frame 12
stop();
removeMovieClip(_parent._parent);
Symbol 208 MovieClip Frame 1
stop();
Symbol 208 MovieClip Frame 35
_parent.instanceObject.isInjured = false;
gotoAndStop (1);
Symbol 208 MovieClip Frame 40
stop();
Symbol 209 MovieClip [chicken] Frame 1
stop();
Symbol 215 MovieClip [gum_bonus] Frame 1
stop();
var xVel = (Math.floor(Math.random() * 6) - 2);
var randY = Math.floor(Math.random() * -1);
var grav = 2;
var vel = -20;
var bounces = 0;
var startY = this._y;
var startX = _global.levelObj.x;
var localXPos = this._x;
if (this.isEnding != true) {
_global.gameSound.gumPop_sound.start();
}
gotoAndStop(random(2) + 1);
this.onEnterFrame = function () {
var _local1 = this;
var _local2 = _global;
if (bounces < 5) {
if ((_local1._y > 200) && (_local1.isEnding != true)) {
vel = vel * -0.5;
_local1._y = 200;
bounces++;
} else {
vel = vel + randY;
vel = vel + grav;
_local1._y = _local1._y + vel;
localXPos = localXPos + xVel;
}
}
_local1._x = localXPos + (_local2.levelObj.x - startX);
if (_local1.isEnding != true) {
if (_local1.gum.hitTest(_local2.player.boundingBox)) {
_local2.gameSound.bonus_sound.start();
_local2.gotGumPowerUp();
removeMovieClip(_local1);
}
}
if ((_local1._x < -50) || (_local1._y > 800)) {
removeMovieClip(_local1);
}
};
Symbol 227 MovieClip Frame 9
stop();
Symbol 229 MovieClip Frame 1
stop();
Symbol 229 MovieClip Frame 50
stop();
Symbol 241 MovieClip Frame 11
_parent.gotoAndStop("warn");
Symbol 243 MovieClip Frame 18
removeMovieClip(_parent._parent);
Symbol 244 MovieClip Frame 1
stop();
Symbol 244 MovieClip Frame 68
stop();
Symbol 253 MovieClip Frame 6
_parent.boundingBox._x = -125;
Symbol 253 MovieClip Frame 15
_parent.boundingBox._x = -150;
Symbol 253 MovieClip Frame 23
_parent.boundingBox._x = -180;
Symbol 255 MovieClip Frame 12
stop();
removeMovieClip(_parent._parent);
Symbol 256 MovieClip Frame 1
boundingBox._x = -50;
stop();
Symbol 256 MovieClip Frame 7
boundingBox._x = -50;
stop();
Symbol 256 MovieClip Frame 55
stop();
Symbol 263 MovieClip Frame 5
stop();
Symbol 268 MovieClip Frame 12
stop();
removeMovieClip(_parent._parent);
Symbol 269 MovieClip Frame 1
stop();
boundingBox._x = -52;
boundingBox._y = -42;
Symbol 269 MovieClip Frame 60
stop();
Symbol 273 MovieClip Frame 1
stop();
Symbol 273 MovieClip Frame 24
_parent.instanceObject.isInjured = false;
gotoAndStop (1);
Symbol 273 MovieClip Frame 32
stop();
Symbol 274 MovieClip [donkey] Frame 1
stop();
Symbol 284 MovieClip Frame 1
stop();
Symbol 284 MovieClip Frame 28
gotoAndStop ("idle");
Symbol 284 MovieClip Frame 49
_parent.instanceObject.isInjured = false;
gotoAndStop (1);
Symbol 284 MovieClip Frame 54
stop();
Symbol 287 MovieClip Frame 1
stop();
Symbol 287 MovieClip Frame 35
stop();
Symbol 292 MovieClip [points] Frame 22
stop();
removeMovieClip(this);
Symbol 293 MovieClip Frame 1
stop();
Symbol 294 MovieClip Frame 10
stop();
Symbol 302 MovieClip Frame 1
stop();
Symbol 303 MovieClip [girl] Frame 1
stop();
Symbol 437 MovieClip Frame 1
stop();
Symbol 481 MovieClip Frame 1
function padNumber(num, places) {
var _local2 = String(num);
var _local3 = places - _local2.length;
var _local1 = 0;
while (_local1 < _local3) {
_local2 = "0" + _local2;
_local1++;
}
return(_local2);
}
stop();
timeBonus = (jfBonus = (totalBonus = 0));
Symbol 481 MovieClip Frame 16
_parent.timeBar.bar._x = _parent.timeBar.bar._x - 2;
if (_parent.timeBar.bar._x > -97) {
timeBonus = timeBonus + 50;
time.timeString = padNumber(timeBonus, 6);
_global.gameSound.pointsCount_sound.start();
gotoAndPlay ("time");
} else {
_global.gameSound.bonusTwinkle_sound.start();
play();
}
Symbol 481 MovieClip Frame 49
jfBonus = _global.levelObj.juicyFruitsCaught * 100;
jf.jfString = padNumber(jfBonus, 6);
_global.gameSound.bonusTwinkle_sound.start();
Symbol 481 MovieClip Frame 93
totalBonus = timeBonus + jfBonus;
_global.playerScore = _global.playerScore + totalBonus;
total.totalString = padNumber(totalBonus, 6);
_parent.scoreMC.score = padNumber(_global.playerScore, 6);
_global.gameSound.bonusTwinkle_sound.start();
Symbol 481 MovieClip Frame 155
if (_global.currentLevel == 4) {
_global.levelObj.gotoWinScene();
} else {
_global.currentLevel++;
_global.levelObj.newLevel(_global.currentLevel);
_global.levelObj.clip.setMask(null);
}
gotoAndStop (1);
Symbol 486 MovieClip Frame 5
i++;
var explosionclip = this.attachMovie("gum_bonus", "gumbonus" + i, i);
explosionClip._x = random(300) + 10;
explosionClip._y = 260;
explosionClip.isEnding = true;
Symbol 490 MovieClip Frame 1
stop();
Symbol 490 MovieClip Frame 15
function restart() {
clearInterval(restartInterval);
_parent.play();
}
function addHighScore() {
var i;
i = 0;
while (i < 2) {
var _local3 = attachMovie("highscoreObject", "score_" + highScoreNum, 10 + highScoreNum);
var score = _global.highScore_array[highScoreNum].score;
var _local1 = String(score);
var _local2;
var addZeroes = (6 - _local1.length);
_local2 = 0;
while (_local2 < addZeroes) {
_local1 = "0" + _local1;
_local2++;
}
_local3.score = _local1;
_local3.initials = highScore_array[highScoreNum].initials;
_local3._x = startingPoint.x + (i * 155);
_local3._y = startingPoint.y + (Math.floor(highScoreNum / 2) * 40);
highScoreNum++;
i++;
}
if (highScoreNum == 10) {
clearInterval(highScoreInterval);
}
}
stop();
highScoreNum = 0;
startingPoint = {x:12, y:40};
restartInterval = setInterval(restart, 8000);
highScoreInterval = setInterval(addHighScore, 250);
Symbol 498 MovieClip Frame 1
underscore._visible = false;
Symbol 500 MovieClip Frame 1
function padNumber(num, places) {
var _local2 = String(num);
var _local3 = places - _local2.length;
var _local1 = 0;
while (_local1 < _local3) {
_local2 = "0" + _local2;
_local1++;
}
return(_local2);
}
stop();
playerScore_string = padNumber(_global.playerScore, 6);
currentInitial = 1;
key.addListener(this);
this.onKeyUp = function () {
var _local1 = this;
if ((Key.getCode() >= 65) && (Key.getCode() <= 90)) {
_local1["initial" + currentInitial].character = String.fromCharCode(Key.getAscii()).toUpperCase();
_local1["initial" + currentInitial].underscore._visible = false;
_global.playerInitials = _global.playerInitials + _local1["initial" + currentInitial].character;
if (currentInitial < 3) {
currentInitial++;
_local1["initial" + currentInitial].underscore._visible = true;
_local1["initial" + currentInitial].character = "";
} else {
key.removeListener(_local1);
play();
}
}
};
Symbol 500 MovieClip Frame 9
stop();
_global.submitHighScore();
Symbol 501 MovieClip Frame 1
stop();
initialBox.initial1.character = "";
initialBox.initial1.underscore._visible = true;
Symbol 501 MovieClip Frame 15
stop();
initialBox.initial1.character = "";
initialBox.initial1.underscore._visible = true;
Symbol 501 MovieClip Frame 31
stop();
Symbol 505 MovieClip Frame 1
this._visible = false;