Author |
Message |
trevorprella
|
Posted: 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?
Description: |
|
Download |
Filename: |
pong.t |
Filesize: |
9.25 KB |
Downloaded: |
166 Time(s) |
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
BigBear
|
Posted: 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.
|
|
|
|
|
|
trevorprella
|
Posted: 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
|
|
|
|
|
|
BigBear
|
Posted: 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.
|
|
|
|
|
|
Insectoid
|
Posted: 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.
|
|
|
|
|
|
saltpro15
|
Posted: Sat Feb 21, 2009 6:03 pm Post subject: Re: Pong With Single Player - Suggestions? |
|
|
here's my pong with AI, hope it helps
Description: |
|
Download |
Filename: |
pong demo.t |
Filesize: |
4.43 KB |
Downloaded: |
117 Time(s) |
|
|
|
|
|
|
|