Frame 1
g = 100;
kicked = 0;
elastic = 0.8;
score = 0;
lastscore = 0;
bestscore = 0;
BallRadius = _root.ball._height / 2;
Instance of Symbol 13 MovieClip "ballshadow" in Frame 1
/* no clip actions */
Frame 2
t = t + 0.1;
oldx = x;
oldy = y;
x = _root.ball._x;
y = _root.ball._y;
vy = vy + (g / 10);
x = x + (vx / 10);
y = y + (vy / 10);
if (y < BallRadius) {
y = BallRadius;
vx = vx * elastic;
vy = -(vy * elastic);
}
if ((300 - BallRadius) < y) {
if (kicked == 1) {
kicked = 0;
if (bestscore < score) {
bestscore = score;
Set("../score/:my_score", bestscore);
}
lastscore = score;
score = 0;
}
y = 300 - BallRadius;
vx = vx * elastic;
vy = -(vy * elastic);
}
if (x < BallRadius) {
x = BallRadius;
vx = -(vx * elastic);
vy = vy * elastic;
}
if ((400 - BallRadius) < x) {
x = 400 - BallRadius;
vx = -(vx * elastic);
vy = vy * elastic;
}
_root.ball._x = x;
_root.ball._y = y;
setProperty("ballshadow", _x , x);
setProperty("ballshadow", _y , y);
setProperty("Ball", _rotation , x);
setProperty("Ball", _xscale , 100);
setProperty("Ball", _yscale , 100);
setProperty("Ball", _xscale , 100);
setProperty("Ball", _yscale , 100);
setProperty("shadow", _x , getProperty("Ball", _x));
setProperty("shadow", _alpha , (getProperty("Ball", _y) / 2) - 20);
Frame 3
gotoAndPlay (2);
Frame 4
kicked = 1;
t = t + 0.1;
oldx = x;
oldy = y;
x = getProperty("Ball", _x);
y = getProperty("Ball", _y);
(random(3) / 10) - 0;
vx = ((getProperty("Ball", _x) - _xmouse) * 10) + 15;
vy = -125 + (y - _ymouse);
dx = getProperty("Ball", _x) - _xmouse;
if (0 < dx) {
vy = vy + dx;
} else if (dx < 0) {
vy = vy - dx;
}
if (y < BallRadius) {
y = BallRadius;
vx = vx * elastic;
vy = -(vy * elastic);
}
if ((300 - BallRadius) < y) {
if (bestscore < score) {
bestscore = score;
}
score = 0;
y = 300 - BallRadius;
vx = vx * elastic;
vy = -(vy * elastic);
}
if (x < BallRadius) {
x = BallRadius;
vx = -(vx * elastic);
vy = vy * elastic;
}
if ((400 - BallRadius) < x) {
x = 400 - BallRadius;
vx = -(vx * elastic);
vy = vy * elastic;
}
setProperty("Ball", _x , x);
setProperty("Ball", _y , y);
setProperty("Ball", _rotation , x);
setProperty("Ball", _xscale , 100);
setProperty("Ball", _yscale , 100);
gotoAndPlay (2);
Symbol 10 Button
on (press) {
play();
tellTarget ("../") {
score = score + 1;
call("kick");
};
}
Symbol 11 MovieClip Frame 1
stop();