Frame 1
Mouse.hide();
attachMovie("paddley", "paddley", 1);
paddley.onEnterFrame = function () {
this._x = _xmouse;
this._y = _ymouse;
};
Instance of Symbol 3 MovieClip "galaxy" in Frame 1
onClipEvent (load) {
sky.duplicateMovieClip("sky2", 1000);
sky2._y = sky._y - sky._width;
skyStarty = this._y;
skySpeed = 10;
}
onClipEvent (enterFrame) {
this._y = this._y + skySpeed;
if (this._y >= (skyStarty + sky._width)) {
this._y = skyStarty + skySpeed;
}
}
Instance of Symbol 7 MovieClip "paddley" in Frame 1
onClipEvent (load) {
this._y = 390;
this._x = 275;
this.paddlespeed = 15;
}
Instance of Symbol 9 MovieClip "ball" in Frame 1
onClipEvent (load) {
function reset() {
this._x = 400;
this._y = 200;
this.fullspeed = 20;
this.xspeed = 0;
this.yspeed = 0;
this.udist = 0;
this.edist = 0;
this.ufraction = 0;
this.efraction = 0;
}
this.reset();
}
onClipEvent (enterFrame) {
if ((this._x >= 775) && (this.xspeed > 0)) {
this.xspeed = -this.xspeed;
}
if ((this._x <= 25) && (this.xspeed < 0)) {
this.xspeed = -this.xspeed;
}
if (this.hitTest(_root.paddley)) {
this.udist = _root.paddley._x - _root.ball._x;
if (this.udist != 0) {
this.ufraction = this.udist / (_root.paddley._width / 2);
this.xspeed = -((1 - Math.abs(this.ufraction)) * this.fullspeed);
this.yspeed = this.ufraction * this.fullspeed;
} else if (this.udist == 0) {
this.yspeed = -this.fullspeed;
}
if (this.yspeed > 0) {
this.yspeed = -this.yspeed;
}
}
if (this.hitTest(_root.paddlez)) {
this.edist = _root.paddlez._x - this._x;
if (this.edist != 0) {
this.efraction = this.edist / (_root.paddlez._width / 2);
this.xspeed = -((1 - Math.abs(this.efraction)) * this.fullspeed);
this.yspeed = this.efraction * this.fullspeed;
} else {
this.yspeed = this.fullspeed;
}
if (this.yspeed < 0) {
this.yspeed = -this.yspeed;
}
}
this._y = this._y + this.yspeed;
this._x = this._x + this.xspeed;
if ((this._y > 440) || (this._y < -40)) {
this.reset();
}
}
Instance of Symbol 15 MovieClip "paddlez" in Frame 1
onClipEvent (load) {
this._y = 5;
this._x = 275;
this.paddlespeed = 12;
}
onClipEvent (enterFrame) {
if ((this._x > (_root.ball._x + 5)) && (this._x > 20)) {
this._x = this._x - this.paddlespeed;
}
if ((this._x < (_root.ball._x - 5)) && (this._x < 780)) {
this._x = this._x + this.paddlespeed;
}
if ((this._y > (_root.ball._y + 1)) && (this._y > 0)) {
this._y = this._y - this.paddlespeed;
}
if ((this._y < (_root.ball._y - 1)) && (this._y < 150)) {
this._y = this._y + this.paddlespeed;
}
}