Bouncing ball

BlitzMax Forums/BlitzMax Beginners Area/Bouncing ball

Ash_UK(Posted 2005) [#1]
Hi people. Can anyone tell me how to go about programming a bouncing ball, and maybe show me some example code please. I have tried, but i just can't seem to do it.

Thankyou
Devil


tonyg(Posted 2005) [#2]
near the bottom


Filax(Posted 2005) [#3]
You must calibrate the ball setting like this :

If BallPX>=800 then
MovementX=-MovementX
endif

If BallPX<=0 then
MovementX=-MovementX
endif

If BallPY<=0 then
MovementY=-MovementY
endif

If BallPY>=600 then
MovementY=-MovementY
endif

BallPx=BallPx+MovementX
BallPy=BallPy+MovementY

DrawImage MyBall,BallPx,BallPy

I hope this help you :)


Ash_UK(Posted 2005) [#4]
Thankyou very much filax and tony g. I really appriciate both your help.

Thanks again :)