Frame 1
mySound = new Sound(this);
mySound.attachSound("song");
mySound.start(0, 9);
var myMenu = new ContextMenu();
myMenu.hideBuiltInItems();
var item1 = new ContextMenuItem("Made", function () {
});
var item2 = new ContextMenuItem("by", function () {
});
var item3 = new ContextMenuItem("-liam-", function () {
});
var item4 = new ContextMenuItem("and", function () {
});
var item5 = new ContextMenuItem("bigexplosions", function () {
});
myMenu.customItems.push(item1);
myMenu.customItems.push(item2);
myMenu.customItems.push(item3);
myMenu.customItems.push(item4);
myMenu.customItems.push(item5);
_root.menu = myMenu;
function checkSpace() {
if (Key.isDown(32) && (!notPressed)) {
notPressed = true;
clearInterval(id);
setTimeout(function () {
gotoAndPlay (2);
}, 50);
}
}
stop();
id = setInterval(checkSpace, 10);
Frame 2
function makeBomb() {
_root.score++;
i++;
duplicateMovieClip (bomb, "bomb" + i, i);
_root["bomb" + i].speed = random(3) + 4;
clearInterval(bombMaking);
bombMaking = setInterval(makeBomb, random(1000) + 1000);
}
function genEffect() {
bmp.perlinNoise(random(550), random(400), random(10), random(100), false, false, random(500), false);
if (bmp.getPixel(0, 0) == 0) {
bmp.floodFill(0, 0, 16777215);
}
}
i = 0;
score = 0;
stop();
bombMaking = setInterval(makeBomb, random(1000) + 1000);
var bmp = (new flash.display.BitmapData(550, 400, false, 16777215));
_root.attachBitmap(bmp, -16383);
genEffect();
onEnterFrame = function () {
if (Key.isDown(16) && (!wait)) {
genEffect();
wait = true;
setTimeout(function () {
wait = false;
}, 100);
}
};
Instance of Symbol 30 MovieClip "hero" in Frame 2
onClipEvent (load) {
var blur = (new flash.filters.BlurFilter(0, 0, 10));
wide = _width;
ready = false;
setTimeout(function () {
ready = true;
}, 500);
}
onClipEvent (enterFrame) {
function jump() {
if ((_y > end_y) && (!notJump)) {
jumpup = true;
} else {
jumpup = false;
notJump = true;
}
if (jumpup) {
_y = (_y - 5);
}
if (!jumpup) {
_y = (_y + 5);
}
if ((!jumpup) && (this.hitTest(_root.ground))) {
clearInterval(jumpingID);
}
if (_y > start_y) {
this.gotoAndPlay(1);
blur.blurY = 0;
clearInterval(jumpingID);
setTimeout(function () {
jumping = false;
}, 100);
_y = start_y;
}
}
this.filters = [blur];
if (Key.isDown(37)) {
walking = true;
if ((_x - wide) > 0) {
this._x = this._x - 5;
}
this._xscale = -63.5040283203125;
if (_currentframe == 1) {
gotoAndPlay (2);
}
} else if (Key.isDown(39)) {
walking = true;
this._xscale = 63.5040283203125;
if (550 > (_x + wide)) {
this._x = this._x + 5;
}
if (_currentframe == 1) {
gotoAndPlay (2);
}
} else if (Key.isDown(32) && (!jumping)) {
walking = false;
if (_currentframe == 1) {
gotoAndStop (3);
}
} else {
walking = false;
if ((_currentframe != 1) && (!jumping)) {
gotoAndPlay (1);
}
}
if ((Key.isDown(32) && (!jumping)) && (ready)) {
jumping = true;
start_y = _y;
end_y = start_y - 150;
notJump = false;
blur.blurY = 5;
jumpingID = setInterval(jump, 10);
}
if ((!walking) && (_currentframe == 2)) {
gotoAndPlay (1);
}
if ((blur.blurY == 0) && (this._currentframe == 3)) {
gotoAndPlay (1);
}
if (_root._currentframe != 2) {
clearInterval(jumpingID);
}
}
Instance of Symbol 32 MovieClip "bomb" in Frame 2
onClipEvent (enterFrame) {
this.cacheAsBitmap = true;
if (_root._currentframe != 2) {
this.removeMovieClip();
}
if (_name != "bomb") {
if (0 > (_x + _width)) {
removeMovieClip(this);
}
_x = (_x - this.speed);
if (hitTest(_root.hero.hitme)) {
_root.score--;
_root.gotoAndPlay(2);
_root.hero.removeMovieClip();
this.removeMovieClip();
}
}
}
Frame 3
function screen() {
(_root._x = 0);
(_root._y = 0);
}
function checkSpace() {
if (Key.isDown(32) && (!notPressed)) {
notPressed = true;
clearInterval(np);
setTimeout(function () {
gotoAndPlay (2);
}, 50);
}
}
stop();
setInterval(screen, 0);
scoretxt.text = ("You saved teh Inglor from " + score) + " bombs!";
if (_root.score <= 5) {
howDid.text = "u did teh suk.";
} else if ((_root.score >= 6) && (_root.score <= 15)) {
howDid.text = "Not a bad score, try harder";
} else if ((_root.score >= 16) && (_root.score <= 30)) {
howDid.text = "Good score!";
} else if (_root.score >= 31) {
howDid.text = "Great score, impressive.";
}
notPressed = undefined;
setTimeout(function () {
np = setInterval(checkSpace, 10);
}, 500);
Symbol 15 MovieClip Frame 1
onEnterFrame = function () {
theScore.text = _root.score + " bombs evaded";
};
Symbol 30 MovieClip Frame 1
stop();
Symbol 30 MovieClip Frame 2
stop();
Symbol 30 MovieClip Frame 3
stop();