I am re-creating pong
I want my ball to bounce of the walls which it does (result)
I have written an ai paddle for the player to play against
However at the moment the ai paddle hits the walls and bounces of them
Each time the step is called (every 20 milliseconds or so) on the box2d world I check the paddles position and velocity
My world is 500 high (with walls 2 meters high) so when the paddle is at 450 and is travelling downwards I set the velocity = 0
However my paddle always hits the wall!
I've added logging code and it appears my check is called too late - even though its called with every step!
Any ideas?
I want my ball to bounce of the walls which it does (result)
I have written an ai paddle for the player to play against
However at the moment the ai paddle hits the walls and bounces of them
Each time the step is called (every 20 milliseconds or so) on the box2d world I check the paddles position and velocity
My world is 500 high (with walls 2 meters high) so when the paddle is at 450 and is travelling downwards I set the velocity = 0
However my paddle always hits the wall!
I've added logging code and it appears my check is called too late - even though its called with every step!
Any ideas?