Frame 1
txtPercentage = Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
tellTarget ("loader") {
gotoAndPlay(Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * 100));
};
Frame 2
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
gotoAndPlay (18);
} else {
gotoAndPlay (1);
}
Frame 18
n = 0;
a = getTimer();
while (Number(n) < 1000) {
n = Number(n) + 1;
}
b = getTimer();
CPUlag = b - a;
CPUlag = CPUlag + 2;
Frame 19
if (CPUlag < 1) {
gotoAndPlay (18);
}
Frame 20
if (CPUlag < 5) {
_quality = "HIGH";
_root.q = 1;
}
if ((4 < CPUlag) && (CPUlag < 40)) {
_quality = "MEDIUM";
_root.q = 2;
}
if ((39 < CPUlag) && (CPUlag < 100)) {
_quality = "AUTOHIGH";
_root.q = 3;
}
if (99 < CPUlag) {
_quality = "LOW";
_root.q = 4;
}
Frame 21
_root.gamename = "crazyball";
_root.by = "rss_np";
score = 0;
sea = 0;
_root.balls = 3;
_root.blackhole = 0;
stop();
Instance of Symbol 35 MovieClip in Frame 21
onClipEvent (load) {
gotoAndPlay(_root.q);
}
Frame 22
stop();
Instance of Symbol 54 MovieClip "flipperRight" in Frame 22
onClipEvent (load) {
angle = 0;
ismoving = false;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
tellTarget ("_root.sound") {
gotoAndPlay ("flipper");
};
if (this._rotation < 90) {
ismoving = true;
this._rotation = angle;
angle = angle + 30;
} else {
ismoving = false;
}
} else {
ismoving = false;
angle = 0;
this._rotation = angle;
}
}
Instance of Symbol 56 MovieClip "flipperLeft" in Frame 22
onClipEvent (load) {
angle = 0;
ismoving = false;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
tellTarget ("_root.sound") {
play();
};
if (-90 < this._rotation) {
ismoving = true;
this._rotation = angle;
angle = angle - 30;
} else {
ismoving = false;
}
} else {
ismoving = false;
angle = 360;
this._rotation = angle;
}
}
Instance of Symbol 85 MovieClip "ball" in Frame 22
onClipEvent (load) {
this._x = random(200) + 100;
movy = -4;
movx = 2;
colid = false;
(oldy = 0);
}
onClipEvent (enterFrame) {
_root.text = score;
if (384 < this._y) {
tellTarget ("../") {
gotoAndPlay ("miss");
};
}
var friction = 0.002;
if (Math.abs(movx)) {
movx = movx - (movx * friction);
}
if (Math.abs(movy)) {
movy = movy - (movy * friction);
}
if (!colid) {
movy = movy + 0.2;
}
if (5 < movx) {
movx = 5;
} else if (movx < -5) {
movx = -5;
}
if (4 < movy) {
movy = 4;
} else if (movy < -8) {
movy = -8;
}
this._x = this._x + (movx * 2);
this._y = this._y + (movy * 2);
obstNum = 11;
i = 0;
for ( ; i < obstNum ; i++) {
var ball = this;
var obstacle = _root["obst" + i];
var collisionX = (obstacle._x - ball._x);
var collisionY = (obstacle._y - ball._y);
var distanceSquared = ((collisionX * collisionX) + (collisionY * collisionY));
var sumRadius = ((ball._height / 2) + (obstacle._height / 2));
var sumRadiusSquared = (sumRadius * sumRadius);
if (sumRadiusSquared >= distanceSquared) {
_root.score = _root.score + (100 + random(100));
obstacle.play();
var collisionVectorLength = Math.sqrt(distanceSquared);
if (collisionVectorLength == 0) {
collisionVectorLength = 1;
}
var collisionNormalX = (collisionX / collisionVectorLength);
var collisionNormalY = (collisionY / collisionVectorLength);
var Acvx = ((movx * collisionNormalX) + (movy * collisionNormalY));
var Acvy = ((movy * collisionNormalX) - (movx * collisionNormalY));
if (Acvx < 0) {
continue;
}
var Bcvx = 0;
var Bcvy = 0;
var m1 = 5;
var m2 = 100;
var mT = (m1 + m2);
var Afvx = ((((m1 - m2) * Acvx) + ((m2 + m2) * Bcvx)) / mT);
movx = (Afvx * collisionNormalX) - (Acvy * collisionNormalY);
movy = (collisionNormalX * Acvy) + (Afvx * collisionNormalY);
movx = movx * 1.2;
movy = movy * 1.2;
this.gotoAndStop(2);
} else {
this.gotoAndStop(1);
}
}
if (this._y < (_root.wallTop._y + (this._height / 2))) {
this._y = _root.wallTop._y + (this._height / 2);
movy = movy * -1;
} else if ((_root.wallBot._y - (this._height / 2)) < this._y) {
this._y = _root.wallBot._y - (this._height / 2);
movy = movy * -1;
} else if ((_root.wallRig._x - (this._height / 2)) < this._x) {
this._x = _root.wallRig._x - (this._height / 2);
movx = movx * -1;
} else if (this._x < (_root.wallLef._x + (this._height / 2))) {
this._x = _root.wallLef._x + (this._height / 2);
movx = movx * -1;
}
oldx = this._x;
oldy = this._y;
if (_root.flipperLeft.hitTest(this._x, this._y, true) || (_root.flipperRight.hitTest(this._x, this._y, true))) {
if (_root.flipperRight.hitTest(this._x, this._y, true)) {
var flipper = _root.flipperRight;
var angle = (45 + _root.flipperRight._rotation);
var phiRad = (Math.PI * (angle / 180));
} else if (_root.flipperLeft.hitTest(this._x, this._y, true)) {
var flipper = _root.flipperLeft;
var angle = (135 + _root.flipperLeft._rotation);
var phiRad = (Math.PI * (angle / 180));
}
var movxN = ((movx * Math.cos(phiRad)) - (movy * Math.sin(phiRad)));
var movyN = ((movx * Math.sin(phiRad)) + (movy * Math.cos(phiRad)));
this._x = oldx;
this._y = oldy - 2;
if ((0 < movy) && (flipper.ismoving)) {
movyN = movyN * -6;
} else if ((0 < movy) && (!flipper.ismoving)) {
movyN = movyN * -1.5;
} else if ((movy < 0) && (flipper.ismoving)) {
movyN = movyN * 4.5;
} else if ((movy < 0) && (!flipper.ismoving)) {
movyN = movyN * 1;
}
movx = (movxN * Math.cos(phiRad)) + (movyN * Math.sin(phiRad));
movy = ((-movxN) * Math.sin(phiRad)) + (movyN * Math.cos(phiRad));
colid = true;
} else {
colid = false;
}
}
Frame 31
_root.balls = _root.balls - 1;
Frame 32
if (_root.balls < 1) {
gotoAndStop (127);
}
Frame 126
gotoAndStop (22);
Frame 127
Mouse.show();
_root.score = score;
stop();
Instance of Symbol 116 MovieClip "logo" in Frame 127
onClipEvent (enterFrame) {
setProperty("_root.logo", _rotation , getProperty(_root.logo, _rotation) + 1);
}
Symbol 2 Button
on (release) {
Mouse.hide();
gotoAndStop (22);
}
Symbol 11 Button
on (release) {
getURL ("http://www.nastypixel.com/arcade/", "_blank");
}
Symbol 31 Button
on (release) {
nextFrame();
}
Symbol 35 MovieClip Frame 1
stop();
_quality = "HIGH";
Symbol 35 MovieClip Frame 2
_quality = "MEDIUM";
stop();
Symbol 35 MovieClip Frame 3
stop();
_quality = "AUTOHIGH";
Symbol 35 MovieClip Frame 4
stop();
_quality = "LOW";
Symbol 35 MovieClip Frame 5
gotoAndStop (1);
Symbol 40 MovieClip Frame 1
stop();
Symbol 40 MovieClip Frame 15
gotoAndStop (1);
Symbol 59 MovieClip Frame 1
stop();
Symbol 59 MovieClip Frame 15
gotoAndStop (1);
Symbol 62 MovieClip Frame 1
stop();
Symbol 62 MovieClip Frame 15
gotoAndStop (1);
Symbol 68 MovieClip Frame 1
stop();
Instance of Symbol 67 MovieClip "seahittest" in Symbol 68 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root.ball)) {
tellTarget ("../") {
play();
};
}
}
Symbol 68 MovieClip Frame 15
_root.sea = _root.sea + 1;
if (_root.sea < 3) {
stop();
} else {
tellTarget ("_root.sound") {
gotoAndPlay ("sea");
};
_root.sea = 0;
_root.score = _root.score + (random(1500) + 500);
tellTarget ("_root.sea1") {
gotoAndStop (1);
};
tellTarget ("_root.sea2") {
gotoAndStop (1);
};
tellTarget ("_root.sea3") {
gotoAndStop (1);
};
}
Symbol 70 MovieClip Frame 1
stop();
Instance of Symbol 67 MovieClip "seahittest" in Symbol 70 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root.ball)) {
tellTarget ("../") {
play();
};
}
}
Symbol 70 MovieClip Frame 15
_root.sea = _root.sea + 1;
if (_root.sea < 3) {
stop();
} else {
tellTarget ("_root.sound") {
gotoAndPlay ("sea");
};
_root.sea = 0;
_root.score = _root.score + (random(1500) + 500);
tellTarget ("_root.sea1") {
gotoAndStop (1);
};
tellTarget ("_root.sea2") {
gotoAndStop (1);
};
tellTarget ("_root.sea3") {
gotoAndStop (1);
};
}
Symbol 72 MovieClip Frame 1
stop();
Instance of Symbol 67 MovieClip "seahittest" in Symbol 72 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root.ball)) {
tellTarget ("../") {
play();
};
}
}
Symbol 72 MovieClip Frame 15
_root.sea = _root.sea + 1;
if (_root.sea < 3) {
stop();
} else {
tellTarget ("_root.sound") {
gotoAndPlay ("sea");
};
_root.sea = 0;
_root.score = _root.score + (random(1500) + 500);
tellTarget ("_root.sea1") {
gotoAndStop (1);
};
tellTarget ("_root.sea2") {
gotoAndStop (1);
};
tellTarget ("_root.sea3") {
gotoAndStop (1);
};
}
Instance of Symbol 77 MovieClip "sidetest1" in Symbol 78 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root.ball) && (_root.blackhole < 1)) {
setProperty(_root.ball, _y , -100);
setProperty(_root.ball, _x , -100);
setProperty(_root.ball, _visible , false);
tellTarget ("_root.blackholeanimation") {
gotoAndPlay (2);
};
}
}
Symbol 91 MovieClip Frame 1
stop();
Symbol 91 MovieClip Frame 16
gotoAndStop (1);
Symbol 91 MovieClip Frame 78
gotoAndStop (1);
Symbol 98 MovieClip Frame 1
_root.blackhole = 0;
stop();
Symbol 98 MovieClip Frame 2
_root.blackhole = 100;
Symbol 98 MovieClip Frame 15
setProperty(_root.ball, _y , -100);
setProperty(_root.ball, _x , -100);
Symbol 98 MovieClip Frame 37
setProperty(_root.ball, _y , -100);
setProperty(_root.ball, _x , -100);
Symbol 98 MovieClip Frame 60
setProperty(_root.ball, _y , -100);
setProperty(_root.ball, _x , -100);
Symbol 98 MovieClip Frame 76
setProperty(_root.ball, _y , 70);
setProperty(_root.ball, _x , 113.9);
setProperty(_root.ball, _visible , true);
Symbol 102 Button
on (release, keyPress "m") {
Mouse.show();
gotoAndStop (21);
}
Symbol 107 Button
on (keyPress "$") {
_root.score = 0;
_root.balls = 3;
Mouse.hide();
gotoAndStop (22);
}
on (release) {
_root.score = 0;
_root.balls = 3;
gotoAndStop (21);
}