angle and speed

Blitz3D Forums/Blitz3D Beginners Area/angle and speed

Ash_UK(Posted 2004) [#1]
Could anyone please tell me how to calculate the angle and speed of a ball when it collides with a bat, like in a breakout game. Also would it be possible to show me some code to see it working.
Thankyou for any reply.

DeViL


Rob Farley(Posted 2004) [#2]
Easiest way quite frankly is not worry about speed and angle.

Use Xspeed and Yspeed

When the ball hits the bat may yspeed = -yspeed, and adjust the xspeed depending on where on the bat the ball hits.




Ash_UK(Posted 2004) [#3]
Thankyou so much much Rob, it works now ^-^. And also thankyou very much for the speedily reply, i really appriciate it.

DeViL