Frame 1
amount = _root.getBytesLoaded() / _root.getBytesTotal();
lightberry.setMask(masker);
masker._yscale = amount * 100;
per = Math.round(amount * 100);
ptext.text = per + "%";
Frame 2
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
gotoAndStop (4);
} else {
gotoAndPlay (1);
}
Frame 4
function restart() {
if (!restarted) {
restarted = true;
slug.holdingBerry = false;
shine.play();
crush.start();
clearInterval(giants);
giants = setInterval(dropGiant, gi);
cake.reset();
slug._x = sx;
slug._y = sy;
slug.vx = (slug.vy = 0);
slug._xscale = 100;
slug.swapDepths(4);
cam.shake = 0;
setTimeout(woop, 120);
}
}
function woop() {
tries++;
restarted = false;
cake.health = 6;
slug.holdingBerry = false;
}
function dropGiant() {
_root.attachMovie("giant", "g" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
}
function boom() {
var _local2 = 0;
while (_local2 < 16) {
bmr++;
_root.attachMovie("dot", "d" + bmr, _root.getNextHighestDepth());
_root["d" + bmr]._x = bx;
_root["d" + bmr]._y = by;
cake.shake = 20;
_local2++;
}
}
function win() {
if (!hasWon) {
cake.shake = 22;
clearInterval(giants);
bgm.stop();
quake.start();
hit.start();
fading = true;
slug.swapDepths(4);
hasWon = true;
}
}
_root.kongregateServices.connect();
if (!bgm) {
var bgm = new Sound();
bgm.attachSound("battle");
bgm.setVolume(85);
bgm.start(0, 9999);
}
gi = 1880;
giants = setInterval(dropGiant, gi);
sx = slug._x;
sy = slug._y;
shine.swapDepths(5);
var restarted = false;
var crush = new Sound();
crush.attachSound("crush");
var hit = new Sound();
hit.attachSound("hit");
var quake = new Sound();
quake.attachSound("quaker");
var tries = 1;
var bmr = 0;
var fading = false;
var hasWon = false;
var cm = new ContextMenu();
cm.builtInItems.forward_back = false;
cm.builtInItems.play = false;
cm.builtInItems.rewind = false;
cm.builtInItems.loop = false;
cm.builtInItems.zoom = false;
_root.menu = cm;
Frame 5
slug.unloadMovie();
cake.unloadMovie();
fader.unloadMovie();
Frame 29
_root.kongregateStats.submit("Tries", tries);
Frame 2362
stop();
if (tries == 1) {
ender = " try.";
} else {
ender = " tries.";
}
etext.text = ("You managed to kill the cake in " + tries) + ender;
Symbol 7 MovieClip [bouncer] Frame 1
var vx;
var vy;
var good;
g = 1;
r = _width / 2;
f = 0.8;
sw = Stage.width;
sh = Stage.height;
sensor._visible = 0;
min = 11.7;
this.onEnterFrame = function () {
if (_root.restarted) {
this.unloadMovie();
}
_rotation = (_rotation + vx);
vy = vy + g;
_x = (_x + vx);
_y = (_y + vy);
aby = Math.abs(vy);
if ((_y + r) > sh) {
_y = (sh - r);
vy = vy * (-f);
vx = vx * f;
}
if ((_x - r) < 0) {
_x = r;
vx = vx * (-f);
}
if ((_x + r) > sw) {
_x = (sw - r);
vx = vx * (-f);
}
if (sensor.hitTest(_root.slug.sensor)) {
if (aby < min) {
if (Key.isDown(40) && (!_root.slug.holdingBerry)) {
_root.slug.holdingBerry = true;
this.unloadMovie();
}
} else if (!good) {
_root.slug.holdingBerry = false;
_root.restart();
this.unloadMovie();
}
}
if (sensor.hitTest(_root.cake.base) && (good)) {
_root.cake.health--;
_root.hit.start();
_root.bx = _x;
_root.by = _y;
_root.boom();
this.unloadMovie();
}
};
Symbol 9 MovieClip [giant] Frame 1
vx = (vy = 0);
f = 0.6;
g = 1.4;
var hasBounced = false;
sw = Stage.width;
sh = Stage.height;
r = _height / 2;
_x = _root.slug._x;
_y = ((-r) - 5);
var bump = new Sound();
bump.attachSound("bounce");
this.onEnterFrame = function () {
if (_root.restarted) {
this.unloadMovie();
}
dx = _root.slug._x - _x;
if (_y < (sh / 2)) {
vx = dx / 52;
}
vy = vy + g;
_y = (_y + vy);
_x = (_x + vx);
if ((_y > (sh - r)) && (!hasBounced)) {
_y = (sh - r);
vy = vy * (-f);
hasBounced = true;
bump.start();
}
if (_y > (sh + _height)) {
this.unloadMovie();
}
if (this.hitTest(_root.slug.sensor)) {
_root.restart();
this.unloadMovie();
}
};
Symbol 11 MovieClip [dot] Frame 1
top = 8;
mid = top / 2;
vx = (Math.random() * top) - mid;
vy = (Math.random() * top) - mid;
g = 1;
sh = Stage.height;
this.onEnterFrame = function () {
vy = vy + g;
_x = (_x + vx);
_y = (_y + vy);
if (_y > (sh + 5)) {
this.unloadMovie();
}
};
Symbol 14 MovieClip [flash] Frame 1
stop();
Symbol 32 MovieClip Frame 1
function firstShot() {
shootBerry();
shots = setInterval(shootBerry, 6000);
}
function shootBerry() {
if (current <= 6) {
k++;
cb = home["b" + current];
cb._visible = false;
_root.attachMovie("bouncer", "br" + k, _root.getNextHighestDepth());
_root["br" + k].good = false;
_root["br" + k]._x = _x + cb._x;
_root["br" + k]._y = _y + cb._y;
dx = _root.slug._x - _root["br" + k]._x;
_root["br" + k].vy = -10;
_root["br" + k].vx = dx / 30;
current++;
}
}
function reset() {
cb = undefined;
b1._visible = (b2._visible = (b3._visible = (b4._visible = (b5._visible = (b6._visible = true)))));
current = 1;
health = 6;
clearTimeout(begin);
begin = setTimeout(firstShot, 1500);
clearInterval(shots);
}
var health = 6;
var current = 1;
var home = this;
var k = 0;
begin = setTimeout(firstShot, 1500);
var shake = 0;
var stx = _x;
this.onEnterFrame = function () {
if ((shake > 0) && (health > 0)) {
shake--;
}
_x = ((stx + (Math.random() * shake)) - (shake / 2));
if (health <= 0) {
_root.win();
clearTimeout(begin);
clearInterval(shots);
}
};
Symbol 36 MovieClip Frame 1
vx = (vy = 0);
g = 1;
s = 3;
f = 0.7;
r = base._width / 2;
sw = Stage.width;
sh = Stage.height;
jumping = false;
var holdingBerry = false;
b = 0;
force = 11;
sensor._visible = false;
this.onEnterFrame = function () {
vx = vx * f;
_x = (_x + vx);
_y = (_y + vy);
if (_y > sh) {
vy = 0;
_y = sh;
jumping = false;
} else {
vy = vy + g;
}
if (Key.isDown(38)) {
if (!jumping) {
vy = -12;
jumping = true;
}
}
if ((_x - r) < 0) {
_x = r;
} else if (Key.isDown(37)) {
vx = vx - s;
_xscale = -100;
}
if ((_x + r) > sw) {
_x = (sw - r);
} else if (Key.isDown(39)) {
vx = vx + s;
_xscale = 100;
}
if (holdingBerry) {
berry._alpha = 100;
if (Key.isDown(38) && (!base.hitTest(_root.cake.base))) {
holdingBerry = false;
b++;
_root.attachMovie("bouncer", "sb" + b, _root.getNextHighestDepth());
_root["sb" + b].swapDepths(this);
_root["sb" + b]._x = _x;
_root["sb" + b]._y = _y - 45;
_root["sb" + b].vy = -12;
_root["sb" + b].good = true;
if (_xscale > 0) {
_root["sb" + b].vx = force;
} else {
_root["sb" + b].vx = -force;
}
}
} else {
berry._alpha = 0;
}
};
Symbol 40 MovieClip Frame 1
_alpha = 0;
sp = 0.6;
this.onEnterFrame = function () {
this.swapDepths(120);
if (_root.fading) {
_alpha = (_alpha + sp);
}
if (_alpha >= 100) {
_root.play();
}
};