Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   Timer start and stop? (http://www.alice.org/community/showthread.php?t=6372)

billy 04-21-2011 01:51 PM

Timer start and stop?
 
hello everyone.

I have a simple racing game, you have to fly through hoops in order.

i want to get the timer i made to start at one hoop and stop at the last.

how can i make it stop once it starts.

If you want screen dumps of the programme i can do so.

any help apreciated.

Cheers

Billy

TauTrumpsPi 04-21-2011 05:52 PM

Make a variable, lets call in #ofHoops

Then

While (#ofHoops)< (The number of hoops you have in your program)
Timer variable increment by 1
Wait one second
Timer set text to Timer Variable as string

and have another method that makes it so when someone goes through a hoop, the #ofHoops variable will increase by 1 (But make the hoop disapear/move away so the user cannot go through it twice.

billy 04-22-2011 05:05 AM

i used

while both hoops>=1 and hoops<=9
begin
during - play timer
end

in events

but the game crashes when you go through the final hoop making hoops=10

the timer works fine, just cant get it to stop when the final hoop is passed.

cheers.


All times are GMT -5. The time now is 09:31 AM.

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