Frame 1
bytes_loaded = Math.round(_root.getBytesLoaded());
bytes_total = Math.round(_root.getBytesTotal());
getPercent = bytes_loaded / bytes_total;
_root.progBar._width = getPercent * 500;
_root.progText = ("Loading " + Math.round(getPercent * 100)) + "%";
if (bytes_loaded == bytes_total) {
gotoAndPlay (3);
}
Frame 2
gotoAndPlay (1);
Frame 3
if (Key.isDown(13)) {
gotoAndPlay (5);
}
Frame 4
gotoAndPlay (3);
Frame 5
function moveStuff() {
if (timer > 0) {
if (Key.isDown(37)) {
this._x = this._x - this.speed;
this.play();
walkingSound.start(0.05, 0);
}
if (Key.isDown(39)) {
this._x = this._x + this.speed;
this.play();
walkingSound.start(0.05, 0);
}
if (Key.isDown(38)) {
this._y = this._y - this.speed;
this.play();
walkingSound.start(0.05, 0);
}
if (Key.isDown(40)) {
this._y = this._y + this.speed;
this.play();
walkingSound.start(0.05, 0);
}
if (Key.isDown(32)) {
if (bulletMax < ammo) {
walkingSound.stop();
laserSound.start();
this_x = getProperty(this, _x);
this_y = getProperty(this, _y);
duplicateMovieClip ("_root.laser", "laser" + n, n);
setProperty("laser" + n, _x , this_x + 23);
setProperty("laser" + n, _y , this_y - 15);
ammo = ammo - 1;
n++;
}
}
if (this._x > (StageWidth + (this._width / 2))) {
this._x = -(this._width / 2);
}
if (this._x < (-(this._width / 2))) {
this._x = StageWidth + (this._width / 2);
}
if (this._y > (StageHeight + (this._height / 2))) {
this._y = -(this._height / 2);
}
if (this._y < (-(this._height / 2))) {
this._y = StageHeight + (this._height / 2);
}
}
}
var n = 0;
var hit = false;
var score = 0;
var points = 5280;
var enemyPoints = 50;
var ammo = 10;
var bulletMax = 0;
var timer = 10;
var timerSpeed = 0.06;
walkingSound = new Sound(this);
walkingSound.attachSound("knock.mp3");
laserSound = new Sound(this);
laserSound.attachSound("laser.mp3");
enemySound = new Sound(this);
enemySound.attachSound("die.mp3");
treasureSound = new Sound(this);
treasureSound.attachSound("square.mp3");
StageWidth = 550;
StageHeight = 400;
_global.levelNum = 1;
_global.nextLevel = function () {
levelNum++;
if (levelNum == 2) {
gotoAndPlay (11);
}
if (levelNum == 3) {
gotoAndPlay (17);
}
};
_global.firstLevel = function () {
if (levelNum == 2) {
levelNum--;
gotoAndPlay (5);
}
if (levelNum == 3) {
levelNum = levelNum - 2;
gotoAndPlay (5);
}
if (levelNum == 1) {
gotoAndPlay (5);
}
};
Frame 6
box_mc.speed = 5;
box_mc.onEnterFrame = moveStuff;
if (hit == true) {
removeMovieClip(this.enemy_mc);
hit = false;
this.score = this.score + this.enemyPoints;
setProperty(_root.enemy_mc, _x , Math.random() * (Stage.width - 300));
}
this.timer = this.timer - this.timerSpeed;
this.ammoText.text = "Ammo: " + ammo;
this.scoreText.text = "Score: " + score;
this.timerText.text = "Time: " + Math.round(this.timer);
Frame 7
if (timer >= 0) {
gotoAndPlay (6);
} else {
enemySound.start();
this.box_mc.gotoAndPlay(11);
gotoAndPlay (8);
}
Frame 8
if (Key.isDown(13)) {
firstLevel();
}
Frame 9
gotoAndPlay (8);
Frame 10
gotoAndPlay (11);
Frame 11
function moveStuff() {
if (timer > 0) {
if (Key.isDown(37)) {
this._x = this._x - this.speed;
this.play();
walkingSound.start(0.05, 0);
}
if (Key.isDown(39)) {
this._x = this._x + this.speed;
this.play();
walkingSound.start(0.05, 0);
}
if (Key.isDown(38)) {
this._y = this._y - this.speed;
this.play();
walkingSound.start(0.05, 0);
}
if (Key.isDown(40)) {
this._y = this._y + this.speed;
this.play();
walkingSound.start(0.05, 0);
}
if (Key.isDown(32)) {
if (bulletMax < ammo) {
walkingSound.stop();
laserSound.start();
this_x = getProperty(this, _x);
this_y = getProperty(this, _y);
duplicateMovieClip ("_root.laser", "laser" + n, n);
setProperty("laser" + n, _x , this_x + 23);
setProperty("laser" + n, _y , this_y - 15);
ammo = ammo - 1;
n++;
}
}
if (this._x > (StageWidth + (this._width / 2))) {
this._x = -(this._width / 2);
}
if (this._x < (-(this._width / 2))) {
this._x = StageWidth + (this._width / 2);
}
if (this._y > (StageHeight + (this._height / 2))) {
this._y = -(this._height / 2);
}
if (this._y < (-(this._height / 2))) {
this._y = StageHeight + (this._height / 2);
}
}
}
var n = 0;
var hit = false;
var points = 2454;
var enemyPoints = 50;
var ammo = 10;
var bulletMax = 0;
var timerSpeed = 0.06;
StageWidth = 550;
StageHeight = 400;
Frame 12
box_mc.speed = 5;
box_mc.onEnterFrame = moveStuff;
if (hit == true) {
removeMovieClip(this.enemy_mc);
hit = false;
this.score = this.score + this.enemyPoints;
setProperty(_root.enemy_mc, _x , Math.random() * (Stage.width - 300));
}
this.timer = this.timer - this.timerSpeed;
this.ammoText.text = "Ammo: " + ammo;
this.scoreText.text = "Score: " + score;
this.timerText.text = "Time: " + Math.round(this.timer);
Frame 13
if (timer >= 0) {
gotoAndPlay (12);
} else {
enemySound.start();
this.box_mc.gotoAndPlay(11);
gotoAndPlay (14);
}
Frame 14
if (Key.isDown(13)) {
firstLevel();
}
Frame 15
gotoAndPlay (14);
Frame 16
gotoAndPlay (17);
Frame 17
function moveStuff() {
if (timer > 0) {
if (Key.isDown(37)) {
this._x = this._x - this.speed;
this.play();
walkingSound.start(0.05, 0);
}
if (Key.isDown(39)) {
this._x = this._x + this.speed;
this.play();
walkingSound.start(0.05, 0);
}
if (Key.isDown(38)) {
this._y = this._y - this.speed;
this.play();
walkingSound.start(0.05, 0);
}
if (Key.isDown(40)) {
this._y = this._y + this.speed;
this.play();
walkingSound.start(0.05, 0);
}
if (Key.isDown(32)) {
if (bulletMax < ammo) {
walkingSound.stop();
laserSound.start();
this_x = getProperty(this, _x);
this_y = getProperty(this, _y);
duplicateMovieClip ("_root.laser", "laser" + n, n);
setProperty("laser" + n, _x , this_x + 23);
setProperty("laser" + n, _y , this_y - 15);
ammo = ammo - 1;
n++;
}
}
if (this._x > (StageWidth + (this._width / 2))) {
this._x = -(this._width / 2);
}
if (this._x < (-(this._width / 2))) {
this._x = StageWidth + (this._width / 2);
}
if (this._y > (StageHeight + (this._height / 2))) {
this._y = -(this._height / 2);
}
if (this._y < (-(this._height / 2))) {
this._y = StageHeight + (this._height / 2);
}
}
}
var n = 0;
var hit = false;
var points = 10;
var enemyPoints = 50;
var ammo = 10;
var bulletMax = 0;
var timerSpeed = 0.06;
StageWidth = 550;
StageHeight = 400;
Frame 18
box_mc.speed = 5;
box_mc.onEnterFrame = moveStuff;
if (hit == true) {
removeMovieClip(this.enemy_mc);
hit = false;
this.score = this.score + this.enemyPoints;
setProperty(this.enemy_mc, _x , -100);
gotoAndPlay (25);
}
this.timer = this.timer - this.timerSpeed;
this.ammoText.text = "Ammo: " + ammo;
this.scoreText.text = "Score: " + score;
this.timerText.text = "Time: " + Math.round(this.timer);
Frame 19
if (timer >= 0) {
gotoAndPlay (18);
} else {
enemySound.start();
this.box_mc.gotoAndPlay(11);
gotoAndPlay (20);
}
Frame 20
if (Key.isDown(13)) {
firstLevel();
}
Frame 21
gotoAndPlay (20);
Frame 26
timer = 0;
Frame 109
Frame 417
if (Key.isDown(13)) {
stopAllSounds();
firstLevel();
} else {
firstLevel();
}
Symbol 38 MovieClip Frame 1
_y = (_y - 5);
if (Number(_y) < 55) {
removeMovieClip("");
}
if (this.hitTest(_parent.enemy_mc) == true) {
_parent.hit = true;
removeMovieClip("");
_root.enemySound.start(1, 0);
}
Symbol 38 MovieClip Frame 2
_y = (_y - 5);
if (Number(_y) < 0) {
removeMovieClip("");
}
gotoAndPlay (1);
Symbol 39 MovieClip Frame 1
if (this.hitTest(_root.box_mc) == true) {
if (Key.isDown(37)) {
_parent.box_mc._x = _parent.box_mc._x + _parent.box_mc.speed;
}
if (Key.isDown(39)) {
_parent.box_mc._x = _parent.box_mc._x - _parent.box_mc.speed;
}
if (Key.isDown(38)) {
_parent.box_mc._y = _parent.box_mc._y + _parent.box_mc.speed;
}
if (Key.isDown(40)) {
_parent.box_mc._y = _parent.box_mc._y - _parent.box_mc.speed;
}
}
Symbol 39 MovieClip Frame 2
gotoAndPlay (1);
Symbol 42 MovieClip Frame 1
if (this.hitTest(_root.box_mc) == true) {
if (_parent.ammo < 10) {
_parent.ammo = _parent.ammo + 1;
}
_root.treasureSound.start();
_parent.score = _parent.score + _parent.points;
nextLevel();
}
Symbol 42 MovieClip Frame 2
gotoAndPlay (1);
Symbol 43 MovieClip Frame 1
stop();
Symbol 43 MovieClip Frame 3
stop();
Symbol 43 MovieClip Frame 4
gotoAndPlay (1);
Symbol 43 MovieClip Frame 21
stop();
Symbol 77 MovieClip Frame 263
stop();