Frame 1
function unpause() {
timing = true;
startime = getTimer() / 1000;
}
function hit() {
if (timing) {
lives = lives - 1;
if (lives < 1) {
timing = false;
ball.gravity = 1.89;
ball.originalwind = 0;
ball.wind = 0;
ball.movement = ball.movement * -1;
startbutton._visible = 1;
gameover._visible = 1;
difficulty = "Not Playing, press 'Start Timer' to play";
ball.wind = ball.originalwind;
}
}
}
_root.onLoad = function () {
difficulty = "Not Playing, press 'Start Timer' to play";
gameover._visible = 0;
level = 0;
lives = 10;
doit = true;
sounds = true;
bassloop = new Sound();
bassloop.attachSound("bassloop");
bassloop.setVolume(100);
bassloop.start(0, 9999);
};
_root.onEnterFrame = function () {
totalTime = (getTimer() / 1000) - startime;
goTime = totalTime;
if (timing) {
hours = Math.floor(goTime / 3600);
minutes = Math.floor(((goTime / 3600) - hours) * 60);
seconds = Math.floor(((((goTime / 3600) - hours) * 60) - minutes) * 60);
milli = Math.floor((goTime - ((seconds + (minutes * 60)) + (hours * 3600))) * 100);
levelup = Math.floor(((goTime / 3600) - hours) * 60);
if (seconds < 10) {
seconds = "0" + seconds;
}
if (minutes < 10) {
minutes = "0" + minutes;
}
if (hours < 10) {
hours = "0" + hours;
}
if (milli < 10) {
milli = "0" + milli;
}
if (Math.floor(goTime) == 10) {
level = 1;
difficulty = "Level 1 - Reverse Gravity";
ball.gravity = -1.89;
}
if (Math.floor(goTime) == 30) {
level = 2;
difficulty = "Level 2 - Double Gravity";
ball.gravity = 3.78;
}
if (Math.floor(goTime) == 45) {
level = 3;
difficulty = "Level 3 - Low Winds";
ball.gravity = 1.89;
ball.originalwind = 10;
ball.wind = 10;
}
if (Math.floor(goTime) == 60) {
level = 4;
difficulty = "Level 4 - Low Winds and Double Gravity";
ball.gravity = 3.78;
}
if (Math.floor(goTime) == 75) {
level = 5;
difficulty = "Level 5 - Relax level";
ball.gravity = 1.89;
ball.originalwind = 0;
ball.wind = 0;
}
if (Math.floor(goTime) == 90) {
level = 6;
difficulty = "Level 6 - Double Reverse Gravity";
ball.gravity = -3.78;
}
if (Math.floor(goTime) == 105) {
level = 7;
difficulty = "Level 7 - High Winds";
ball.gravity = 1.89;
ball.originalwind = 20;
ball.wind = 20;
}
if (Math.floor(goTime) == 120) {
level = 8;
difficulty = "Level 8 - Double Reverse Gravity and Low Winds";
ball.gravity = -3.78;
ball.originalwind = 10;
ball.wind = 10;
}
if (Math.floor(goTime) == 135) {
level = 9;
difficulty = "Level 9 - Relax Level";
ball.gravity = 1.89;
ball.originalwind = 0;
ball.wind = 0;
}
if (Math.floor(goTime) == 150) {
level = 10;
difficulty = "Level 10 - Smaller Boundries";
ball.gravity = 1.89;
ball.originalwind = 0;
ball.wind = 0;
if (doit) {
ball._x = 262.5;
ball._y = 162.5;
top._y = top._y + 50;
right._x = right._x - 50;
bottom._y = bottom._y - 50;
left._x = left._x + 50;
doit = false;
}
}
if (Math.floor(goTime) == 165) {
level = 11;
difficulty = "Level 11 - Reverse Gravity";
ball.gravity = -1.89;
}
if (Math.floor(goTime) == 180) {
level = 12;
difficulty = "Level 12 - Double Gravity";
ball.gravity = 3.78;
}
if (Math.floor(goTime) == 195) {
level = 13;
difficulty = "Level 13 - Low Winds";
ball.gravity = 1.89;
ball.originalwind = 10;
ball.wind = 10;
}
if (Math.floor(goTime) == 210) {
level = 14;
difficulty = "Level 14 - Low Winds and Double Gravity";
ball.gravity = 3.78;
}
if (Math.floor(goTime) == 225) {
level = 15;
difficulty = "Level 15 - Relax level";
ball.gravity = 1.89;
ball.originalwind = 0;
ball.wind = 0;
}
if (Math.floor(goTime) == 240) {
level = 16;
difficulty = "Level 16 - Double Reverse Gravity";
ball.gravity = -3.78;
}
if (Math.floor(goTime) == 255) {
level = 17;
difficulty = "Level 17 - High Winds";
ball.gravity = 1.89;
ball.originalwind = 20;
ball.wind = 20;
}
if (Math.floor(goTime) == 270) {
level = 18;
difficulty = "Level 18 - Double Reverse Gravity and Low Winds";
ball.gravity = -3.78;
ball.originalwind = 10;
ball.wind = 10;
}
if (Math.floor(goTime) == 285) {
level = 19;
difficulty = "Level 19 - End Level, See How Long You Can Last";
ball.gravity = 1.89;
ball.originalwind = 0;
ball.wind = 0;
}
}
};
startbutton.onRelease = function () {
unpause();
ball._x = 262.5;
ball._y = 162.5;
ball.movement = 0;
ball.velocity = 0;
ball.gravity = 1.89;
startbutton._visible = 0;
gameover._visible = 0;
level = 0;
lives = 10;
difficulty = "Level 0 - Normal";
};
Instance of Symbol 3 MovieClip "ball" in Frame 1
onClipEvent (load) {
movement = 0;
velocity = 0;
originalwind = 0;
wind = 0;
gravity = 1.89;
friction = 0.01;
}
onClipEvent (enterFrame) {
velocity = velocity + gravity;
velocity = velocity - (friction * velocity);
wind = wind * 1.05;
_y = (_y + velocity);
_x = (_x + movement);
_x = (_x + wind);
if (_y > (_root.bottom._y - _height)) {
_y = (_root.bottom._y - _height);
velocity = velocity * -0.9;
_root.hit();
}
if (_y < _root.top._y) {
_y = _root.top._y;
velocity = velocity * -0.9;
_root.hit();
}
if (_x > (_root.right._x - _width)) {
_x = (_root.right._x - _width);
movement = movement * -1;
_root.hit();
}
if (_x < _root.left._x) {
_x = _root.left._x;
movement = movement * -1;
_root.hit();
}
if (Key.isDown(37)) {
movement = movement + -5;
if (wind > 0) {
wind = originalwind;
}
} else {
movement = movement * (1 - friction);
}
if (Key.isDown(39)) {
movement = movement + 5;
if (wind < 0) {
wind = originalwind;
}
} else {
movement = movement * (1 - friction);
}
if (Key.isDown(38)) {
velocity = velocity + -5;
}
if (Key.isDown(40)) {
velocity = velocity + 5;
}
}
Symbol 30 Button
on (release) {
if (_root.sounds) {
_root.bassloop.setVolume(0);
_root.sounds = false;
} else {
_root.bassloop.setVolume(100);
_root.sounds = true;
}
}