Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 I know you guys must be tired of these, but take a look at my Pong game? :$
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Wakening




PostPosted: 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. Smile


v1 Pong.t
 Description:

Download
 Filename:  v1 Pong.t
 Filesize:  6.29 KB
 Downloaded:  164 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
mirhagk




PostPosted: 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




PostPosted: 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




PostPosted: 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




PostPosted: 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




PostPosted: Tue Jan 03, 2012 11:59 am   Post subject: RE:I know you guys must be tired of these, but take a look at my Pong game? :$

You can look at the documentation for details on use -- Time.DelaySinceLast
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Wakening




PostPosted: 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. Smile

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




PostPosted: 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
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 8 Posts ]
Jump to:   


Style:  
Search: