Computer Science Canada Pong With Single Player - Suggestions? |
Author: | trevorprella [ Sat Feb 21, 2009 3:42 pm ] |
Post subject: | Pong With Single Player - Suggestions? |
Is there any way to shorten this a bit, because it took up alot of space to do the scores, and when youre writing text with a font, it wont let you put in integer variables. Is there any way to get around that? |
Author: | BigBear [ Sat Feb 21, 2009 3:49 pm ] |
Post subject: | Re: Pong With Single Player - Suggestions? |
I have not looked at your code but to add integers into Font.Draw you have to convert them into a string with intstr. So instead of just putting your variable put intstr(variable) Edit: I understand what you mean about the scoring. If you use intstr(p1s) or intstr(p2s) you should shorten it quite a bit. |
Author: | trevorprella [ Sat Feb 21, 2009 3:57 pm ] |
Post subject: | RE:Pong With Single Player - Suggestions? |
Ok thanks it works alot better now without the extra 50 lines of code |
Author: | BigBear [ Sat Feb 21, 2009 4:02 pm ] |
Post subject: | Re: Pong With Single Player - Suggestions? |
You mean 68 in both single player and 2 player. Also you need to make the AI not have the same y position as the ball. |
Author: | Insectoid [ Sat Feb 21, 2009 5:33 pm ] |
Post subject: | RE:Pong With Single Player - Suggestions? |
What I did for my AI was check the ball's Y in relation to the AI paddle's Y. If it's greater, move the paddle up. If it's less, move it down. By varying the speed of the paddle I was able to make differing levels of difficulty. |
Author: | saltpro15 [ Sat Feb 21, 2009 6:03 pm ] |
Post subject: | Re: Pong With Single Player - Suggestions? |
here's my pong with AI, hope it helps |