Frame 2
function generatePickups(n, height) {
i = 100;
while (i <= 499) {
_root["pickup" + i].removeMovieClip();
i++;
}
i = 100;
while (i <= (100 + n)) {
_root.attachMovie("pickup", "pickup" + i, i);
_root["pickup" + i]._x = random(300);
_root["pickup" + i]._y = (_root.floor - height) + random(height - 650);
i++;
}
_root.attachMovie("pickup", "pickup" + i, i);
_root["pickup" + i]._x = random(300);
_root["pickup" + i]._y = (_root.floor - height) - 91;
_root["pickup" + i].health = true;
}
function generateBaddies(n, height) {
i = 500;
while (i <= (500 + n)) {
_root.attachMovie("baddy", "baddy" + i, i);
_root["baddy" + i]._y = (_root.floor - height) + random(height - 650);
i++;
}
}
function generateStars(n, height) {
i = 0;
while (i <= 100) {
_root.attachMovie("star", "star" + i, i);
_root["star" + i]._x = random(300);
_root["star" + i]._y = 400 - random(height - 200);
i++;
}
}
_quality = "Medium";
time = 2800;
stop();
globalsound = new Sound();
Stage.showMenu = false;
_root.attachMovie("player", "player", 1000);
_root.player._y = 837.3;
_root.player._x = 150;
_root.attachMovie("title", "title", 2000);
_root.attachMovie("hud", "hud", 1999);
score = 0;
health = 100;
dead = false;
onEnterFrame = function () {
time--;
timeShow = int(time * 0.1);
if (health <= 0) {
dead = true;
}
if (dead) {
player.hurt = true;
health = 0;
globalsound.setVolume(globalsound.getVolume() - 1);
if (globalsound.getVolume() <= 0) {
globalsound.getVolume(100);
_root.player.removeMovieClip();
i = 100;
while (i <= 499) {
_root["pickup" + i].removeMovieClip();
i++;
}
i = 0;
while (i <= 100) {
_root["star" + i].removeMovieClip();
i++;
}
i = 500;
while (i <= 1000) {
_root["baddy" + i].removeMovieClip();
i++;
}
_root.hud.removeMovieClip();
gotoAndStop (3);
}
}
};
Instance of Symbol 134 MovieClip in Frame 2
onClipEvent (load) {
_y = _root.player._y;
}
onClipEvent (enterFrame) {
this._y = (_root.player._y + (_root.player.vSpeed * 8)) - 50;
if (_y > (_root.floor - 275)) {
_y = (_root.floor - 275);
}
}
Frame 3
globalsound.setVolume(100);
Symbol 9 MovieClip Frame 12
gotoAndPlay (6);
Symbol 16 MovieClip Frame 7
if (!_root.dead) {
_parent._parent.hurt = false;
} else {
stop();
}
Symbol 27 Button
on (release) {
_root.gotoAndStop(1);
}
Symbol 28 MovieClip Frame 100
stop();
Symbol 29 MovieClip Frame 107
stop();
Symbol 33 MovieClip [Player] Frame 1
vSpeed = 0;
action = "down";
lastTimer = 1;
lastVspeed = 0;
hurt = false;
smileTimer = 0;
onEnterFrame = function () {
if (action == "down") {
vSpeed = vSpeed + 0.5;
if (vSpeed > 20) {
vSpeed = 20;
}
if (((_y + vSpeed) > _root.floor) && (vSpeed > 0)) {
vSpeed = -vSpeed;
action = "up";
upTimer = lastTimer;
if (_root.time < 0) {
upTimer = upTimer * 1.5;
vSpeed = vSpeed * 1.5;
}
lastTimer = lastTimer + 5;
if (lastTimer == 21) {
bounceCount = 1;
}
if (bounceCount >= 1) {
_root.generatePickups(bounceCount, (bounceCount * 100) + 665.5);
_root.generateBaddies(random(bounceCount) * 0.5, (bounceCount * 100) + 665.5);
_root.generateStars(random(bounceCount), (bounceCount * 100) + 665.5);
bounceCount++;
}
}
} else if (action == "up") {
if (upTimer <= 0) {
if (_root.time > 0) {
action = "down";
} else {
action = "moon";
}
} else {
upTimer--;
}
}
if (((action != "moon") && (Key.isDown(37))) && ((hSpeed - 1.5) > -10)) {
hSpeed = hSpeed - 1.5;
} else if (hSpeed < 0) {
hSpeed = hSpeed + 1.5;
}
if (((action != "moon") && (Key.isDown(39))) && ((hSpeed + 1.5) < 10)) {
hSpeed = hSpeed + 1.5;
} else if (hSpeed > 0) {
hSpeed = hSpeed - 1.5;
}
_x = (_x + hSpeed);
_y = (_y + vSpeed);
if (_x < 0) {
_x = 0;
if (hSpeed < 0) {
hSpeed = 0;
}
}
if (action == "moon") {
_xscale = 100;
vSpeed = vSpeed * 0.99;
if (_x < 140) {
_x = (_x + 0.5);
}
if (_x > 160) {
_x = (_x - 0.5);
}
}
if (_x > 300) {
_x = 300;
if (hSpeed > 0) {
hSpeed = 0;
}
}
if (hSpeed < 0) {
_xscale = -100;
} else if (hSpeed > 0) {
_xscale = 100;
}
if (action == "moon") {
this.sprite.gotoAndStop("moon");
} else if (hurt) {
this.sprite.gotoAndStop("hurt");
} else if (smileTimer > 0) {
this.sprite.gotoAndStop("smile");
smileTimer--;
} else if (vSpeed < 0) {
this.sprite.gotoAndStop("up");
} else if (action == "down") {
this.sprite.gotoAndStop("down");
}
if ((lastVSpeed <= 0) && (vSpeed > 0)) {
lastVSpeed = vSpeed;
}
_root.height = int(_floor - _y);
};
Instance of Symbol 32 MovieClip "sprite" in Symbol 33 MovieClip [Player] Frame 1
onClipEvent (enterFrame) {
if (_parent.action != "moon") {
_parent._rotation = _parent.hSpeed * 3;
if (_parent._rotation == 27) {
_parent._rotation = 22.5;
} else if (_parent._rotation == -27) {
_parent._rotation = -22.5;
}
}
}
Symbol 58 MovieClip Frame 1
onEnterFrame = function () {
gotoAndStop(_root.health / 5);
};
Symbol 68 MovieClip Frame 17
_parent.removeMovieClip();
Symbol 76 MovieClip Frame 17
_parent.removeMovieClip();
Symbol 77 MovieClip [pickup] Frame 1
if (health) {
gotoAndStop (2);
}
stop();
onEnterFrame = function () {
if (_root.player.hitTest(this._x, this._y, false)) {
_root.score++;
_root.player.smileTimer = 20;
gotoAndStop (4);
}
};
Symbol 77 MovieClip [pickup] Frame 2
direction = "left";
onEnterFrame = function () {
if (direction == "left") {
_x = (_x - 2);
if (_x < 10) {
direction = "right";
}
} else {
_x = (_x + 2);
if (_x > 290) {
direction = "left";
}
}
if (_root.player.hitTest(this)) {
_root.health = _root.health + 5;
if (_root.health > 100) {
_root.health = 100;
}
_root.player.smileTimer = 20;
gotoAndStop (3);
}
};
Symbol 77 MovieClip [pickup] Frame 3
onEnterFrame = function () {
};
stop();
Symbol 77 MovieClip [pickup] Frame 4
onEnterFrame = function () {
};
stop();
Symbol 81 MovieClip [star] Frame 1
if (random(30) == 0) {
gotoAndStop (2);
}
stop();
Symbol 101 MovieClip Frame 20
_parent.removeMovieClip();
Symbol 108 MovieClip Frame 15
_parent.removeMovieClip();
Symbol 109 MovieClip [baddy] Frame 1
stop();
direction = random(2);
move = false;
if (direction == 0) {
_x = 0;
} else {
_x = 300;
}
onEnterFrame = function () {
if (move) {
if (direction == 0) {
_x = (_x + 3);
} else {
_x = (_x - 3);
}
} else if ((_root.player._y - _y) < 500) {
move = true;
}
if (_root.player.hitTest(this._x, this._y, false)) {
_root.health = _root.health - 10;
_root.player.hurt = true;
gotoAndStop (3);
}
};
if (random(2) == 0) {
this.gotoAndStop(2);
}
Symbol 109 MovieClip [baddy] Frame 2
onEnterFrame = function () {
if (move) {
if (direction == 0) {
_x = (_x + 3);
} else {
_x = (_x - 3);
}
} else if ((_root.player._y - _y) < 500) {
move = true;
}
if (_root.player.hitTest(this._x, this._y, false)) {
_root.health = _root.health - 10;
_root.player.hurt = true;
gotoAndStop (4);
}
};
Symbol 109 MovieClip [baddy] Frame 3
onEnterFrame = function () {
};
Symbol 109 MovieClip [baddy] Frame 4
onEnterFrame = function () {
};
Symbol 127 MovieClip [title] Frame 1
timer = 200;
stop();
onEnterFrame = function () {
if (timer <= 0) {
_alpha = (_alpha * 0.95);
if (_alpha <= 0) {
this.removeMovieClip();
}
} else if (timer == 100) {
play();
timer--;
} else {
timer--;
}
};
Symbol 127 MovieClip [title] Frame 20
stop();
Symbol 132 MovieClip Frame 1
_root.floor = this._y;
Symbol 134 MovieClip Frame 1
_visible = false;
Mcamera = new Color(this);
parent = new Color(_parent);
parent.setTransform(Mcamera.getTransform());
_parent._x = ((-(this._x - (this._width / 2))) * Stage.width) / this._width;
_parent._y = ((-(this._y - (this._height / 2))) * Stage.height) / this._height;
_parent._xscale = (Stage.width / this._width) * 100;
_parent._yscale = (Stage.height / this._height) * 100;
onEnterFrame = function () {
parent.setTransform(Mcamera.getTransform());
_parent._x = ((-(this._x - (this._width / 2))) * Stage.width) / this._width;
_parent._y = ((-(this._y - (this._height / 2))) * Stage.height) / this._height;
_parent._xscale = (Stage.width / this._width) * 100;
_parent._yscale = (Stage.height / this._height) * 100;
_root.hud._x = _x - 150;
_root.hud._y = _y - 275;
_root.title._x = _x - 150;
_root.title._y = _y - 275;
};
onUnload = function () {
myColorTransform = {ra:"100", rb:"0", ga:"100", gb:"0", ba:"100", bb:"0", aa:"100", ab:"0"};
parent.setTransform(myColorTransform);
_parent._xscale = 100;
_parent._yscale = 100;
_parent._x = 0;
_parent._y = 0;
};