Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   Share Objects (http://www.alice.org/community/forumdisplay.php?f=8)
-   -   Countdown timer object (http://www.alice.org/community/showthread.php?t=7678)

davidghemer 11-28-2011 08:10 PM

Countdown timer object
 
1 Attachment(s)
Apologies if similar objects have been posted before, but here's my version of a countdown timer object.

The main methods are
- displayTime, refreshes the time
- updateTime, occurs approximately every second
- resetTime, resets the time to the default starting time
- setTime, sets the default starting time. Also sets the current time to the default
- stopTimer, stops the timer
- startTimer, starts the timer

I used the "when ... true" event to run updateTime continually when the timer is not stopped.

I used "when key pressed" events to call stopTimer, startTimer and resetTimer.

I called setTime in an initialisation method inside a "when world starts" event.


All times are GMT -5. The time now is 06:30 AM.

Copyright ©2019, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.