Computer Science Canada Yes, another pong game. |
Author: | Jekate [ Fri Sep 29, 2006 7:43 pm ] | ||
Post subject: | Yes, another pong game. | ||
Ok, I'm working on a basic pong game for now. Not for class, just for fun. Anyways, this is what I got so far, with NO processes:
Ok, now I can't get my collision detection to work. It just passes through the paddle. Now I haven't looked at it for too long, so I may just end up finding my error, but for now I cannot. |
Author: | TokenHerbz [ Sat Sep 30, 2006 12:02 am ] |
Post subject: | |
well, first its all about where your paddle is, if you can make it bounce off the wall, then you can make it bounce off the paddle. your paddle is "x" amount more then 0, and "x" amount less then maxx, i think you can make it work. |
Author: | Jekate [ Sat Sep 30, 2006 8:20 am ] | ||
Post subject: | |||
Ty for the help. I knew I could do it that way, but I guess I never realy tried it. Here is the altered code:
+bits (only a few cuz I got little of them lol) |
Author: | Jekate [ Sat Sep 30, 2006 11:18 am ] |
Post subject: | |
I can't edit my post above ^^ so I guess I have to post another one. Ok, now I got it to bounce of the paddles, somewhat correctly. If the ball comes in at exactly the right points, the ball bounces back and forth, on the paddle. Anyway to fix this? |
Author: | TokenHerbz [ Sat Sep 30, 2006 2:54 pm ] |
Post subject: | |
Yes, you must take in all the dimentions of the paddle. the paddle is taller then just "y" point, even though you draw your paddle 20 pix higher then the pady var, you need to use that in your collition code. |
Author: | Clayton [ Mon Oct 02, 2006 9:16 am ] |
Post subject: | |
look into the tutorial in the Turing Walkthrough about collision detection, you should find all you need there PS Tokenherbz, your avatar is too big |