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

Username:   Password: 
 RegisterRegister   
 I need help creating a timer on my pac man isu game due tomorrow! Please help! URGENT!!!!
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Ganan




PostPosted: Mon May 07, 2012 7:55 pm   Post subject: I need help creating a timer on my pac man isu game due tomorrow! Please help! URGENT!!!!

What is it you are trying to achieve?
<Replace all the <> with your answers/code and remove the <>>


What is the problem you are having?
<Answer Here>


Describe what you have tried to solve this problem
<Answer Here>


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
<Answer Here>

Turing:


<Add your code here>



Please specify what version of Turing you are using
<Answer Here>
Crying or Very sad Crying or Very sad
Sponsor
Sponsor
Sponsor
sponsor
rdrake




PostPosted: Mon May 07, 2012 8:24 pm   Post subject: RE:I need help creating a timer on my pac man isu game due tomorrow! Please help! URGENT!!!!

I think posting some code and/or a description of the problem might help immensely.
Amarylis




PostPosted: Mon May 07, 2012 8:24 pm   Post subject: RE:I need help creating a timer on my pac man isu game due tomorrow! Please help! URGENT!!!!

Er, if you're expecting us to give you the answer, you've got the wrong mindset. My only advice will be to take a look at the Time module, and see how you can use it in your program
Tony




PostPosted: Mon May 07, 2012 8:41 pm   Post subject: RE:I need help creating a timer on my pac man isu game due tomorrow! Please help! URGENT!!!!

Chances are that the post got swallowed during the preview.

The easiest way to count "time" is to count the number of frames you draw. In your main loop, just add an increment
code:

loop
   % get input
   % move stuff
   % draw stuff
   timer += 1
end loop

The advantages is that it's very easy and gives you discrete numbers to work with (much simpler to understand than fractions of seconds and what "time" really means to a computer program).

The disadvantage is that it assumes that all of your frames take the same amount of time to complete... but for the most part this should be approximately true.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Raknarg




PostPosted: Tue May 08, 2012 11:05 am   Post subject: RE:I need help creating a timer on my pac man isu game due tomorrow! Please help! URGENT!!!!

Thats why I use different timers for different events
Amarylis




PostPosted: Wed May 09, 2012 9:06 pm   Post subject: RE:I need help creating a timer on my pac man isu game due tomorrow! Please help! URGENT!!!!

I"ve thankfully not needed to use many timers in projects. As a matter of fact, I've never had to use more than 1 timer at any one time, and it was just a 2 minute countdown
Raknarg




PostPosted: Thu May 10, 2012 12:40 pm   Post subject: RE:I need help creating a timer on my pac man isu game due tomorrow! Please help! URGENT!!!!

Well, in some games I have enemies that each need their own timer (shooting and such). having multiple timers isnt bad if you do it right. But if you don't, it could be a nightmare trying to do it all, remembering what does what, etc.
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  [ 7 Posts ]
Jump to:   


Style:  
Search: