Frame 622 (8 B)
stop();
Frame 623 (8 B)
stop();
Frame 624 (8 B)
stop();
Frame 625 (461 B)
go = false;
createEmptyMovieClip("terrain", 1);
terrain.lineStyle(9, 14483677, 90);
imdrawing = false;
onMouseDown = function () {
if (!go) {
if (imdrawing == false) {
terrain.moveTo(_xmouse, _ymouse);
imdrawing = true;
}
if (imdrawing == true) {
onEnterFrame = function () {
terrain.lineTo(_xmouse, _ymouse);
};
}
}
};
onMouseUp = function () {
onEnterFrame = function () {
imdrawing = false;
};
};
stop();
Instance of Symbol 130 MovieClip "ball" in Frame 625 (1.95 KiB) ●
onClipEvent (load) {
yspeed = 0;
xspeed = 0;
gravity = 0.2;
radius = 5;
friction = 0.9;
precision = 360;
bounces = 0;
}
onClipEvent (enterFrame) {
if (_root.go == true) {
if (_root.exit.hitTest(_x, _y, true)) {
xspeed = 0;
yspeed = 0;
} else {
collisions = 0;
sum_x = 0;
sum_y = 0;
yspeed = yspeed + gravity;
x = 1;
while (x < precision) {
spot_x = _x + (radius * Math.sin((x * 360) / precision));
spot_y = _y - (radius * Math.cos((x * 360) / precision));
if (_root.terrain.hitTest(spot_x, spot_y, true)) {
collisions++;
sum_x = sum_x + spot_x;
sum_y = sum_y + spot_y;
}
x++;
}
if (collisions > 0) {
_root.last_hit._x = old_x;
_root.last_hit._y = old_y;
bounces++;
_root.collisions.text = "Bounces: " + bounces;
ball_dir = Math.atan(yspeed / (xspeed * -1)) / (Math.PI/180);
if ((xspeed * -1) < 0) {
ball_dir = ball_dir + 180;
}
if (((xspeed * -1) >= 0) && (yspeed < 0)) {
ball_dir = ball_dir + 360;
}
spot_x = sum_x / collisions;
spot_y = sum_y / collisions;
x_cat = spot_x - _x;
y_cat = spot_y - _y;
ball_coll = Math.atan(y_cat / x_cat) / (Math.PI/180);
if (x_cat < 0) {
ball_coll = ball_coll + 180;
}
if ((x_cat >= 0) && (y_cat < 0)) {
ball_coll = ball_coll + 360;
}
ground_rotation = ball_coll - 90;
if (ground_rotation < 0) {
ground_rotation = ground_rotation + 180;
}
bounce_angle = (180 - ball_dir) - (2 * ground_rotation);
if (bounce_angle < 0) {
bounce_angle = bounce_angle + 360;
}
speed = Math.sqrt((yspeed * yspeed) + (xspeed * xspeed));
xspeed = (speed * Math.cos((bounce_angle * Math.PI) / 180)) * friction;
yspeed = ((speed * Math.sin((bounce_angle * Math.PI) / 180)) * -1) * friction;
_x = old_x;
_y = old_y;
} else {
old_x = _x;
old_y = _y;
}
_y = (_y + yspeed);
_x = (_x + xspeed);
}
}
}
Frame 626 (461 B)
stop();
go = false;
createEmptyMovieClip("terrain", 1);
terrain.lineStyle(9, 14483677, 90);
imdrawing = false;
onMouseDown = function () {
if (!go) {
if (imdrawing == false) {
terrain.moveTo(_xmouse, _ymouse);
imdrawing = true;
}
if (imdrawing == true) {
onEnterFrame = function () {
terrain.lineTo(_xmouse, _ymouse);
};
}
}
};
onMouseUp = function () {
onEnterFrame = function () {
imdrawing = false;
};
};
Instance of Symbol 130 MovieClip "ball" in Frame 626 (1.95 KiB) ●
onClipEvent (load) {
yspeed = 0;
xspeed = 0;
gravity = 0.2;
radius = 5;
friction = 0.9;
precision = 360;
bounces = 0;
}
onClipEvent (enterFrame) {
if (_root.go == true) {
if (_root.exit.hitTest(_x, _y, true)) {
xspeed = 0;
yspeed = 0;
} else {
collisions = 0;
sum_x = 0;
sum_y = 0;
yspeed = yspeed + gravity;
x = 1;
while (x < precision) {
spot_x = _x + (radius * Math.sin((x * 360) / precision));
spot_y = _y - (radius * Math.cos((x * 360) / precision));
if (_root.terrain.hitTest(spot_x, spot_y, true)) {
collisions++;
sum_x = sum_x + spot_x;
sum_y = sum_y + spot_y;
}
x++;
}
if (collisions > 0) {
_root.last_hit._x = old_x;
_root.last_hit._y = old_y;
bounces++;
_root.collisions.text = "Bounces: " + bounces;
ball_dir = Math.atan(yspeed / (xspeed * -1)) / (Math.PI/180);
if ((xspeed * -1) < 0) {
ball_dir = ball_dir + 180;
}
if (((xspeed * -1) >= 0) && (yspeed < 0)) {
ball_dir = ball_dir + 360;
}
spot_x = sum_x / collisions;
spot_y = sum_y / collisions;
x_cat = spot_x - _x;
y_cat = spot_y - _y;
ball_coll = Math.atan(y_cat / x_cat) / (Math.PI/180);
if (x_cat < 0) {
ball_coll = ball_coll + 180;
}
if ((x_cat >= 0) && (y_cat < 0)) {
ball_coll = ball_coll + 360;
}
ground_rotation = ball_coll - 90;
if (ground_rotation < 0) {
ground_rotation = ground_rotation + 180;
}
bounce_angle = (180 - ball_dir) - (2 * ground_rotation);
if (bounce_angle < 0) {
bounce_angle = bounce_angle + 360;
}
speed = Math.sqrt((yspeed * yspeed) + (xspeed * xspeed));
xspeed = (speed * Math.cos((bounce_angle * Math.PI) / 180)) * friction;
yspeed = ((speed * Math.sin((bounce_angle * Math.PI) / 180)) * -1) * friction;
_x = old_x;
_y = old_y;
} else {
old_x = _x;
old_y = _y;
}
_y = (_y + yspeed);
_x = (_x + xspeed);
}
}
}
Frame 627 (461 B)
stop();
go = false;
createEmptyMovieClip("terrain", 1);
terrain.lineStyle(9, 14483677, 90);
imdrawing = false;
onMouseDown = function () {
if (!go) {
if (imdrawing == false) {
terrain.moveTo(_xmouse, _ymouse);
imdrawing = true;
}
if (imdrawing == true) {
onEnterFrame = function () {
terrain.lineTo(_xmouse, _ymouse);
};
}
}
};
onMouseUp = function () {
onEnterFrame = function () {
imdrawing = false;
};
};
Instance of Symbol 130 MovieClip "ball" in Frame 627 (1.95 KiB) ●
onClipEvent (load) {
yspeed = 0;
xspeed = 0;
gravity = 0.2;
radius = 5;
friction = 0.9;
precision = 360;
bounces = 0;
}
onClipEvent (enterFrame) {
if (_root.go == true) {
if (_root.exit.hitTest(_x, _y, true)) {
xspeed = 0;
yspeed = 0;
} else {
collisions = 0;
sum_x = 0;
sum_y = 0;
yspeed = yspeed + gravity;
x = 1;
while (x < precision) {
spot_x = _x + (radius * Math.sin((x * 360) / precision));
spot_y = _y - (radius * Math.cos((x * 360) / precision));
if (_root.terrain.hitTest(spot_x, spot_y, true)) {
collisions++;
sum_x = sum_x + spot_x;
sum_y = sum_y + spot_y;
}
x++;
}
if (collisions > 0) {
_root.last_hit._x = old_x;
_root.last_hit._y = old_y;
bounces++;
_root.collisions.text = "Bounces: " + bounces;
ball_dir = Math.atan(yspeed / (xspeed * -1)) / (Math.PI/180);
if ((xspeed * -1) < 0) {
ball_dir = ball_dir + 180;
}
if (((xspeed * -1) >= 0) && (yspeed < 0)) {
ball_dir = ball_dir + 360;
}
spot_x = sum_x / collisions;
spot_y = sum_y / collisions;
x_cat = spot_x - _x;
y_cat = spot_y - _y;
ball_coll = Math.atan(y_cat / x_cat) / (Math.PI/180);
if (x_cat < 0) {
ball_coll = ball_coll + 180;
}
if ((x_cat >= 0) && (y_cat < 0)) {
ball_coll = ball_coll + 360;
}
ground_rotation = ball_coll - 90;
if (ground_rotation < 0) {
ground_rotation = ground_rotation + 180;
}
bounce_angle = (180 - ball_dir) - (2 * ground_rotation);
if (bounce_angle < 0) {
bounce_angle = bounce_angle + 360;
}
speed = Math.sqrt((yspeed * yspeed) + (xspeed * xspeed));
xspeed = (speed * Math.cos((bounce_angle * Math.PI) / 180)) * friction;
yspeed = ((speed * Math.sin((bounce_angle * Math.PI) / 180)) * -1) * friction;
_x = old_x;
_y = old_y;
} else {
old_x = _x;
old_y = _y;
}
_y = (_y + yspeed);
_x = (_x + xspeed);
}
}
}
Frame 628 (461 B)
stop();
go = false;
createEmptyMovieClip("terrain", 1);
terrain.lineStyle(9, 14483677, 90);
imdrawing = false;
onMouseDown = function () {
if (!go) {
if (imdrawing == false) {
terrain.moveTo(_xmouse, _ymouse);
imdrawing = true;
}
if (imdrawing == true) {
onEnterFrame = function () {
terrain.lineTo(_xmouse, _ymouse);
};
}
}
};
onMouseUp = function () {
onEnterFrame = function () {
imdrawing = false;
};
};
Instance of Symbol 130 MovieClip "ball" in Frame 628 (1.95 KiB) ●
onClipEvent (load) {
yspeed = 0;
xspeed = 0;
gravity = 0.2;
radius = 5;
friction = 0.9;
precision = 360;
bounces = 0;
}
onClipEvent (enterFrame) {
if (_root.go == true) {
if (_root.exit.hitTest(_x, _y, true)) {
xspeed = 0;
yspeed = 0;
} else {
collisions = 0;
sum_x = 0;
sum_y = 0;
yspeed = yspeed + gravity;
x = 1;
while (x < precision) {
spot_x = _x + (radius * Math.sin((x * 360) / precision));
spot_y = _y - (radius * Math.cos((x * 360) / precision));
if (_root.terrain.hitTest(spot_x, spot_y, true)) {
collisions++;
sum_x = sum_x + spot_x;
sum_y = sum_y + spot_y;
}
x++;
}
if (collisions > 0) {
_root.last_hit._x = old_x;
_root.last_hit._y = old_y;
bounces++;
_root.collisions.text = "Bounces: " + bounces;
ball_dir = Math.atan(yspeed / (xspeed * -1)) / (Math.PI/180);
if ((xspeed * -1) < 0) {
ball_dir = ball_dir + 180;
}
if (((xspeed * -1) >= 0) && (yspeed < 0)) {
ball_dir = ball_dir + 360;
}
spot_x = sum_x / collisions;
spot_y = sum_y / collisions;
x_cat = spot_x - _x;
y_cat = spot_y - _y;
ball_coll = Math.atan(y_cat / x_cat) / (Math.PI/180);
if (x_cat < 0) {
ball_coll = ball_coll + 180;
}
if ((x_cat >= 0) && (y_cat < 0)) {
ball_coll = ball_coll + 360;
}
ground_rotation = ball_coll - 90;
if (ground_rotation < 0) {
ground_rotation = ground_rotation + 180;
}
bounce_angle = (180 - ball_dir) - (2 * ground_rotation);
if (bounce_angle < 0) {
bounce_angle = bounce_angle + 360;
}
speed = Math.sqrt((yspeed * yspeed) + (xspeed * xspeed));
xspeed = (speed * Math.cos((bounce_angle * Math.PI) / 180)) * friction;
yspeed = ((speed * Math.sin((bounce_angle * Math.PI) / 180)) * -1) * friction;
_x = old_x;
_y = old_y;
} else {
old_x = _x;
old_y = _y;
}
_y = (_y + yspeed);
_x = (_x + xspeed);
}
}
}
Frame 629 (461 B)
stop();
go = false;
createEmptyMovieClip("terrain", 1);
terrain.lineStyle(9, 14483677, 90);
imdrawing = false;
onMouseDown = function () {
if (!go) {
if (imdrawing == false) {
terrain.moveTo(_xmouse, _ymouse);
imdrawing = true;
}
if (imdrawing == true) {
onEnterFrame = function () {
terrain.lineTo(_xmouse, _ymouse);
};
}
}
};
onMouseUp = function () {
onEnterFrame = function () {
imdrawing = false;
};
};
Instance of Symbol 130 MovieClip "ball" in Frame 629 (1.95 KiB) ●
onClipEvent (load) {
yspeed = 0;
xspeed = 0;
gravity = 0.2;
radius = 5;
friction = 0.9;
precision = 360;
bounces = 0;
}
onClipEvent (enterFrame) {
if (_root.go == true) {
if (_root.exit.hitTest(_x, _y, true)) {
xspeed = 0;
yspeed = 0;
} else {
collisions = 0;
sum_x = 0;
sum_y = 0;
yspeed = yspeed + gravity;
x = 1;
while (x < precision) {
spot_x = _x + (radius * Math.sin((x * 360) / precision));
spot_y = _y - (radius * Math.cos((x * 360) / precision));
if (_root.terrain.hitTest(spot_x, spot_y, true)) {
collisions++;
sum_x = sum_x + spot_x;
sum_y = sum_y + spot_y;
}
x++;
}
if (collisions > 0) {
_root.last_hit._x = old_x;
_root.last_hit._y = old_y;
bounces++;
_root.collisions.text = "Bounces: " + bounces;
ball_dir = Math.atan(yspeed / (xspeed * -1)) / (Math.PI/180);
if ((xspeed * -1) < 0) {
ball_dir = ball_dir + 180;
}
if (((xspeed * -1) >= 0) && (yspeed < 0)) {
ball_dir = ball_dir + 360;
}
spot_x = sum_x / collisions;
spot_y = sum_y / collisions;
x_cat = spot_x - _x;
y_cat = spot_y - _y;
ball_coll = Math.atan(y_cat / x_cat) / (Math.PI/180);
if (x_cat < 0) {
ball_coll = ball_coll + 180;
}
if ((x_cat >= 0) && (y_cat < 0)) {
ball_coll = ball_coll + 360;
}
ground_rotation = ball_coll - 90;
if (ground_rotation < 0) {
ground_rotation = ground_rotation + 180;
}
bounce_angle = (180 - ball_dir) - (2 * ground_rotation);
if (bounce_angle < 0) {
bounce_angle = bounce_angle + 360;
}
speed = Math.sqrt((yspeed * yspeed) + (xspeed * xspeed));
xspeed = (speed * Math.cos((bounce_angle * Math.PI) / 180)) * friction;
yspeed = ((speed * Math.sin((bounce_angle * Math.PI) / 180)) * -1) * friction;
_x = old_x;
_y = old_y;
} else {
old_x = _x;
old_y = _y;
}
_y = (_y + yspeed);
_x = (_x + xspeed);
}
}
}
Frame 630 (461 B)
stop();
go = false;
createEmptyMovieClip("terrain", 1);
terrain.lineStyle(9, 14483677, 90);
imdrawing = false;
onMouseDown = function () {
if (!go) {
if (imdrawing == false) {
terrain.moveTo(_xmouse, _ymouse);
imdrawing = true;
}
if (imdrawing == true) {
onEnterFrame = function () {
terrain.lineTo(_xmouse, _ymouse);
};
}
}
};
onMouseUp = function () {
onEnterFrame = function () {
imdrawing = false;
};
};
Instance of Symbol 130 MovieClip "ball" in Frame 630 (1.95 KiB) ●
onClipEvent (load) {
yspeed = 0;
xspeed = 0;
gravity = 0.2;
radius = 5;
friction = 0.9;
precision = 360;
bounces = 0;
}
onClipEvent (enterFrame) {
if (_root.go == true) {
if (_root.exit.hitTest(_x, _y, true)) {
xspeed = 0;
yspeed = 0;
} else {
collisions = 0;
sum_x = 0;
sum_y = 0;
yspeed = yspeed + gravity;
x = 1;
while (x < precision) {
spot_x = _x + (radius * Math.sin((x * 360) / precision));
spot_y = _y - (radius * Math.cos((x * 360) / precision));
if (_root.terrain.hitTest(spot_x, spot_y, true)) {
collisions++;
sum_x = sum_x + spot_x;
sum_y = sum_y + spot_y;
}
x++;
}
if (collisions > 0) {
_root.last_hit._x = old_x;
_root.last_hit._y = old_y;
bounces++;
_root.collisions.text = "Bounces: " + bounces;
ball_dir = Math.atan(yspeed / (xspeed * -1)) / (Math.PI/180);
if ((xspeed * -1) < 0) {
ball_dir = ball_dir + 180;
}
if (((xspeed * -1) >= 0) && (yspeed < 0)) {
ball_dir = ball_dir + 360;
}
spot_x = sum_x / collisions;
spot_y = sum_y / collisions;
x_cat = spot_x - _x;
y_cat = spot_y - _y;
ball_coll = Math.atan(y_cat / x_cat) / (Math.PI/180);
if (x_cat < 0) {
ball_coll = ball_coll + 180;
}
if ((x_cat >= 0) && (y_cat < 0)) {
ball_coll = ball_coll + 360;
}
ground_rotation = ball_coll - 90;
if (ground_rotation < 0) {
ground_rotation = ground_rotation + 180;
}
bounce_angle = (180 - ball_dir) - (2 * ground_rotation);
if (bounce_angle < 0) {
bounce_angle = bounce_angle + 360;
}
speed = Math.sqrt((yspeed * yspeed) + (xspeed * xspeed));
xspeed = (speed * Math.cos((bounce_angle * Math.PI) / 180)) * friction;
yspeed = ((speed * Math.sin((bounce_angle * Math.PI) / 180)) * -1) * friction;
_x = old_x;
_y = old_y;
} else {
old_x = _x;
old_y = _y;
}
_y = (_y + yspeed);
_x = (_x + xspeed);
}
}
}
Frame 631 (461 B)
stop();
go = false;
createEmptyMovieClip("terrain", 1);
terrain.lineStyle(9, 14483677, 90);
imdrawing = false;
onMouseDown = function () {
if (!go) {
if (imdrawing == false) {
terrain.moveTo(_xmouse, _ymouse);
imdrawing = true;
}
if (imdrawing == true) {
onEnterFrame = function () {
terrain.lineTo(_xmouse, _ymouse);
};
}
}
};
onMouseUp = function () {
onEnterFrame = function () {
imdrawing = false;
};
};
Instance of Symbol 130 MovieClip "ball" in Frame 631 (1.95 KiB) ●
onClipEvent (load) {
yspeed = 0;
xspeed = 0;
gravity = 0.2;
radius = 5;
friction = 0.9;
precision = 360;
bounces = 0;
}
onClipEvent (enterFrame) {
if (_root.go == true) {
if (_root.exit.hitTest(_x, _y, true)) {
xspeed = 0;
yspeed = 0;
} else {
collisions = 0;
sum_x = 0;
sum_y = 0;
yspeed = yspeed + gravity;
x = 1;
while (x < precision) {
spot_x = _x + (radius * Math.sin((x * 360) / precision));
spot_y = _y - (radius * Math.cos((x * 360) / precision));
if (_root.terrain.hitTest(spot_x, spot_y, true)) {
collisions++;
sum_x = sum_x + spot_x;
sum_y = sum_y + spot_y;
}
x++;
}
if (collisions > 0) {
_root.last_hit._x = old_x;
_root.last_hit._y = old_y;
bounces++;
_root.collisions.text = "Bounces: " + bounces;
ball_dir = Math.atan(yspeed / (xspeed * -1)) / (Math.PI/180);
if ((xspeed * -1) < 0) {
ball_dir = ball_dir + 180;
}
if (((xspeed * -1) >= 0) && (yspeed < 0)) {
ball_dir = ball_dir + 360;
}
spot_x = sum_x / collisions;
spot_y = sum_y / collisions;
x_cat = spot_x - _x;
y_cat = spot_y - _y;
ball_coll = Math.atan(y_cat / x_cat) / (Math.PI/180);
if (x_cat < 0) {
ball_coll = ball_coll + 180;
}
if ((x_cat >= 0) && (y_cat < 0)) {
ball_coll = ball_coll + 360;
}
ground_rotation = ball_coll - 90;
if (ground_rotation < 0) {
ground_rotation = ground_rotation + 180;
}
bounce_angle = (180 - ball_dir) - (2 * ground_rotation);
if (bounce_angle < 0) {
bounce_angle = bounce_angle + 360;
}
speed = Math.sqrt((yspeed * yspeed) + (xspeed * xspeed));
xspeed = (speed * Math.cos((bounce_angle * Math.PI) / 180)) * friction;
yspeed = ((speed * Math.sin((bounce_angle * Math.PI) / 180)) * -1) * friction;
_x = old_x;
_y = old_y;
} else {
old_x = _x;
old_y = _y;
}
_y = (_y + yspeed);
_x = (_x + xspeed);
}
}
}
Frame 632 (461 B)
stop();
go = false;
createEmptyMovieClip("terrain", 1);
terrain.lineStyle(9, 14483677, 90);
imdrawing = false;
onMouseDown = function () {
if (!go) {
if (imdrawing == false) {
terrain.moveTo(_xmouse, _ymouse);
imdrawing = true;
}
if (imdrawing == true) {
onEnterFrame = function () {
terrain.lineTo(_xmouse, _ymouse);
};
}
}
};
onMouseUp = function () {
onEnterFrame = function () {
imdrawing = false;
};
};
Instance of Symbol 130 MovieClip "ball" in Frame 632 (1.95 KiB) ●
onClipEvent (load) {
yspeed = 0;
xspeed = 0;
gravity = 0.2;
radius = 5;
friction = 0.9;
precision = 360;
bounces = 0;
}
onClipEvent (enterFrame) {
if (_root.go == true) {
if (_root.exit.hitTest(_x, _y, true)) {
xspeed = 0;
yspeed = 0;
} else {
collisions = 0;
sum_x = 0;
sum_y = 0;
yspeed = yspeed + gravity;
x = 1;
while (x < precision) {
spot_x = _x + (radius * Math.sin((x * 360) / precision));
spot_y = _y - (radius * Math.cos((x * 360) / precision));
if (_root.terrain.hitTest(spot_x, spot_y, true)) {
collisions++;
sum_x = sum_x + spot_x;
sum_y = sum_y + spot_y;
}
x++;
}
if (collisions > 0) {
_root.last_hit._x = old_x;
_root.last_hit._y = old_y;
bounces++;
_root.collisions.text = "Bounces: " + bounces;
ball_dir = Math.atan(yspeed / (xspeed * -1)) / (Math.PI/180);
if ((xspeed * -1) < 0) {
ball_dir = ball_dir + 180;
}
if (((xspeed * -1) >= 0) && (yspeed < 0)) {
ball_dir = ball_dir + 360;
}
spot_x = sum_x / collisions;
spot_y = sum_y / collisions;
x_cat = spot_x - _x;
y_cat = spot_y - _y;
ball_coll = Math.atan(y_cat / x_cat) / (Math.PI/180);
if (x_cat < 0) {
ball_coll = ball_coll + 180;
}
if ((x_cat >= 0) && (y_cat < 0)) {
ball_coll = ball_coll + 360;
}
ground_rotation = ball_coll - 90;
if (ground_rotation < 0) {
ground_rotation = ground_rotation + 180;
}
bounce_angle = (180 - ball_dir) - (2 * ground_rotation);
if (bounce_angle < 0) {
bounce_angle = bounce_angle + 360;
}
speed = Math.sqrt((yspeed * yspeed) + (xspeed * xspeed));
xspeed = (speed * Math.cos((bounce_angle * Math.PI) / 180)) * friction;
yspeed = ((speed * Math.sin((bounce_angle * Math.PI) / 180)) * -1) * friction;
_x = old_x;
_y = old_y;
} else {
old_x = _x;
old_y = _y;
}
_y = (_y + yspeed);
_x = (_x + xspeed);
}
}
}
Frame 633 (461 B)
stop();
go = false;
createEmptyMovieClip("terrain", 1);
terrain.lineStyle(9, 14483677, 90);
imdrawing = false;
onMouseDown = function () {
if (!go) {
if (imdrawing == false) {
terrain.moveTo(_xmouse, _ymouse);
imdrawing = true;
}
if (imdrawing == true) {
onEnterFrame = function () {
terrain.lineTo(_xmouse, _ymouse);
};
}
}
};
onMouseUp = function () {
onEnterFrame = function () {
imdrawing = false;
};
};
Instance of Symbol 130 MovieClip "ball" in Frame 633 (1.95 KiB) ●
onClipEvent (load) {
yspeed = 0;
xspeed = 0;
gravity = 0.2;
radius = 5;
friction = 0.9;
precision = 360;
bounces = 0;
}
onClipEvent (enterFrame) {
if (_root.go == true) {
if (_root.exit.hitTest(_x, _y, true)) {
xspeed = 0;
yspeed = 0;
} else {
collisions = 0;
sum_x = 0;
sum_y = 0;
yspeed = yspeed + gravity;
x = 1;
while (x < precision) {
spot_x = _x + (radius * Math.sin((x * 360) / precision));
spot_y = _y - (radius * Math.cos((x * 360) / precision));
if (_root.terrain.hitTest(spot_x, spot_y, true)) {
collisions++;
sum_x = sum_x + spot_x;
sum_y = sum_y + spot_y;
}
x++;
}
if (collisions > 0) {
_root.last_hit._x = old_x;
_root.last_hit._y = old_y;
bounces++;
_root.collisions.text = "Bounces: " + bounces;
ball_dir = Math.atan(yspeed / (xspeed * -1)) / (Math.PI/180);
if ((xspeed * -1) < 0) {
ball_dir = ball_dir + 180;
}
if (((xspeed * -1) >= 0) && (yspeed < 0)) {
ball_dir = ball_dir + 360;
}
spot_x = sum_x / collisions;
spot_y = sum_y / collisions;
x_cat = spot_x - _x;
y_cat = spot_y - _y;
ball_coll = Math.atan(y_cat / x_cat) / (Math.PI/180);
if (x_cat < 0) {
ball_coll = ball_coll + 180;
}
if ((x_cat >= 0) && (y_cat < 0)) {
ball_coll = ball_coll + 360;
}
ground_rotation = ball_coll - 90;
if (ground_rotation < 0) {
ground_rotation = ground_rotation + 180;
}
bounce_angle = (180 - ball_dir) - (2 * ground_rotation);
if (bounce_angle < 0) {
bounce_angle = bounce_angle + 360;
}
speed = Math.sqrt((yspeed * yspeed) + (xspeed * xspeed));
xspeed = (speed * Math.cos((bounce_angle * Math.PI) / 180)) * friction;
yspeed = ((speed * Math.sin((bounce_angle * Math.PI) / 180)) * -1) * friction;
_x = old_x;
_y = old_y;
} else {
old_x = _x;
old_y = _y;
}
_y = (_y + yspeed);
_x = (_x + xspeed);
}
}
}
Frame 634 (461 B)
stop();
go = false;
createEmptyMovieClip("terrain", 1);
terrain.lineStyle(9, 14483677, 90);
imdrawing = false;
onMouseDown = function () {
if (!go) {
if (imdrawing == false) {
terrain.moveTo(_xmouse, _ymouse);
imdrawing = true;
}
if (imdrawing == true) {
onEnterFrame = function () {
terrain.lineTo(_xmouse, _ymouse);
};
}
}
};
onMouseUp = function () {
onEnterFrame = function () {
imdrawing = false;
};
};
Instance of Symbol 130 MovieClip "ball" in Frame 634 (1.95 KiB) ●
onClipEvent (load) {
yspeed = 0;
xspeed = 0;
gravity = 0.2;
radius = 5;
friction = 0.9;
precision = 360;
bounces = 0;
}
onClipEvent (enterFrame) {
if (_root.go == true) {
if (_root.exit.hitTest(_x, _y, true)) {
xspeed = 0;
yspeed = 0;
} else {
collisions = 0;
sum_x = 0;
sum_y = 0;
yspeed = yspeed + gravity;
x = 1;
while (x < precision) {
spot_x = _x + (radius * Math.sin((x * 360) / precision));
spot_y = _y - (radius * Math.cos((x * 360) / precision));
if (_root.terrain.hitTest(spot_x, spot_y, true)) {
collisions++;
sum_x = sum_x + spot_x;
sum_y = sum_y + spot_y;
}
x++;
}
if (collisions > 0) {
_root.last_hit._x = old_x;
_root.last_hit._y = old_y;
bounces++;
_root.collisions.text = "Bounces: " + bounces;
ball_dir = Math.atan(yspeed / (xspeed * -1)) / (Math.PI/180);
if ((xspeed * -1) < 0) {
ball_dir = ball_dir + 180;
}
if (((xspeed * -1) >= 0) && (yspeed < 0)) {
ball_dir = ball_dir + 360;
}
spot_x = sum_x / collisions;
spot_y = sum_y / collisions;
x_cat = spot_x - _x;
y_cat = spot_y - _y;
ball_coll = Math.atan(y_cat / x_cat) / (Math.PI/180);
if (x_cat < 0) {
ball_coll = ball_coll + 180;
}
if ((x_cat >= 0) && (y_cat < 0)) {
ball_coll = ball_coll + 360;
}
ground_rotation = ball_coll - 90;
if (ground_rotation < 0) {
ground_rotation = ground_rotation + 180;
}
bounce_angle = (180 - ball_dir) - (2 * ground_rotation);
if (bounce_angle < 0) {
bounce_angle = bounce_angle + 360;
}
speed = Math.sqrt((yspeed * yspeed) + (xspeed * xspeed));
xspeed = (speed * Math.cos((bounce_angle * Math.PI) / 180)) * friction;
yspeed = ((speed * Math.sin((bounce_angle * Math.PI) / 180)) * -1) * friction;
_x = old_x;
_y = old_y;
} else {
old_x = _x;
old_y = _y;
}
_y = (_y + yspeed);
_x = (_x + xspeed);
}
}
}
Frame 635 (461 B)
stop();
go = false;
createEmptyMovieClip("terrain", 1);
terrain.lineStyle(9, 14483677, 90);
imdrawing = false;
onMouseDown = function () {
if (!go) {
if (imdrawing == false) {
terrain.moveTo(_xmouse, _ymouse);
imdrawing = true;
}
if (imdrawing == true) {
onEnterFrame = function () {
terrain.lineTo(_xmouse, _ymouse);
};
}
}
};
onMouseUp = function () {
onEnterFrame = function () {
imdrawing = false;
};
};
Instance of Symbol 130 MovieClip "ball" in Frame 635 (1.95 KiB) ●
onClipEvent (load) {
yspeed = 0;
xspeed = 0;
gravity = 0.2;
radius = 5;
friction = 0.9;
precision = 360;
bounces = 0;
}
onClipEvent (enterFrame) {
if (_root.go == true) {
if (_root.exit.hitTest(_x, _y, true)) {
xspeed = 0;
yspeed = 0;
} else {
collisions = 0;
sum_x = 0;
sum_y = 0;
yspeed = yspeed + gravity;
x = 1;
while (x < precision) {
spot_x = _x + (radius * Math.sin((x * 360) / precision));
spot_y = _y - (radius * Math.cos((x * 360) / precision));
if (_root.terrain.hitTest(spot_x, spot_y, true)) {
collisions++;
sum_x = sum_x + spot_x;
sum_y = sum_y + spot_y;
}
x++;
}
if (collisions > 0) {
_root.last_hit._x = old_x;
_root.last_hit._y = old_y;
bounces++;
_root.collisions.text = "Bounces: " + bounces;
ball_dir = Math.atan(yspeed / (xspeed * -1)) / (Math.PI/180);
if ((xspeed * -1) < 0) {
ball_dir = ball_dir + 180;
}
if (((xspeed * -1) >= 0) && (yspeed < 0)) {
ball_dir = ball_dir + 360;
}
spot_x = sum_x / collisions;
spot_y = sum_y / collisions;
x_cat = spot_x - _x;
y_cat = spot_y - _y;
ball_coll = Math.atan(y_cat / x_cat) / (Math.PI/180);
if (x_cat < 0) {
ball_coll = ball_coll + 180;
}
if ((x_cat >= 0) && (y_cat < 0)) {
ball_coll = ball_coll + 360;
}
ground_rotation = ball_coll - 90;
if (ground_rotation < 0) {
ground_rotation = ground_rotation + 180;
}
bounce_angle = (180 - ball_dir) - (2 * ground_rotation);
if (bounce_angle < 0) {
bounce_angle = bounce_angle + 360;
}
speed = Math.sqrt((yspeed * yspeed) + (xspeed * xspeed));
xspeed = (speed * Math.cos((bounce_angle * Math.PI) / 180)) * friction;
yspeed = ((speed * Math.sin((bounce_angle * Math.PI) / 180)) * -1) * friction;
_x = old_x;
_y = old_y;
} else {
old_x = _x;
old_y = _y;
}
_y = (_y + yspeed);
_x = (_x + xspeed);
}
}
}
Frame 636 (461 B)
stop();
go = false;
createEmptyMovieClip("terrain", 1);
terrain.lineStyle(9, 14483677, 90);
imdrawing = false;
onMouseDown = function () {
if (!go) {
if (imdrawing == false) {
terrain.moveTo(_xmouse, _ymouse);
imdrawing = true;
}
if (imdrawing == true) {
onEnterFrame = function () {
terrain.lineTo(_xmouse, _ymouse);
};
}
}
};
onMouseUp = function () {
onEnterFrame = function () {
imdrawing = false;
};
};
Instance of Symbol 130 MovieClip "ball" in Frame 636 (1.95 KiB) ●
onClipEvent (load) {
yspeed = 0;
xspeed = 0;
gravity = 0.2;
radius = 5;
friction = 0.9;
precision = 360;
bounces = 0;
}
onClipEvent (enterFrame) {
if (_root.go == true) {
if (_root.exit.hitTest(_x, _y, true)) {
xspeed = 0;
yspeed = 0;
} else {
collisions = 0;
sum_x = 0;
sum_y = 0;
yspeed = yspeed + gravity;
x = 1;
while (x < precision) {
spot_x = _x + (radius * Math.sin((x * 360) / precision));
spot_y = _y - (radius * Math.cos((x * 360) / precision));
if (_root.terrain.hitTest(spot_x, spot_y, true)) {
collisions++;
sum_x = sum_x + spot_x;
sum_y = sum_y + spot_y;
}
x++;
}
if (collisions > 0) {
_root.last_hit._x = old_x;
_root.last_hit._y = old_y;
bounces++;
_root.collisions.text = "Bounces: " + bounces;
ball_dir = Math.atan(yspeed / (xspeed * -1)) / (Math.PI/180);
if ((xspeed * -1) < 0) {
ball_dir = ball_dir + 180;
}
if (((xspeed * -1) >= 0) && (yspeed < 0)) {
ball_dir = ball_dir + 360;
}
spot_x = sum_x / collisions;
spot_y = sum_y / collisions;
x_cat = spot_x - _x;
y_cat = spot_y - _y;
ball_coll = Math.atan(y_cat / x_cat) / (Math.PI/180);
if (x_cat < 0) {
ball_coll = ball_coll + 180;
}
if ((x_cat >= 0) && (y_cat < 0)) {
ball_coll = ball_coll + 360;
}
ground_rotation = ball_coll - 90;
if (ground_rotation < 0) {
ground_rotation = ground_rotation + 180;
}
bounce_angle = (180 - ball_dir) - (2 * ground_rotation);
if (bounce_angle < 0) {
bounce_angle = bounce_angle + 360;
}
speed = Math.sqrt((yspeed * yspeed) + (xspeed * xspeed));
xspeed = (speed * Math.cos((bounce_angle * Math.PI) / 180)) * friction;
yspeed = ((speed * Math.sin((bounce_angle * Math.PI) / 180)) * -1) * friction;
_x = old_x;
_y = old_y;
} else {
old_x = _x;
old_y = _y;
}
_y = (_y + yspeed);
_x = (_x + xspeed);
}
}
}
Frame 637 (471 B)
stop();
stop();
go = false;
createEmptyMovieClip("terrain", 1);
terrain.lineStyle(9, 14483677, 90);
imdrawing = false;
onMouseDown = function () {
if (!go) {
if (imdrawing == false) {
terrain.moveTo(_xmouse, _ymouse);
imdrawing = true;
}
if (imdrawing == true) {
onEnterFrame = function () {
terrain.lineTo(_xmouse, _ymouse);
};
}
}
};
onMouseUp = function () {
onEnterFrame = function () {
imdrawing = false;
};
};
Instance of Symbol 130 MovieClip "ball" in Frame 637 (1.95 KiB) ●
onClipEvent (load) {
yspeed = 0;
xspeed = 0;
gravity = 0.2;
radius = 5;
friction = 0.9;
precision = 360;
bounces = 0;
}
onClipEvent (enterFrame) {
if (_root.go == true) {
if (_root.exit.hitTest(_x, _y, true)) {
xspeed = 0;
yspeed = 0;
} else {
collisions = 0;
sum_x = 0;
sum_y = 0;
yspeed = yspeed + gravity;
x = 1;
while (x < precision) {
spot_x = _x + (radius * Math.sin((x * 360) / precision));
spot_y = _y - (radius * Math.cos((x * 360) / precision));
if (_root.terrain.hitTest(spot_x, spot_y, true)) {
collisions++;
sum_x = sum_x + spot_x;
sum_y = sum_y + spot_y;
}
x++;
}
if (collisions > 0) {
_root.last_hit._x = old_x;
_root.last_hit._y = old_y;
bounces++;
_root.collisions.text = "Bounces: " + bounces;
ball_dir = Math.atan(yspeed / (xspeed * -1)) / (Math.PI/180);
if ((xspeed * -1) < 0) {
ball_dir = ball_dir + 180;
}
if (((xspeed * -1) >= 0) && (yspeed < 0)) {
ball_dir = ball_dir + 360;
}
spot_x = sum_x / collisions;
spot_y = sum_y / collisions;
x_cat = spot_x - _x;
y_cat = spot_y - _y;
ball_coll = Math.atan(y_cat / x_cat) / (Math.PI/180);
if (x_cat < 0) {
ball_coll = ball_coll + 180;
}
if ((x_cat >= 0) && (y_cat < 0)) {
ball_coll = ball_coll + 360;
}
ground_rotation = ball_coll - 90;
if (ground_rotation < 0) {
ground_rotation = ground_rotation + 180;
}
bounce_angle = (180 - ball_dir) - (2 * ground_rotation);
if (bounce_angle < 0) {
bounce_angle = bounce_angle + 360;
}
speed = Math.sqrt((yspeed * yspeed) + (xspeed * xspeed));
xspeed = (speed * Math.cos((bounce_angle * Math.PI) / 180)) * friction;
yspeed = ((speed * Math.sin((bounce_angle * Math.PI) / 180)) * -1) * friction;
_x = old_x;
_y = old_y;
} else {
old_x = _x;
old_y = _y;
}
_y = (_y + yspeed);
_x = (_x + xspeed);
}
}
}
Frame 639 (8 B)
stop();
Symbol 46 Button (65 B)
on (release) {
getURL ("http://www.newgrounds.com", "_blank");
}
Symbol 48 MovieClip Frame 40 (8 B)
stop();
Symbol 74 Button (31 B)
on (release) {
_root.play();
}
Symbol 75 MovieClip Frame 1 (1.26 KiB) ●
function onEnterFrame() {
if (!loaded) {
var _local3 = _root.getBytesLoaded() / _root.getBytesTotal();
if (_local3 >= 1) {
play();
bar._x = initX;
loaded = true;
} else {
bar._x = initX + ((_local3 - 1) * bar._width);
}
}
var _local4 = getTimer() - time;
timeAccum = timeAccum + _local4;
while (timeAccum >= FRAME_TIME) {
var _local2 = 0;
while (_local2 < timeClips.length) {
if (timeClips[_local2]._currentframe < timeClips[_local2]._totalframes) {
timeClips[_local2].nextFrame();
} else {
timeClips[_local2].gotoAndStop(1);
}
_local2++;
}
if (loaded && (_currentframe < _totalframes)) {
nextFrame();
}
timeAccum = timeAccum - FRAME_TIME;
}
time = time + _local4;
}
stop();
_root.stop();
var initX = bar._x;
var time = getTimer();
var FRAME_TIME = 33.3333333333333;
var timeAccum = 0;
var loaded = false;
timeClips = [bargfx, tank.mc0, tank.mc1, tank.mc2, tank.mc3, tank.mc4, tank.mc4.mc0, tank.mc4.mc1, tank.mc4.mc0.mc0, tank.mc4.mc0.mc0.mc0.mc0, tank.mc4.mc0.mc0.mc0.mc1, tank.mc4.mc0.mc0.mc0.mc2, tank.mc4.mc0.mc0.mc0.mc3, tank.mc4.mc0.mc0.mc1, tank.mc4.mc0.mc0.mc2, tank.mc5.mc0];
var i = 0;
while (i < timeClips.length) {
timeClips[i].stop();
i++;
}
Symbol 75 MovieClip Frame 51 (1 B)
Symbol 93 Button (36 B)
on (release) {
gotoAndPlay (622);
}
Symbol 103 Button (36 B)
on (release) {
gotoAndPlay (624);
}
Symbol 106 Button (36 B)
on (release) {
gotoAndPlay (625);
}
Symbol 109 Button (182 B)
on (release) {
if (_quality == "LOW") {
_quality = "MEDIUM";
} else if (_quality == "MEDIUM") {
_quality = "HIGH";
} else if (_quality == "HIGH") {
_quality = "LOW";
}
}
Symbol 112 Button (36 B)
on (release) {
gotoAndPlay (623);
}
Symbol 123 Button (36 B)
on (release) {
gotoAndPlay (622);
}
Symbol 126 Button (36 B)
on (release) {
gotoAndPlay (626);
}
Symbol 134 Button (28 B)
on (release) {
go = true;
}
Symbol 137 Button (194 B)
on (release) {
_root.ball._x = 82;
_root.ball._y = 70;
_root.ball.xspeed = 0;
_root.ball.yspeed = 0;
_root.go = false;
_root.terrain.clear();
_root.terrain.lineStyle(10, 14483677, 100);
}
Symbol 152 Button (194 B)
on (release) {
_root.ball._x = 97;
_root.ball._y = 75;
_root.ball.xspeed = 0;
_root.ball.yspeed = 0;
_root.go = false;
_root.terrain.clear();
_root.terrain.lineStyle(10, 14483677, 100);
}
Symbol 155 Button (36 B)
on (release) {
gotoAndPlay (626);
}
Symbol 161 Button (36 B)
on (release) {
gotoAndPlay (628);
}
Symbol 162 Button (195 B)
on (release) {
_root.ball._x = 458;
_root.ball._y = 85;
_root.ball.xspeed = 0;
_root.ball.yspeed = 0;
_root.go = false;
_root.terrain.clear();
_root.terrain.lineStyle(10, 14483677, 100);
}
Symbol 168 Button (36 B)
on (release) {
gotoAndPlay (629);
}
Symbol 170 Button (194 B)
on (release) {
_root.ball._x = 27;
_root.ball._y = 47;
_root.ball.xspeed = 0;
_root.ball.yspeed = 0;
_root.go = false;
_root.terrain.clear();
_root.terrain.lineStyle(10, 14483677, 100);
}
Symbol 176 Button (36 B)
on (release) {
gotoAndPlay (630);
}
Symbol 178 Button (195 B)
on (release) {
_root.ball._x = 470;
_root.ball._y = 36;
_root.ball.xspeed = 0;
_root.ball.yspeed = 0;
_root.go = false;
_root.terrain.clear();
_root.terrain.lineStyle(10, 14483677, 100);
}
Symbol 183 Button (36 B)
on (release) {
gotoAndPlay (630);
}
Symbol 185 Button (195 B)
on (release) {
_root.ball._x = 99;
_root.ball._y = 113;
_root.ball.xspeed = 0;
_root.ball.yspeed = 0;
_root.go = false;
_root.terrain.clear();
_root.terrain.lineStyle(10, 14483677, 100);
}
Symbol 190 Button (36 B)
on (release) {
gotoAndPlay (631);
}
Symbol 191 Button (195 B)
on (release) {
_root.ball._x = 99;
_root.ball._y = 129;
_root.ball.xspeed = 0;
_root.ball.yspeed = 0;
_root.go = false;
_root.terrain.clear();
_root.terrain.lineStyle(10, 14483677, 100);
}
Symbol 196 Button (195 B)
on (release) {
_root.ball._x = 271;
_root.ball._y = 47;
_root.ball.xspeed = 0;
_root.ball.yspeed = 0;
_root.go = false;
_root.terrain.clear();
_root.terrain.lineStyle(10, 14483677, 100);
}
Symbol 198 Button (36 B)
on (release) {
gotoAndPlay (632);
}
Symbol 202 Button (195 B)
on (release) {
_root.ball._x = 196;
_root.ball._y = 82;
_root.ball.xspeed = 0;
_root.ball.yspeed = 0;
_root.go = false;
_root.terrain.clear();
_root.terrain.lineStyle(10, 14483677, 100);
}
Symbol 204 Button (36 B)
on (release) {
gotoAndPlay (633);
}
Symbol 210 Button (195 B)
on (release) {
_root.ball._x = 506;
_root.ball._y = 89;
_root.ball.xspeed = 0;
_root.ball.yspeed = 0;
_root.go = false;
_root.terrain.clear();
_root.terrain.lineStyle(10, 14483677, 100);
}
Symbol 212 Button (36 B)
on (release) {
gotoAndPlay (634);
}
Symbol 217 Button (36 B)
on (release) {
gotoAndPlay (635);
}
Symbol 222 Button (195 B)
on (release) {
_root.ball._x = 310;
_root.ball._y = 89;
_root.ball.xspeed = 0;
_root.ball.yspeed = 0;
_root.go = false;
_root.terrain.clear();
_root.terrain.lineStyle(10, 14483677, 100);
}
Symbol 223 Button (36 B)
on (release) {
gotoAndPlay (637);
}
Symbol 227 Button (196 B)
on (release) {
_root.ball._x = 483;
_root.ball._y = 126;
_root.ball.xspeed = 0;
_root.ball.yspeed = 0;
_root.go = false;
_root.terrain.clear();
_root.terrain.lineStyle(10, 14483677, 100);
}
Symbol 228 Button (36 B)
on (release) {
gotoAndPlay (638);
}
Symbol 237 Button (36 B)
on (release) {
gotoAndPlay (622);
}