Frame 1
stop();
Instance of Symbol 7 MovieClip "ball_mc" in Frame 1
onClipEvent (load) {
var soundBank = _root.sounds_mc;
vec = [2, 4, 6];
vx = vec[random(vec.length)];
vy = vec[random(vec.length)];
VerticalBounce = function () {
vy = -vy;
if (vx < 0) {
sign = -1;
} else {
sign = 1;
}
vx = vec[random(vec.length)] * sign;
soundBank.gotoAndPlay("meowY");
};
HorizontalBounce = function () {
vx = -vx;
if (vy < 0) {
sign = -1;
} else {
sign = 1;
}
vy = vec[random(vec.length)] * sign;
soundBank.gotoAndPlay("meowX");
};
}
onClipEvent (enterFrame) {
if ((vy < 0) && (_y < 0)) {
VerticalBounce();
}
if ((vy > 0) && (_y > Stage.height)) {
VerticalBounce();
}
if ((vx < 0) && (_x < 0)) {
HorizontalBounce();
}
if ((vx > 0) && (_x > Stage.width)) {
HorizontalBounce();
}
_root.ball5_mc._x = _root.ball4_mc._x - vx;
_root.ball5_mc._y = _root.ball4_mc._y - vy;
_root.ball5_mc._rotation = _root.ball4_mc._rotation;
_root.ball4_mc._x = _root.ball3_mc._x - vx;
_root.ball4_mc._y = _root.ball3_mc._y - vy;
_root.ball4_mc._rotation = _root.ball3_mc._rotation;
_root.ball3_mc._x = _root.ball2_mc._x - vx;
_root.ball3_mc._y = _root.ball2_mc._y - vy;
_root.ball3_mc._rotation = _root.ball2_mc._rotation;
_root.ball2_mc._x = _root.ball1_mc._x - vx;
_root.ball2_mc._y = _root.ball1_mc._y - vy;
_root.ball2_mc._rotation = _root.ball1_mc._rotation;
_root.ball1_mc._x = _x - vx;
_root.ball1_mc._y = _y - vy;
_root.ball1_mc._rotation = _rotation;
_x = (_x + vx);
_y = (_y + vy);
_rotation = (_rotation + ((vx + vy) / 2));
}
Frame 30
stop();
Instance of Symbol 31 MovieClip "ball_mc" in Frame 30
onClipEvent (load) {
function AddScore(value) {
score = score + value;
scoreDisplay.text = score;
}
function AddLoseLife(value) {
balls = balls + value;
if (balls < 0) {
_root.play();
} else {
ballDisplay.text = "Yarnz: " + (balls + 1);
}
}
function LivesTest(value, paddle) {
var _local1 = true;
if ((score % value) == 0) {
AddLoseLife(1);
soundBank.gotoAndPlay("purr");
_local1 = false;
} else if (_local1 && (paddle == "x")) {
soundBank.gotoAndPlay("meowX");
} else if (_local1 && (paddle == "y")) {
soundBank.gotoAndPlay("meowY");
}
}
function VerticalBounce() {
velocityY = -velocityY;
if (velocityX < 0) {
sign = -1;
} else {
sign = 1;
}
velocityX = speedSelect[random(speedSelect.length)] * sign;
}
function HorizontalBounce() {
velocityX = -velocityX;
if (velocityY < 0) {
sign = -1;
} else {
sign = 1;
}
velocityY = speedSelect[random(speedSelect.length)] * sign;
}
var soundBank = _root.sounds_mc;
var paddleX = _root.paddle_x_mc;
var paddleY = _root.paddle_y_mc;
var score = 0;
var scoreDisplay = _root.score_txt;
scoreDisplay.text = "0";
var balls = 2;
var ballDisplay = _root.balls_txt;
ballDisplay.text = "Yarnz: " + (balls + 1);
var speedSelect = [4, 8, 12];
var velocityX = speedSelect[random(speedSelect.length)];
var velocityY = speedSelect[random(speedSelect.length)];
var ball5 = _root.ball5_mc;
var ball4 = _root.ball4_mc;
var ball3 = _root.ball3_mc;
var ball2 = _root.ball2_mc;
var ball1 = _root.ball1_mc;
}
onClipEvent (enterFrame) {
if ((velocityY < 0) && (hitTest(_x, 20))) {
VerticalBounce();
soundBank.gotoAndPlay("bonk");
}
if ((velocityY > 0) && (hitTest(paddleX))) {
AddScore(10);
LivesTest(100, "x");
VerticalBounce();
}
if ((velocityX < 0) && (hitTest(16, _y))) {
HorizontalBounce();
soundBank.gotoAndPlay("bonk");
}
if ((velocityX > 0) && (hitTest(paddleY))) {
AddScore(10);
LivesTest(100, "y");
HorizontalBounce();
}
ball5._x = ball4._x - velocityX;
ball5._y = ball4._y - velocityY;
ball5._rotation = ball4._rotation;
ball4._x = ball3._x - velocityX;
ball4._y = ball3._y - velocityY;
ball4._rotation = ball3._rotation;
ball3._x = ball2._x - velocityX;
ball3._y = ball2._y - velocityY;
ball3._rotation = ball2._rotation;
ball2._x = ball1._x - velocityX;
ball2._y = ball1._y - velocityY;
ball2._rotation = ball1._rotation;
ball1._x = _x - velocityX;
ball1._y = _y - velocityY;
ball1._rotation = _rotation;
_x = (_x + velocityX);
_y = (_y + velocityY);
_rotation = (_rotation + ((velocityX + velocityY) / 2));
if ((_x > (Stage.width + 32)) || (_y > (Stage.height + 32))) {
AddLoseLife(-1);
soundBank.gotoAndPlay("death");
_x = 20;
_y = 20;
velocityX = speedSelect[random(speedSelect.length)];
velocityY = speedSelect[random(speedSelect.length)];
}
}
Instance of Symbol 33 MovieClip "paddle_x_mc" in Frame 30
onClipEvent (enterFrame) {
if (Key.isDown(37)) {
_x = (_x - 12);
if (_x < 48) {
_x = 48;
}
}
if (Key.isDown(39)) {
_x = (_x + 12);
if (_x > 608) {
_x = 608;
}
}
}
Instance of Symbol 33 MovieClip "paddle_y_mc" in Frame 30
onClipEvent (enterFrame) {
if (Key.isDown(38)) {
_y = (_y - 12);
if (_y < 48) {
_y = 48;
}
}
if (Key.isDown(40)) {
_y = (_y + 12);
if (_y > 448) {
_y = 448;
}
}
}
Frame 31
stop();
var soundBank = _root.sounds_mc;
soundBank.gotoAndPlay("lose");
_root.score_txt_over.text = _root.score_txt.text;
Instance of Symbol 7 MovieClip "ball_mc" in Frame 31
onClipEvent (load) {
var soundBank = _root.sounds_mc;
vec = [2, 4, 6];
vx = vec[random(vec.length)];
vy = vec[random(vec.length)];
VerticalBounce = function () {
vy = -vy;
if (vx < 0) {
sign = -1;
} else {
sign = 1;
}
vx = vec[random(vec.length)] * sign;
soundBank.gotoAndPlay("meowY");
};
HorizontalBounce = function () {
vx = -vx;
if (vy < 0) {
sign = -1;
} else {
sign = 1;
}
vy = vec[random(vec.length)] * sign;
soundBank.gotoAndPlay("meowX");
};
}
onClipEvent (enterFrame) {
if ((vy < 0) && (_y < 0)) {
VerticalBounce();
}
if ((vy > 0) && (_y > Stage.height)) {
VerticalBounce();
}
if ((vx < 0) && (_x < 0)) {
HorizontalBounce();
}
if ((vx > 0) && (_x > Stage.width)) {
HorizontalBounce();
}
_root.ball5_mc._x = _root.ball4_mc._x - vx;
_root.ball5_mc._y = _root.ball4_mc._y - vy;
_root.ball5_mc._rotation = _root.ball4_mc._rotation;
_root.ball4_mc._x = _root.ball3_mc._x - vx;
_root.ball4_mc._y = _root.ball3_mc._y - vy;
_root.ball4_mc._rotation = _root.ball3_mc._rotation;
_root.ball3_mc._x = _root.ball2_mc._x - vx;
_root.ball3_mc._y = _root.ball2_mc._y - vy;
_root.ball3_mc._rotation = _root.ball2_mc._rotation;
_root.ball2_mc._x = _root.ball1_mc._x - vx;
_root.ball2_mc._y = _root.ball1_mc._y - vy;
_root.ball2_mc._rotation = _root.ball1_mc._rotation;
_root.ball1_mc._x = _x - vx;
_root.ball1_mc._y = _y - vy;
_root.ball1_mc._rotation = _rotation;
_x = (_x + vx);
_y = (_y + vy);
_rotation = (_rotation + ((vx + vy) / 2));
}
Frame 60
gotoAndStop ("gameplay");
Frame 61
stop();
Symbol 15 MovieClip Frame 1
stop();
Symbol 15 MovieClip Frame 19
stop();
Symbol 15 MovieClip Frame 49
stop();
Symbol 15 MovieClip Frame 71
stop();
Symbol 15 MovieClip Frame 94
stop();
Symbol 15 MovieClip Frame 119
stop();
Symbol 15 MovieClip Frame 134
stop();
Symbol 24 Button
on (release) {
play();
}
Symbol 28 Button
on (release) {
gotoAndStop ("credits");
}
Symbol 38 Button
on (release) {
play();
}
Symbol 53 Button
on (release) {
gotoAndStop (1);
}