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

Username:   Password: 
 RegisterRegister   
 Timer Help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Gunz




PostPosted: Sat Jan 01, 2011 1:11 pm   Post subject: Timer Help

What is it you are trying to achieve?
I want to display a timer for my game.

What is the problem you are having?
Once my level finishes the timer that was being displayed keeps counting down, even once I get into the main menu

When I use a variable in which I store an int, I cant use Font.Text to display it, and when I use an string, I can't subtract by 10, So I decided to not use any at all and just display each number (e.g 180..170..160) after a delay.
How can I stop this?
Please Help!!!
Sponsor
Sponsor
Sponsor
sponsor
ProgrammingFun




PostPosted: Sat Jan 01, 2011 1:29 pm   Post subject: RE:Timer Help

You should add some if structure to stop the timer:
Turing:

if %level ends
      %reset the timer
end if
TerranceN




PostPosted: Sat Jan 01, 2011 1:36 pm   Post subject: RE:Timer Help

Use an int, and to use Draw.Text you can convert that int to a string using intstr. Say your int was called counter, you could draw it like:

Turing:

Draw.Text(intstr(counter), 0, 0, defFontID, black)


Theres conversions between most (if not all) variable types, their names are usually [current type][type you want], hence intstr. The only exception I know of is from real to int which is called round instead.
Gunz




PostPosted: Sat Jan 01, 2011 2:51 pm   Post subject: Re: Timer Help

Thanks ALOT!!!
The conversation thingy works and I can display it properly!!!!
Very Happy Very Happy Very Happy
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: