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.

Newcomers DBPro Corner / Collision Problem?(Not Sure) On Pong

Author
Message
Deliriouz
14
Years of Service
User Offline
Joined: 25th Jul 2010
Location:
Posted: 26th Jul 2010 05:14
I've just started a pong code just for learning purposes and for practice, and it all works well until it goes to hit the right paddle for the second time, and it just goes right through the paddle. Here's the full code
Hodgey
15
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 26th Jul 2010 11:07
Hi, I made a few minor changes to your code and got it to work, I have commented what I changed.



The thing that seemed to make the difference is the wrapvalue command but I don't know why because if you compare what the wrapvalue command does and your code, they both do the same thing. Also, it accepts your code with your second collision test but not your first.

Something to think about but atleast its working now

A clever person solves a problem, a wise person avoids it - Albert Einstein
Deliriouz
14
Years of Service
User Offline
Joined: 25th Jul 2010
Location:
Posted: 26th Jul 2010 22:34
Thanks alot, I actually ended up changing my code quite a lot in the end, but your help helped me realize what i was doing wrong. Thanks. <==== Penguin

Login to post a reply

Server time is: 2024-11-24 14:04:31
Your offset time is: 2024-11-24 14:04:31