Alice Community  

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

Reply
 
Thread Tools Display Modes
help me please!!! how to set a timer on a game
Old
bluenosepete
Junior Member
 
Status: Offline
Posts: 1
Join Date: Nov 2011
Smile help me please!!! how to set a timer on a game - 11-13-2011, 04:15 AM

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???
   
Reply With Quote
Old
sfunk
Senior Member
 
sfunk's Avatar
 
Status: Offline
Posts: 1,112
Join Date: Mar 2011
Location: I don't know
Default 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)

Else
(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


If you are stuck on a project, check out the tutorials I made here at this link:

http://alice.org/community/showthread.php?p=36778#post36778

There are lots of tutorials on it so far, including some youtube videos, check it out

Or..

Go to my youtube channel to check out my alice 2.2 tutorials I have there..

http://www.youtube.com/user/sfunk1992?feature=mhsn
   
Reply With Quote
How do i get a timer to reset?!?
Old
gowillie24
Junior Member
 
Status: Offline
Posts: 1
Join Date: Dec 2011
Angry How do i get a timer to reset?!? - 12-05-2011, 11:56 PM

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!
   
Reply With Quote
Old
davidghemer
Member
 
Status: Offline
Posts: 38
Join Date: Nov 2011
Default 12-06-2011, 03:51 AM

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

http://www.alice.org/community/showt...3972#post43972


For video tutorials on programming in Alice 2.2 check out my YouTube channel

http://www.youtube.com/user/drdave785

Also check out my Programming in Alice blog at

http://programminginalice.com
   
Reply With Quote
Reply

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 ©2019, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.