Frame 1
_quality = "LOW";
PercentLoaded = (getBytesLoaded() / getBytesTotal()) * 100;
if (PercentLoaded != 100) {
setProperty(bar, _xscale , PercentLoaded);
} else {
gotoAndPlay (3);
}
Frame 2
gotoAndPlay (1);
Frame 3
play.onRelease = function () {
gotoAndPlay ("game");
};
controls.onRelease = function () {
gotoAndStop ("controls");
};
stop();
Frame 4
back.onRelease = function () {
gotoAndStop ("play");
};
stop();
Frame 10
lives = 3;
highscore = 0;
Frame 11
restartAll = false;
stop();
Frame 12
restartAll = false;
Frame 41
restartAll = true;
Frame 44
if (lives <= 0) {
gotoAndPlay ("gameOver");
} else {
gotoAndPlay ("restart");
lives = lives - 1;
}
Frame 47
retry.onRelease = function () {
gotoAndPlay ("play");
};
stop();
Symbol 7 MovieClip [noEnemy] Frame 1
this.onEnterFrame = function () {
if (this._parent.removeVoid == true) {
removeMovieClip(this);
}
};
this._visible = false;
Symbol 9 MovieClip [void] Frame 1
this._visible = false;
Symbol 47 MovieClip Frame 16
gotoAndPlay ("walkLeft");
Symbol 47 MovieClip Frame 32
gotoAndPlay ("walkRight");
Symbol 47 MovieClip Frame 35
stop();
Symbol 47 MovieClip Frame 47
gotoAndPlay ("shellSpin");
Symbol 49 MovieClip Frame 1
this._visible = false;
Symbol 50 MovieClip [enemy_Type_1] Frame 1
directionRight = false;
playOnce = true;
shellSpin = false;
shelled = false;
matrixFind = function () {
space = 40;
MAT_col = Math.round((this._x / space) + 0.5) - 1;
MAT_row = Math.round((this._y / space) + 0.5) - 1;
surfaceFriction_accel = this._parent._parent.midground.map[MAT_row][MAT_col].surfaceFriction_accel;
surfaceFriction_decel = this._parent._parent.midground.map[MAT_row][MAT_col].surfaceFriction_decel;
gravity = this._parent._parent.midground.map[MAT_row][MAT_col].gravity;
name1 = ((("this._parent._parent.midground." + MAT_row) + this._parent._parent.midground.map[MAT_row][MAT_col].clip) + "_") + MAT_col;
if (this._parent._parent.midground.map[MAT_row][MAT_col].hitSurface == true) {
airbourne = false;
this._y = eval (name1)._y;
} else {
airbourne = true;
}
MAT_col = Math.round((this._x / space) + 0.8) - 1;
if (this._parent._parent.midground.map[MAT_row - 1][MAT_col].hitRight == true) {
if (valve_01 == true) {
valve_01 = false;
MAT_col = Math.round((this._x / space) + 40) - 1;
name2 = ((("this._parent._parent.midground." + MAT_row) + this._parent._parent.midground.map[MAT_row][MAT_col + 1].clip) + "_") + (MAT_col + 1);
this._x = eval (name2)._x - 20;
}
directionRight = false;
if (shellSpin == true) {
shellHit = new Sound();
shellHit.attachSound("shell_Wall_Hit");
shellHit.start(0, 1);
xspeed = xspeed * -1;
}
} else {
valve_01 = true;
}
MAT_col = Math.round((this._x / space) + 0.2) - 1;
if (this._parent._parent.midground.map[MAT_row - 1][MAT_col].hitLeft == true) {
if (valve_02 == true) {
valve_02 = false;
MAT_col = Math.round((this._x / space) - 40) - 1;
name3 = ((("this._parent._parent.midground." + MAT_row) + this._parent._parent.midground.map[MAT_row][MAT_col - 1].clip) + "_") + (MAT_col - 1);
this._x = eval (name3)._x + 20;
}
directionRight = true;
if (shellSpin == true) {
shellHit = new Sound();
shellHit.attachSound("shell_Wall_Hit");
shellHit.start(0, 1);
xspeed = xspeed * -1;
}
} else {
valve_02 = true;
}
};
enemyControl = function () {
if (airbourne == false) {
if (directionRight == true) {
playOnce1 = true;
if (playOnce == true) {
enemy.gotoAndPlay("walkRight");
playOnce = false;
}
xspeed = 2;
}
if (directionRight == false) {
playOnce = true;
if (playOnce1 == true) {
enemy.gotoAndPlay("walkLeft");
playOnce1 = false;
}
xspeed = -2;
}
}
};
movement = function () {
this._x = this._x + xspeed;
this._y = this._y * gravity;
};
playOnce3 = true;
playOnce4 = true;
startSpin = 0;
characterHit = function () {
if (this._parent._parent.character.jumpDown == false) {
playOnce3 = true;
playOnce4 = true;
}
if (hitTestObj.hitTest(this._parent._parent.character)) {
if (this._parent._parent.character.jumpDown == true) {
if (startSpin == 0) {
if (playOnce3 == true) {
this._parent._parent.character.reBounce = true;
enemy.gotoAndPlay("shell");
shellSpin = false;
playOnce3 = false;
xspeed = 0;
shelled = true;
startSpin = 1;
}
} else if (playOnce4 == true) {
this._parent._parent.character.reBounce = true;
enemy.gotoAndPlay("shellSpin");
shellSpin = true;
playOnce4 = false;
Xdif = this._x - this._parent._parent.character._x;
xspeed = Xdif / 2;
shelled = true;
startSpin = 0;
}
} else if ((shellSpin == true) && (this._parent._parent.character.reBounce == false)) {
this._parent._parent.character.characterHit = true;
}
if (shelled == false) {
this._parent._parent.character.characterHit = true;
}
}
};
hitEnemy = false;
playValve2 = true;
breakLoop = false;
enemyInteraction = function () {
e_count = 0;
while (e_count < this._parent.enemyArray.length) {
if (breakLoop == false) {
name = "this._parent.enemy_Type_1_" + this._parent.enemyArray[e_count];
if (ID != this._parent.enemyArray[e_count]) {
if (this.hitTest(eval (name))) {
hitEnemy = true;
breakLoop = true;
ID2 = this._parent.enemyArray[e_count];
}
}
}
e_count++;
}
breakLoop = false;
if (hitEnemy == true) {
hitEnemy = false;
if (valve1 == true) {
valve1 = false;
if (directionRight == true) {
directionRight = false;
} else {
directionRight = true;
}
}
} else {
valve1 = true;
}
};
visibleToCharacter = function () {
xdistance = this._x - this._parent._parent.character._x;
if ((xdistance > -800) && (xdistance < 800)) {
inView = true;
if (playOnce_1 == true) {
this._x = X_INI;
this._y = Y_INI;
playOnce_1 = false;
}
playOnce_2 = true;
} else {
playOnce_1 = true;
inView = false;
if (playOnce_2 == true) {
this._x = X_INI;
this._y = Y_INI;
playOnce_2 = false;
}
}
};
this.onEnterFrame = function () {
visibleToCharacter();
enemyInteraction();
if (inView == true) {
this._visible = true;
if (playOnce_ == true) {
playOnce_ = false;
if (directionRight == true) {
enemy.gotoAndPlay("walkRight");
} else {
enemy.gotoAndPlay("walkLeft");
}
}
if (shelled == false) {
enemyControl();
}
shellHit();
characterHit();
matrixFind();
movement();
} else {
playOnce_ = true;
shelled = false;
shellSpin = false;
this._visible = false;
}
};
Symbol 51 MovieClip [levelConstruct_Enemies] Frame 1
X_ini = 0;
Y_ini = 0;
Space = 40;
i = 0;
Y_val = Y_ini;
S = new Object();
S.clip = "noEnemy";
E = new Object();
E.clip = "enemy_Type_1";
removeVoid = false;
map = new Array();
map[0] = [S, S, S, S, S, S, S, S, S, S, S];
map[1] = [S, S, S, S, S, S, S, S, S, S, S];
map[2] = [S, S, S, S, S, S, S, S, S, S, E];
map[3] = [S, S, S, S, S, S, S, S, S, S, S];
map[4] = [S, S, S, S, S, S, S, S, S, S, S];
nameNumber = 0;
enemyArray = new Array();
row = 0;
while (row < map.length) {
col = 0;
while (col < map[row].length) {
name1 = (map[row][col].clip + "_") + nameNumber;
if (col > 0) {
name2 = (map[row][col - 1].clip + "_") + (nameNumber - 1);
} else {
name2 = "";
}
attachMovie(map[row][col].clip, name1, i);
if (map[row][col].clip == "enemy_Type_1") {
enemyArray.push(nameNumber);
eval (name1).ID = nameNumber;
}
nameNumber = nameNumber + 1;
if (row == 0) {
eval (name1)._y = Y_val;
eval (name1).Y_INI = eval (name1)._y;
} else {
if (col == 0) {
Y_val = Y_val + Space;
}
eval (name1)._y = Y_val;
eval (name1).Y_INI = eval (name1)._y;
}
if (col == 0) {
eval (name1)._x = X_ini;
eval (name1).X_INI = eval (name1)._x;
} else {
eval (name1)._x = eval (name2)._x + Space;
eval (name1).X_INI = eval (name1)._x;
}
i++;
col++;
}
removeVoid = true;
row++;
}
Symbol 77 MovieClip Frame 1
X_ini = 0;
Y_ini = 0;
Space = 100;
i = 0;
Y_val = Y_ini;
S = new Object();
S.clip = "void";
B = new Object();
B.clip = "panel_Background1";
V = new Object();
V.clip = "panel_Background2";
map = new Array();
map[0] = [S, S, B, V, S, S, S, B, S, S, S, V, S, S, B, S, B, S, S, V, S, S, S, S, V, S, B, S, V, V, S, S, S];
row = 0;
while (row < map.length) {
col = 0;
while (col < map[row].length) {
name1 = ((row + map[row][col].clip) + "_") + col;
if (col > 0) {
name2 = ((row + map[row][col - 1].clip) + "_") + (col - 1);
} else {
name2 = "";
}
attachMovie(map[row][col].clip, name1, i);
if (row == 0) {
eval (name1)._y = Y_val;
} else {
if (col == 0) {
Y_val = Y_val + Space;
}
eval (name1)._y = Y_val;
}
if (col == 0) {
eval (name1)._x = X_ini;
} else {
eval (name1)._x = eval (name2)._x + Space;
}
i++;
col++;
}
row++;
}
Symbol 78 MovieClip Frame 1
X_ini = 0;
Y_ini = 0;
Space = 40;
i = 0;
Y_val = Y_ini;
S = new Object();
S.clip = "void";
S.surfaceFriction_accel = 1.01;
S.surfaceFriction_decel = 0.99;
S.gravity = 1.05;
S.hitSurface = false;
S.hitRight = false;
S.hitLeft = false;
A = new Object();
A.clip = "panel_Floor1";
A.surfaceFriction_accel = 1.2;
A.surfaceFriction_decel = 0.8;
A.gravity = 1;
A.hitSurface = true;
A.hitRight = false;
A.hitLeft = false;
B = new Object();
B.clip = "panel_Floor2";
B.surfaceFriction_accel = 1.2;
B.surfaceFriction_decel = 0.8;
B.gravity = 1;
B.hitSurface = true;
B.hitRight = false;
B.hitLeft = false;
L = new Object();
L.clip = "panel_Floor_wallLeft";
L.surfaceFriction_accel = 1.2;
L.surfaceFriction_decel = 0.8;
L.gravity = 1;
L.hitSurface = true;
L.hitRight = true;
L.hitLeft = false;
R = new Object();
R.clip = "panel_Floor_wallRight";
R.surfaceFriction_accel = 1.2;
R.surfaceFriction_decel = 0.8;
R.gravity = 1;
R.hitSurface = true;
R.hitRight = false;
R.hitLeft = true;
r = new Object();
r.clip = "panel_wallRight";
r.surfaceFriction_accel = 1.2;
r.surfaceFriction_decel = 0.8;
r.gravity = 1;
r.hitSurface = true;
r.hitRight = false;
r.hitLeft = true;
l = new Object();
l.clip = "panel_wallLeft";
l.surfaceFriction_accel = 1.2;
l.surfaceFriction_decel = 0.8;
l.gravity = 1;
l.hitSurface = true;
l.hitRight = true;
l.hitLeft = false;
D = new Object();
D.clip = "panel_Dirt";
D.hitSurface = false;
D.surfaceFriction_accel = 1.2;
D.surfaceFriction_decel = 0.8;
map = new Array();
map[0] = [D, r, S, S, S, S, S, S, S, S, S, S, l, D];
map[1] = [D, r, S, S, S, S, S, S, S, S, S, S, l, D];
map[2] = [D, r, S, S, S, S, S, S, S, S, S, S, l, D];
map[3] = [D, r, S, S, S, S, S, S, S, S, S, S, l, D];
map[4] = [D, r, S, S, S, S, S, S, S, S, S, S, l, D];
map[5] = [D, r, S, S, S, S, S, S, S, S, S, S, l, D];
map[6] = [D, r, S, S, S, S, S, S, S, S, S, S, l, D];
map[7] = [D, r, S, S, S, S, S, S, S, S, S, S, l, D];
map[8] = [D, D, A, A, A, A, A, A, A, A, A, A, D, D];
map[9] = [D, D, D, D, D, D, D, D, D, D, D, D, D, D];
row = 0;
while (row < map.length) {
col = 0;
while (col < map[row].length) {
name1 = ((row + map[row][col].clip) + "_") + col;
if (col > 0) {
name2 = ((row + map[row][col - 1].clip) + "_") + (col - 1);
} else {
name2 = "";
}
attachMovie(map[row][col].clip, name1, i);
if (row == 0) {
eval (name1)._y = Y_val;
} else {
if (col == 0) {
Y_val = Y_val + Space;
}
eval (name1)._y = Y_val;
}
if (col == 0) {
eval (name1)._x = X_ini;
} else {
eval (name1)._x = eval (name2)._x + Space;
}
i++;
col++;
}
row++;
}
Symbol 80 MovieClip Frame 1
this.onEnterFrame = function () {
score = this._parent._parent.score;
};
Symbol 82 MovieClip Frame 1
stop();
Symbol 82 MovieClip Frame 43
stop();
Symbol 98 MovieClip Frame 2
if (this._parent.idleRight == false) {
gotoAndPlay ("run_Right");
} else {
gotoAndPlay ("idle_Right");
}
Symbol 98 MovieClip Frame 4
if (this._parent.idleLeft == false) {
gotoAndPlay ("run_Left");
} else {
gotoAndPlay ("idle_Left");
}
Symbol 98 MovieClip Frame 5
if (this._parent.idleRight == true) {
gotoAndPlay ("idle_Right");
}
this._parent.JUMP = false;
Symbol 98 MovieClip Frame 6
if (this._parent.idleRight == true) {
gotoAndPlay ("idle_Right");
}
this._parent.JUMP = false;
Symbol 98 MovieClip Frame 7
if (this._parent.idleRight == true) {
gotoAndPlay ("idle_Right");
}
this._parent.JUMP = false;
Symbol 98 MovieClip Frame 8
if (this._parent.idleRight == false) {
gotoAndPlay ("run_Right");
} else {
gotoAndPlay ("idle_Right");
}
Symbol 98 MovieClip Frame 9
if (this._parent.idleLeft == true) {
gotoAndPlay ("idle_Left");
}
this._parent.JUMP = false;
Symbol 98 MovieClip Frame 10
if (this._parent.idleLeft == true) {
gotoAndPlay ("idle_Left");
}
this._parent.JUMP = false;
Symbol 98 MovieClip Frame 11
if (this._parent.idleLeft == true) {
gotoAndPlay ("idle_Left");
}
this._parent.JUMP = false;
Symbol 98 MovieClip Frame 12
if (this._parent.idleLeft == false) {
gotoAndPlay ("run_Left");
} else {
gotoAndPlay ("idle_Left");
}
Symbol 98 MovieClip Frame 47
_root.gotoAndPlay("dead");
Symbol 98 MovieClip Frame 72
this._parent.characterHit = false;
Symbol 99 MovieClip Frame 1
directionRight = true;
JUMP_INI = true;
characterSpeed = 10;
score = 0;
matrixFind = function () {
space = 40;
MAT_col = Math.round((this._x / space) + 0.5) - 1;
MAT_row = Math.round((this._y / space) + 0.5) - 1;
surfaceFriction_accel = this._parent.midground.map[MAT_row][MAT_col].surfaceFriction_accel;
surfaceFriction_decel = this._parent.midground.map[MAT_row][MAT_col].surfaceFriction_decel;
gravity = this._parent.midground.map[MAT_row][MAT_col].gravity;
name1 = ((("this._parent.midground." + MAT_row) + this._parent.midground.map[MAT_row][MAT_col].clip) + "_") + MAT_col;
if (this._parent.midground.map[MAT_row][MAT_col].hitSurface == true) {
score = 0;
jumpHeight2 = 12;
reBounce = false;
jumpDown = false;
jumpAccel = false;
spriteFallSwap = false;
this._y = eval (name1)._y;
if (playOnce == true) {
if (directionRight == true) {
sprite.gotoAndPlay("idle_Right");
} else {
sprite.gotoAndPlay("idle_Left");
}
playOnce = false;
}
JUMP = false;
} else {
playOnce = true;
JUMP = true;
}
};
characterControl = function () {
if (this._parent.midground.map[MAT_row][MAT_col].hitSurface == true) {
if (JUMP_INI == false) {
if (Key.isDown(39)) {
if (firstPress_1 == true) {
xspeed = 1;
firstPress_1 = false;
}
xspeed = xspeed * surfaceFriction_accel;
if (xspeed >= characterSpeed) {
xspeed = characterSpeed;
}
idleRight = false;
if (firstPress == true) {
directionRight = true;
sprite.gotoAndPlay("idle_Right");
firstPress = false;
}
} else {
firstPress_1 = true;
firstPress = true;
idleRight = true;
if (Key.isDown(37) == false) {
xspeed = xspeed * surfaceFriction_decel;
}
}
if (Key.isDown(37)) {
if (firstPress__1 == true) {
xspeed = -1;
firstPress__1 = false;
}
xspeed = xspeed * surfaceFriction_accel;
if (xspeed <= (-characterSpeed)) {
xspeed = -characterSpeed;
}
idleLeft = false;
if (firstPress1 == true) {
directionRight = false;
sprite.gotoAndPlay("idle_Left");
firstPress1 = false;
}
} else {
firstPress__1 = true;
firstPress1 = true;
idleLeft = true;
if (Key.isDown(39) == false) {
xspeed = xspeed * surfaceFriction_decel;
}
}
}
}
if (JUMP == false) {
if (Key.isDown(32)) {
if (firstPress3 == true) {
FX_jump = new Sound();
FX_jump.attachSound("sound_Jump");
FX_jump.start(0, 1);
JUMP_INI = true;
firstPress3 = false;
}
} else {
firstPress3 = true;
}
} else {
if (directionRight == true) {
sprite.gotoAndPlay("jump_Right");
} else {
sprite.gotoAndPlay("jump_Left");
}
if (Key.isDown(39)) {
jumpAccel = true;
if (firstPress == true) {
directionRight = true;
sprite.gotoAndPlay("jump_Right");
firstPress = false;
}
} else {
if (Key.isDown(37) == false) {
jumpAccel = false;
}
firstPress = true;
}
if (Key.isDown(37)) {
jumpAccel = true;
if (firstPress1 == true) {
directionRight = false;
sprite.gotoAndPlay("jump_Left");
firstPress1 = false;
}
} else {
if (Key.isDown(39) == false) {
jumpAccel = false;
}
firstPress1 = true;
}
}
if (jumpAccel == true) {
jumpAccelVAR = 1.1;
if (directionRight == true) {
if (xspeed < 1) {
xspeed = 1;
}
xspeed = xspeed * jumpAccelVAR;
if (xspeed > characterSpeed) {
xspeed = characterSpeed;
}
} else {
if (xspeed > -1) {
xspeed = -1;
}
xspeed = xspeed * jumpAccelVAR;
if (xspeed < (-characterSpeed)) {
xspeed = -characterSpeed;
}
}
}
};
characterMovement = function () {
if (this._parent.midground.map[MAT_row][MAT_col].hitSurface == true) {
if (directionRight == false) {
if (xspeed > -0.1) {
completeStop = true;
xspeed = 0;
} else {
completeStop = false;
}
} else if (xspeed < 0.1) {
completeStop = true;
xspeed = 0;
} else {
completeStop = false;
}
wallHitTest = function () {
if (directionRight == true) {
MAT_col = Math.round((this._x / space) + 0.8) - 1;
if (this._parent.midground.map[MAT_row - 1][MAT_col].hitRight == true) {
name2 = ((("this._parent.midground." + MAT_row) + this._parent.midground.map[MAT_row][MAT_col].clip) + "_") + MAT_col;
this._x = eval (name2)._x - 10;
xspeed = 0;
}
} else {
MAT_col = Math.round((this._x / space) + 0.2) - 1;
if (this._parent.midground.map[MAT_row - 1][MAT_col].hitLeft == true) {
name2 = ((("this._parent.midground." + MAT_row) + this._parent.midground.map[MAT_row][MAT_col].clip) + "_") + MAT_col;
this._x = (eval (name2)._x + 40) + 10;
xspeed = 0;
}
}
};
wallHitTest();
}
if (spriteFallSwap == true) {
if (directionRight == true) {
sprite.gotoAndPlay("fall_Right");
} else {
sprite.gotoAndPlay("fall_Left");
}
wallHitTest();
}
this._x = this._x + xspeed;
};
jumpIni = 15;
jumpHeight = jumpIni;
jumpTimer = 5;
jumpMax_ = 5;
forces = function () {
if (JUMP_INI == true) {
if (Key.isDown(32)) {
jumpTimer = jumpTimer - 0.3;
jumpVal = 0.5;
if (jumpTimer < 3) {
jumpTimer = 3;
jumpVal = 0;
}
jumpHeight = jumpHeight + jumpVal;
}
JUMP = true;
jumpHeight = jumpHeight * 0.89;
this._y = this._y - jumpHeight;
if (jumpHeight < jumpTimer) {
jumpDown = true;
jumpTimer = 5;
JUMP_INI = false;
jumpHeight = jumpIni;
}
gravity = 1;
}
if (gravity > 1) {
spriteFallSwap = true;
}
this._y = this._y * gravity;
};
reBounceFunction = function () {
if (reBounce == true) {
if (playSound1 == true) {
score = score + 1;
score_clip.gotoAndPlay(2);
jumpDown = false;
shellJump = new Sound();
shellJump.attachSound("shell_Jump1");
shellJump.start(0, 1);
playSound1 = false;
}
JUMP = true;
jumpHeight2 = jumpHeight2 * 0.89;
this._y = this._y - jumpHeight2;
if (jumpHeight2 < 3) {
jumpDown = true;
reBounce = false;
jumpHeight2 = 12;
}
gravity = 1;
} else {
playSound1 = true;
}
};
characterHit = false;
dying = function () {
if (characterHit == true) {
xspeed = 0;
if (playOnce1 == true) {
deathSound = new Sound();
deathSound.attachSound("character_Death");
deathSound.start(0, 1);
sprite.gotoAndPlay("dead");
playOnce1 = false;
}
} else {
playOnce1 = true;
reBounceFunction();
forces();
characterControl();
characterMovement();
matrixFind();
}
};
this.onEnterFrame = function () {
if (score > _root.highscore) {
_root.highscore = score;
}
dying();
};
Symbol 100 MovieClip Frame 1
ease_Val = 10;
chase = function () {
X = this._x - this._parent.character._x;
Y = this._y - this._parent.character._y;
X = X / ease_Val;
Y = Y / (ease_Val * 1.2);
this._x = this._x - X;
this._y = this._y - Y;
};
this.onEnterFrame = function () {
chase();
this._visible = false;
};
Symbol 101 MovieClip Frame 1
if (_root.restartAll == true) {
gotoAndPlay (3);
restartAll = false;
}
Symbol 101 MovieClip Frame 2
gotoAndPlay (1);