Frame 1
stop();
Frame 2
maxPlatforms = 0;
maxCoins = 0;
ctr1 = 39;
ctr2 = 37;
ctr3 = 68;
ctr4 = 40;
ctr5 = 83;
ctr6 = 65;
_root.menu.varLife = 3;
_root.menu.varStar = 0;
_root.menu.varTime = 30;
_root.menu.varCoin = 0;
_root.varCoin = 0;
_root.menu.varScore = 0;
for (i in this) {
if ((typeof(eval (i)) == "movieclip") && ((substring(i, 1, 5)) == "platf")) {
maxPlatforms++;
}
}
for (i in this) {
if ((typeof(eval (i)) == "movieclip") && ((substring(i, 1, 4)) == "coin")) {
maxCoins++;
}
}
stop();
Instance of Symbol 46 MovieClip "player" in Frame 2
onClipEvent (enterFrame) {
render();
}
onClipEvent (keyDown) {
_root.varKey = Key.getCode();
}
Frame 3
stopAllSounds();
Frame 4
if ((_root.varCoin == _root.maxCoins) || (_root.varCoin > _root.maxCoins)) {
tellTarget ("_root.end") {
gotoAndPlay (3);
};
}
if ((_root.varCoin != _root.maxCoins) && (_root.varCoin < _root.maxCoins)) {
tellTarget ("_root.end") {
gotoAndPlay (2);
};
}
stop();
Symbol 11 Button
on (release) {
_root.play();
}
Symbol 12 MovieClip Frame 1
_root.stop();
PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (PercentLoaded != 100) {
setProperty(bar, _xscale , PercentLoaded);
} else {
gotoAndStop (3);
}
Symbol 12 MovieClip Frame 2
gotoAndPlay (1);
Symbol 14 MovieClip Frame 45
stop();
Symbol 15 MovieClip Frame 12
if ((_root.menu.varTime - 1) > 0) {
_root.menu.varTime--;
} else {
_root.menu.varTime = 0;
_root.play();
}
Symbol 28 MovieClip Frame 1
gotMe = false;
Symbol 28 MovieClip Frame 7
gotoAndPlay (1);
Symbol 28 MovieClip Frame 8
gotMe = true;
_root.menu.varCoin++;
_root.varCoin++;
_root.menu.varScore = _root.menu.varScore + 10;
Symbol 28 MovieClip Frame 15
this._x = -1000;
this._y = -1000;
Symbol 30 MovieClip Frame 1
stop();
Symbol 30 MovieClip Frame 2
gotoAndPlay (1);
Symbol 44 MovieClip Frame 15
gotoAndPlay (1);
Symbol 44 MovieClip Frame 21
gotoAndPlay (1);
Symbol 44 MovieClip Frame 23
gotoAndPlay (1);
Symbol 44 MovieClip Frame 38
gotoAndPlay (1);
Symbol 44 MovieClip Frame 53
gotoAndPlay (1);
Symbol 45 MovieClip Frame 1
_root.facing = "right";
stop();
Symbol 45 MovieClip Frame 2
_root.facing = "left";
stop();
Symbol 46 MovieClip Frame 1
function scrollRight() {
_root.player._y = _root.player._y - 1;
i = 0;
while (i < _root.maxPlatforms) {
platform = eval ("_root.platform" + i);
platform._x = platform._x - hforce;
i++;
}
i = 0;
while (i < _root.maxCoins) {
coin = eval ("_root.coin" + i);
coin._x = coin._x - hforce;
i++;
}
_root.back1._x = _root.back1._x - hforce;
}
function scrollLeft() {
_root.player._y = _root.player._y - 1;
i = 0;
while (i < _root.maxPlatforms) {
platform = eval ("_root.platform" + i);
platform._x = platform._x + hforce;
i++;
}
i = 0;
while (i < _root.maxCoins) {
coin = eval ("_root.coin" + i);
coin._x = coin._x + hforce;
i++;
}
_root.back1._x = _root.back1._x + hforce;
}
function hitCoins() {
i = 0;
while (i < _root.maxCoins) {
coin = eval ("_root.coin" + i);
if ((coin.hitTest("_root.player") == true) && (coin.gotMe != true)) {
coin.gotoAndPlay("CLEAR");
return(undefined);
}
i++;
}
}
function hitPlatforms() {
var i;
var y;
var x;
i = 0;
while (i < _root.maxPlatforms) {
platform = eval ("_root.platform" + i);
y = _y + vertical;
x = _x + horizontal;
if (((_y < platform._y) && (y >= platform._y)) && (platform.hitTest(x, platform._y) == true)) {
_y = platform._y;
falling = false;
vertical = 0;
return(undefined);
}
i++;
}
platform = null;
return(undefined);
}
function render() {
var x;
var y;
x = (y = 0);
hitCoins();
if ((Key.isDown(_root.ctr5) == true) && (Key.isDown(_root.ctr6) != true)) {
hforce = 25;
vforce = 90;
}
if ((Key.isDown(_root.ctr5) != true) && (Key.isDown(_root.ctr6) != true)) {
hforce = 15;
vforce = 80;
}
if (Key.isDown(_root.ctr6) == true) {
hforce = 10;
vforce = 75;
}
if (Key.isDown(_root.ctr1) == true) {
_root.player.body.gotoAndStop(1);
if ((rising == false) && (falling == false)) {
_root.player.body.mario.gotoAndPlay("WALK");
}
scrollx = 183.333333333333;
if ((_root.player._x < scrollx) || (((_root.back1._x - hforce) > -10) != true)) {
if ((_root.player._x + hforce) < (550 - _root.player._width)) {
x = hforce;
}
} else {
scrollRight();
}
}
if (Key.isDown(_root.ctr2) == true) {
_root.player.body.gotoAndStop(2);
if ((rising == false) && (falling == false)) {
_root.player.body.mario.gotoAndPlay("WALK");
}
scrollx = 183.333333333333;
if ((_root.player._x < scrollx) || (((_root.back1._x - hforce) < 500) != true)) {
if ((_root.player._x - hforce) > _root.player._width) {
x = (x = hforce * -1);
}
} else {
scrollLeft();
}
}
if (Math.abs(horizontal) < Math.abs(x)) {
horizontal = x;
} else {
horizontal = horizontal * friction;
if (Math.abs(horizontal) < 1) {
horizontal = 0;
}
}
if ((vertical == 0) && (Key.isDown(_root.ctr3) == true)) {
vertical = vforce * -1;
horizontal = horizontal + platform.velocity;
platform = null;
rising = true;
_root.FX.gotoAndPlay(2);
_root.player.body.mario.gotoAndPlay("JUMP");
}
if ((vertical == 0) && (Key.isDown(_root.ctr4) == true)) {
_root.player.body.mario.gotoAndPlay("CROUCH");
}
if ((vertical == 0) && (Key.isDown(_root.ctr6) == true)) {
vertical = vforce * -1;
horizontal = horizontal + platform.velocity;
platform = null;
rising = true;
_root.FX.gotoAndPlay(2);
_root.player.body.mario.gotoAndPlay("SPIN");
}
if (rising == true) {
vertical = vertical * gravity;
if (Math.abs(vertical) < 1) {
vertical = Math.abs(vertical);
falling = true;
rising = false;
}
}
if (falling == true) {
vertical = vertical * accel;
hitPlatforms();
}
lastX = _x;
lastY = _y;
_y = (_y + vertical);
_x = ((_x + horizontal) + platform.velocity);
if ((platform != null) && (platform.hitTest(_x, platform._y, true) == false)) {
vertical = 2;
falling = true;
}
}
vforce = 80;
hforce = 15;
horizontal = 0;
vertical = 5;
friction = 0.5;
gravity = 0.5;
accel = 1.7;
rising = false;
falling = true;
lastX = _x;
lastY = _y;
platform = null;
stop();
Symbol 56 MovieClip Frame 1
stop();
Symbol 56 MovieClip Frame 2
stop();
Symbol 56 MovieClip Frame 3
stop();