Alice Community

Alice Community (
-   Share Objects (
-   -   Countdown timer object (

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.