I was just playing around in Flash, but I came across a problem.
I want a ball to move at the speed the user enters, and I put this code in for the ball:
onClipEvent (load) {
xv = 0;
yv = 0;
g = 0.6;
f = 0.9;
_x = 0;
go = false;
radius = _width/2;
}
onClipEvent (enterFrame) {
if (go) {
xv = _root.speed;
yv += g;
if (_y+radius>=400) {
_y = 400-radius;
if (yv <= 1){
yv = 0;
g = 0;
} else {
yv = -yv+5;
}
}
_x += xv;
_y += yv;
}
}
But when I test it, nothing happens, the ball just bounces in place. Help?