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

Username:   Password: 
 RegisterRegister   
 Pong game work until loop, then freezes and doesn't output properly
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Wakening




PostPosted: Mon Jan 02, 2012 8:19 pm   Post subject: Pong game work until loop, then freezes and doesn't output properly

What is it you are trying to achieve?
To successfully loop my pong game.


What is the problem you are having?
This is my first ever game, and is a clone of classic Pong. It will run perfectly fine for one game (until someone reaches 2 points). When the loop is activated, somehow it "freezes". The strangest thing is, the program is still running fine, but the output will only update itself when you click outside the run window and click back in. This is nothing like anything I've ever seen before. I feel really bad for uploading my entire .t but I don't see any other way of showing you guys exactly what's happening. Any help will be greatly appreciated. Thank you.


Describe what you have tried to solve this problem
Debugging for over 3 hours. Lowering the pressure on my computer by adding delays. Using different methods of user input (getch, Input.KeyDown etc). Generally rearranging the order.


Please specify what version of Turing you are using
4.1.1



Pong.t
 Description:
Classic pong clone.

Download
 Filename:  Pong.t
 Filesize:  6.18 KB
 Downloaded:  71 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
ttm




PostPosted: Mon Jan 02, 2012 9:16 pm   Post subject: Re: Pong game work until loop, then freezes and doesn't output properly

You forgot to call View.Update before your delay (5000)s on lines 162 and 166. Also you should do View.Set ("offscreenonly") only once at the top of your program.
Wakening




PostPosted: Mon Jan 02, 2012 9:49 pm   Post subject: Re: Pong game work until loop, then freezes and doesn't output properly

Aha, wow I didn't see that. Embarassed

Thanks a lot! Very Happy
ttm




PostPosted: Mon Jan 02, 2012 9:53 pm   Post subject: Re: Pong game work until loop, then freezes and doesn't output properly

NP=P
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: