Frame 1
function isCollision() {
if (c1_mc.hitTest(ball_mc._x, ball_mc._y, true)) {
newGame();
}
if (c2_mc.hitTest(ball_mc._x, ball_mc._y, true)) {
newGame();
}
if (c3_mc.hitTest(ball_mc._x, ball_mc._y, true)) {
newGame();
}
if (c4_mc.hitTest(ball_mc._x, ball_mc._y, true)) {
newGame();
}
if (c5_mc.hitTest(ball_mc._x, ball_mc._y, true)) {
newGame();
}
}
function newGame() {
ball_mc.speed = 0;
ball_mc.angle = 0;
ball_mc.is_rot = false;
ball_mc.dist = 0;
is_game = false;
_root.dist_txt = ("game over\n" + _root.dist_txt) + "\nclick again!";
ball_mc.dx = 0;
ball_mc.dy = 0;
ball_mc.dd = 0;
}
ball_mc._x = 350;
ball_mc._y = 154;
ball_mc.speed = 0;
ball_mc.angle = 0;
ball_mc.is_rot = false;
ball_mc.dist = 0;
ball_mc.da = 10;
var is_game = false;
ball_mc.onMouseDown = function () {
var _local1 = this;
if (!is_game) {
_local1._x = 350;
_local1._y = 154;
_local1._rotation = 0;
is_game = true;
}
_local1.gotoAndPlay(1);
_local1.is_rot = true;
_local1._rotation = _local1.angle;
_local1.dx = _local1.speed * Math.sin((Math.PI/180) * _local1.angle);
_local1.dy = _local1.speed * (-Math.cos((Math.PI/180) * _local1.angle));
};
ball_mc.onMouseUp = function () {
this.is_rot = false;
};
ball_mc.onEnterFrame = function () {
var _local1 = this;
var _local2 = _root;
if (is_game) {
_local1.speed = _local1.speed + 0.03;
_local1.dd = _local1.dd + 0.01;
_local1.dist = _local1.dist + _local1.dd;
t = Math.round(_local1.dist);
_local2.dist_txt = t + " sm.";
if (_local1.is_rot) {
_local1.angle = _local1.angle - _local1.da;
_local1._rotation = _local1.angle;
incr++;
_local2.wave_mc.attachMovie("wave", "w" + incr, incr);
_local2.wave_mc["w" + incr]._x = _local1._x;
_local2.wave_mc["w" + incr]._y = _local1._y;
}
_local1.dx = _local1.speed * Math.sin((Math.PI/180) * _local1.angle);
_local1.dy = _local1.speed * (-Math.cos((Math.PI/180) * _local1.angle));
_local1._x = _local1._x + _local1.dx;
_local1._y = _local1._y + _local1.dy;
isCollision();
}
};
Symbol 2 MovieClip [wave] Frame 32
this.removeMovieClip();
Symbol 8 MovieClip Frame 1
stop();