Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Help Help Help!!! How do I...
Old
bulletproof40
Guest
 
Status:
Posts: n/a
Exclamation Help Help Help!!! How do I... - 11-26-2009, 06:15 AM

My final project has a timer requirement. I have the timer code written using the elapsed time function. How do I get the elapsed time to reset to zero each time I start the game. Right now it starts where the previous game ended.
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 11-26-2009, 10:03 AM

You could make a number variable called time and a second number variable called dummyTime, then have time set its value to elapsed time every second, to sync them. Then, at the end of the game, have time set value to 0 and dummyTime set its value to elapsed time the second the game ends, but just that once. Then, have time set its value to elapsed time - dummyTime.


(')>
   
Reply With Quote
Reply

Tags
elapsed time, timer

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



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