Computer Science Canada I need help with pong |
Author: | uknowhoiam [ Fri Mar 13, 2009 4:39 pm ] | ||||
Post subject: | I need help with pong | ||||
I have alot of questions about this program but the main one is that how to make my ball bounce back when it hits the bar, i've tried everything but nothing works and my flickering will NOT STOP omg my head hurts... its been 2 weeks since i've been trying to fix it here's my code, can some one plz help me
Mod Edit: Remember to use syntax tags! Thanks ![]()
|
Author: | corriep [ Fri Mar 13, 2009 9:51 pm ] | ||||
Post subject: | Re: I need help with pong | ||||
First off, code tags [ syntax="turing"]code here[ /syntax] without the spaces. Secondly your View.Set is worded wrong
Third, always try to organize your main loop like this:
I would also recommend that you look into Input.KeyDown instead of getch. As for your problem of making the ball bounce you would have two things to consider; is the ball touching the paddle and which direction is the ball going. After that its just a matter of switching directions. Good luck, tell us if you have any more questions ![]() Mod Edit: Code tags are for the general Pseudo code ![]() |
Author: | uknowhoiam [ Fri Mar 13, 2009 11:02 pm ] | ||||||
Post subject: | RE:I need help with pong | ||||||
k i dont understand the syntax turing thing.. can you tell me how to use that and about the program what i did was
Nothing happens here is what i have (im going to try the syntax)
Mod Edit: Remember to use syntax tags! Copy the tags, and put your code where the code here is ![]()
|
Author: | uknowhoiam [ Sat Mar 14, 2009 9:58 am ] | ||
Post subject: | RE:I need help with pong | ||
K i got the ball to bounce back but the problem is that it bounces down only, if i make it bounce up, i get an error here's my got
|
Author: | corriep [ Sat Mar 14, 2009 11:06 am ] | ||
Post subject: | Re: I need help with pong | ||
The game seems to work fine for me. The only thing you have to fix now is the flickering. To fix that, look at your code, how many View.Updates do you have, why do you need that many, try putting
View.Update should only be used when everything is drawn and you want to display it. |
Author: | uknowhoiam [ Sat Mar 14, 2009 4:30 pm ] | ||
Post subject: | RE:I need help with pong | ||
k i fixed the flickering , i only need to know how to change the score, my score will not change, here's my code
|
Author: | BigBear [ Sat Mar 14, 2009 6:10 pm ] |
Post subject: | RE:I need help with pong |
The score is updating, you just arn't displaying both score1 and score2. |
Author: | corriep [ Sat Mar 14, 2009 6:17 pm ] | ||
Post subject: | RE:I need help with pong | ||
Quick tip: Getting rid of
![]() |
Author: | BigBear [ Sat Mar 14, 2009 6:28 pm ] | ||||
Post subject: | Re: RE:I need help with pong | ||||
corriep @ Sat Mar 14, 2009 6:17 pm wrote: Quick tip: Getting rid of
![]() Actually what that does it make it more senetive, it is able to get more inputs in a shorter time. if you were to use
|
Author: | uknowhoiam [ Sat Mar 14, 2009 6:31 pm ] | ||
Post subject: | RE:I need help with pong | ||
i dont get it, my score still wont update this is what i did
|
Author: | uknowhoiam [ Sat Mar 14, 2009 11:07 pm ] | ||||
Post subject: | RE:I need help with pong | ||||
NVM i got it work Here's my code
for the score this is what i did
|
Author: | uknowhoiam [ Sun Mar 15, 2009 1:15 am ] | ||
Post subject: | RE:I need help with pong | ||
Sorry im having too much fun, the keyboard lag is out
|
: |