Alice Community

Alice Community (
-   How do I...? (
-   -   help me please!!! how to set a timer on a game (

bluenosepete 11-13-2011 04:15 AM

help me please!!! how to set a timer on a game
i am creating a time trial game for a project and am having problems setting the timing aspect up - at present i have got the screen to print the time elapsed when my car moves but cant get it to stop timing and also would like to help with resetting the timer, any ideas please???:confused:

sfunk 11-13-2011 04:46 AM

well use a boolean variable. have the variable be true while you want the timer to be running, then whenever you want the timer to stop have the variable set to false.

kinda look like this

If run_timer == true
(timer keep increaseing)

(if run_timer == false
timer stop increasing)

It won't look exactly like that since im not sure what kind of timer you are using.

And to reset the timer, just use an if/else statement that sets the value of your timer back to what you want it to be once it meets the criteria

gowillie24 12-05-2011 11:56 PM

How do i get a timer to reset?!?
I am making a game where a car has to find a cube in 10 seconds. Yet if they find the cube or run out of time, they are asked if they want to play again. My only problems is getting the timer to reset to 10 seconds and countdown again!! SOMEONE PLEASE HELP ME! :mad:

davidghemer 12-06-2011 03:51 AM

Check out the timer object I posted to this thread. It should do what you need.


All times are GMT -5. The time now is 10:48 PM.

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