countdown timer

Started by Ethan D, Tue 05/05/2009 00:47:06

Previous topic - Next topic

Ethan D

How exactly would I make a countdown timer like at the top of the screen counting down from 10?

Khris

This has been asked and answered several times. A search for "countdown" should produce at least a few useful threads.

Akatosh

To be exact, the first result the forum search returns should answer your questions just fine.  :P

Hudders

Whilst it is a good idea to search the forum for where it's been asked before, my problem with that approach is that a lot of old posts refer to older versions of AGS and out of date syntax. With the link Akatosh posted being from 2007, I wouldn't know whether that was still valid or not.

Akatosh

Well, trying doesn't hurt, does it? And in a fit, you can always enable legacy code in the game's setting pane (by setting everything that starts with "Enforce" to false).

Invalid

what i would do is create the images of 0-10 and import them as sprites. then i would make a view and set the delay so it is timed decrease the number exactly at the second marks. finaly i would have it animate as the timer starts. so maybe then they would be in sync

Trent R

That seems like a lot of extra work Sasuke... Though if you wanted to use sprites, I'd suggest using a integer that counts down (as discussed in the linked threads) along with something like if (countdown<240) button.NormalGraphic=ONE_SEC_SPRITE;. That'll give you much better control over the timer and the display (sprites or not), rather than trying to use .Animate and hoping it syncs.


~Trent
To give back to the AGS community, I can get you free, full versions of commercial software. Recently, Paint Shop Pro X, and eXPert PDF Pro 6. Please PM me for details.


Current Project: The Wanderer
On Hold: Hero of the Rune

SMF spam blocked by CleanTalk