Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Bad collision in Pong game

Author
Message
Didvyris
15
Years of Service
User Offline
Joined: 19th Feb 2011
Location:
Posted: 19th Feb 2011 21:44
I cant find why after 4 sometimes more bounces collision stops working for pads. Can someone help?

enderleit
19
Years of Service
User Offline
Joined: 30th May 2007
Location: Denmark
Posted: 19th Feb 2011 22:29
When the ball speed gets too high it will sometimes be in front of the bat, and then on the next frame it will already be behind the bat (due to the high speed) and thus it never collides with the bat...

Didvyris
15
Years of Service
User Offline
Joined: 19th Feb 2011
Location:
Posted: 19th Feb 2011 22:58
Thanks, now it works if I limit ball speed. But if I want more faster gameplay? How to achieve it?
LBFN
19
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 20th Feb 2011 00:12
Quote: "But if I want more faster gameplay? How to achieve it?"

If you are asking how to make the ball move faster and still have decent collision, you could simply call your ball() function twice in every game loop.

Login to post a reply

Server time is: 2026-07-17 17:23:57
Your offset time is: 2026-07-17 17:23:57