Author |
Message |
Wakening
|
Posted: Mon Jan 02, 2012 11:21 pm Post subject: I know you guys must be tired of these, but take a look at my Pong game? :$ |
|
|
I'd very much appreciate some feedback on this. It's my first legitimate Turing project. Any feedback would be great.
Description: |
|
Download |
Filename: |
v1 Pong.t |
Filesize: |
6.29 KB |
Downloaded: |
164 Time(s) |
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
mirhagk
|
Posted: Mon Jan 02, 2012 11:41 pm Post subject: RE:I know you guys must be tired of these, but take a look at my Pong game? :$ |
|
|
2 suggestions, 1 minor and 1 major. The minor one is that only the player who got scored against should be able to start the ball.
The major one has to do with delays, and the fact you have none. I'm assuming your machine is a lot slower than mine, since I could barely see the ball before I lost. Look into delay, and specifically Time.DelaySinceLast() which will make it so that nearly every machine will run at the same rate (assuming it's fast enough to keep up)
|
|
|
|
|
|
Wakening
|
Posted: Tue Jan 03, 2012 12:37 am Post subject: Re: I know you guys must be tired of these, but take a look at my Pong game? :$ |
|
|
Actually, I did have delays slowing the speed of the entire game, but I felt it was too slow. Though I didn't think of the idea that it might run at different speeds on different computers. Thanks for the suggestion.
|
|
|
|
|
|
mirhagk
|
Posted: Tue Jan 03, 2012 9:22 am Post subject: RE:I know you guys must be tired of these, but take a look at my Pong game? :$ |
|
|
Time.DelaySinceLast is what you probably want. You can set it to a certain delay, and if the computer takes too long then it won't do the delay at all.
|
|
|
|
|
|
Wakening
|
Posted: Tue Jan 03, 2012 10:34 am Post subject: Re: I know you guys must be tired of these, but take a look at my Pong game? :$ |
|
|
code: | Time.DelaySinceLast (Time that computer pauses for regardless of machine speed) |
Would that be how it is used? It sounds really useful for situations where delay should be accurate.
|
|
|
|
|
|
Tony
|
|
|
|
|
Wakening
|
Posted: Tue Jan 03, 2012 3:30 pm Post subject: RE:I know you guys must be tired of these, but take a look at my Pong game? :$ |
|
|
Thanks, I've implemented the Time.DelaySinceLast and it's looking pretty good.
One thing I'm trying to do is create a basic AI for a one player mode. Is there any strategies to do that besides just making the computer paddle try and copy the ball's y-value?
|
|
|
|
|
|
mirhagk
|
Posted: Tue Jan 03, 2012 9:15 pm Post subject: RE:I know you guys must be tired of these, but take a look at my Pong game? :$ |
|
|
Well one way of doing it is just having the AI follow the ball, each loop randomly checking to see if the AI moves.
Another, better way, is to calculate where the ball will be when it reaches the paddle (like a human does) and throw in a random amount of error so it can be wrong sometimes.
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
|