Frame 1
function moveball() {
if (Key.isDown(39)) {
Xspeed = Xspeed + ballSpeed;
}
if (Key.isDown(37)) {
Xspeed = Xspeed - ballSpeed;
}
if (Key.isDown(40)) {
Yspeed = Yspeed + ballSpeed;
}
if (Key.isDown(38)) {
Yspeed = Yspeed - ballSpeed;
}
}
function applyMovement() {
_root.ball._x = _root.ball._x + Xspeed;
_root.ball._y = _root.ball._y + Yspeed;
_root.ball._rotation = _root.ball._rotation + (0.75 * Xspeed);
}
function ballFriction() {
if (Xspeed > 0) {
Xspeed = Xspeed - friction;
}
if (Xspeed < 0) {
Xspeed = Xspeed + friction;
}
if (Yspeed > 0) {
Yspeed = Yspeed - friction;
}
if (Yspeed < 0) {
Yspeed = Yspeed + friction;
}
}
function ballGravity() {
Yspeed = Yspeed + gravity;
}
function boundaries() {
if (_root.ball._x >= 525) {
Xspeed = -Xspeed;
}
if (_root.ball._x <= 25) {
Xspeed = -Xspeed;
}
if (_root.ball._y >= 375) {
Yspeed = -Yspeed;
}
if (_root.ball._y <= 25) {
Yspeed = -Yspeed;
}
if (_root.ball._x >= 526) {
_root.ball._x = _root.ball._x - 3;
}
if (_root.ball._x <= 24) {
_root.ball._x = _root.ball._x + 3;
}
if (_root.ball._y >= 376) {
_root.ball._y = _root.ball._y - 3;
}
if (_root.ball._y <= 24) {
_root.ball._y = _root.ball._y + 3;
}
}
points = 0;
health = 100;
fscommand ("fullscreen", "false");
fscommand ("allowscale", "false");
var Xspeed = 0;
var Yspeed = 0;
var friction = 0.2;
var gravity = 0.25;
var ballSpeed = 0.8;
onEnterFrame = function () {
moveball();
applyMovement();
ballFriction();
ballGravity();
boundaries();
};
stop();
Frame 2
function moveball() {
if (Key.isDown(39)) {
Xspeed = Xspeed + ballSpeed;
}
if (Key.isDown(37)) {
Xspeed = Xspeed - ballSpeed;
}
if (Key.isDown(40)) {
Yspeed = Yspeed + ballSpeed;
}
if (Key.isDown(38)) {
Yspeed = Yspeed - ballSpeed;
}
}
function applyMovement() {
_root.ball._x = _root.ball._x + Xspeed;
_root.ball._y = _root.ball._y + Yspeed;
_root.ball._rotation = _root.ball._rotation + (0.75 * Xspeed);
}
function ballFriction() {
if (Xspeed > 0) {
Xspeed = Xspeed - friction;
}
if (Xspeed < 0) {
Xspeed = Xspeed + friction;
}
if (Yspeed > 0) {
Yspeed = Yspeed - friction;
}
if (Yspeed < 0) {
Yspeed = Yspeed + friction;
}
}
function ballGravity() {
Yspeed = Yspeed + gravity;
}
function boundaries() {
if (_root.ball._x >= 525) {
Xspeed = -Xspeed;
}
if (_root.ball._x <= 25) {
Xspeed = -Xspeed;
}
if (_root.ball._y >= 375) {
Yspeed = -Yspeed;
}
if (_root.ball._y <= 25) {
Yspeed = -Yspeed;
}
if (_root.ball._x >= 526) {
_root.ball._x = _root.ball._x - 3;
}
if (_root.ball._x <= 24) {
_root.ball._x = _root.ball._x + 3;
}
if (_root.ball._y >= 376) {
_root.ball._y = _root.ball._y - 3;
}
if (_root.ball._y <= 24) {
_root.ball._y = _root.ball._y + 3;
}
}
var Xspeed = 0;
var Yspeed = 0;
var friction = 0.2;
var gravity = 0.25;
var ballSpeed = 0.8;
onEnterFrame = function () {
moveball();
applyMovement();
ballFriction();
ballGravity();
boundaries();
};
Instance of Symbol 3 MovieClip "ball" in Frame 2
onClipEvent (enterFrame) {
_root.points = _root.points + 1;
_root.health = _root.health - 0.05;
}
Instance of Symbol 21 MovieClip "health" in Frame 2
onClipEvent (enterFrame) {
this._width = _root.health * 5.4;
}
onClipEvent (enterFrame) {
if (this._width == 0) {
_root.gotoAndStop(3);
}
}
Instance of Symbol 5 MovieClip in Frame 2
onClipEvent (enterFrame) {
if (hitTest(_root.ball)) {
this._y = -2000 - (Math.Random() * 2000);
_root.points = _root.points + 200;
this._x = Math.random() * 550;
} else {
this._y = this._y + 30;
this._rotation = this._rotation + 15;
}
if (this._y >= 400) {
this._y = -2000 - (Math.Random() * 2000);
this._x = Math.random() * 550;
}
}
Instance of Symbol 5 MovieClip in Frame 2
onClipEvent (enterFrame) {
if (hitTest(_root.ball)) {
this._y = -2000 - (Math.Random() * 2000);
_root.points = _root.points + 600;
this._x = Math.random() * 550;
} else {
this._y = this._y + 30;
this._rotation = this._rotation + 15;
}
if (this._y >= 400) {
this._y = -2000 - (Math.Random() * 2000);
this._x = Math.random() * 550;
}
}
Instance of Symbol 5 MovieClip in Frame 2
onClipEvent (enterFrame) {
if (hitTest(_root.ball)) {
this._y = -2000 - (Math.Random() * 2000);
_root.points = _root.points + 400;
this._x = Math.random() * 550;
} else {
this._y = this._y + 30;
this._rotation = this._rotation + 15;
}
if (this._y >= 400) {
this._y = -2000 - (Math.Random() * 2000);
this._x = Math.random() * 550;
}
}
Instance of Symbol 5 MovieClip in Frame 2
onClipEvent (enterFrame) {
if (hitTest(_root.ball)) {
this._y = -2000 - (Math.Random() * 2000);
_root.points = _root.points + 800;
this._x = Math.random() * 550;
} else {
this._y = this._y + 30;
this._rotation = this._rotation + 15;
}
if (this._y >= 400) {
this._y = -2000 - (Math.Random() * 2000);
this._x = Math.random() * 550;
}
}
Symbol 13 Button
on (release) {
gotoAndStop (2);
}
Symbol 16 MovieClip Frame 1
snowflakes = 75;
do {
duplicateMovieClip (snow, "snow" + k, k);
k++;
} while (k != snowflakes);
Instance of Symbol 15 MovieClip "snow" in Symbol 16 MovieClip Frame 1
onClipEvent (load) {
width = 550;
height = 400;
this._xscale = (this._yscale = 50 + (Math.random() * 100));
this._alpha = 20 + (Math.random() * 50);
this._x = (-width) + (Math.random() * (3 * width));
this._y = -10 + (Math.random() * height);
i = 1 + (Math.random() * 2);
k = -3.14159265358979 + (Math.random() * Math.PI);
rad = 0;
}
onClipEvent (enterFrame) {
rad = rad + ((k / 180) * Math.PI);
xmovement = 0;
this._x = this._x - (Math.cos(rad) + ((xmovement - (width / 2)) / 50));
this._y = this._y + i;
if (this._x > (width + 50)) {
this._x = -45;
this._y = (Math.random() * height) * 2;
}
if (this._x < -50) {
this._x = width + 45;
this._y = (Math.random() * height) * 2;
}
if (this._y >= height) {
this._y = -50;
this._x = (-width) + (Math.random() * (3 * width));
}
}
Symbol 25 Button
on (release) {
_root.gotoAndStop(1);
}