Need Help: Making a Lap Timer
![CLV25](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
Hi, i am making a racing game and I would like to have a lap timer in the top left corner that says what the current lap time is, what your best lap time was and what the previous lap time was. If only part of this can be done in game salad please tell me how to do so, thank you.
Comments
Create a integer game attribute called laptime
Create a Boolean game attribute called Goal
---------------------------------------------
Make new actor called laptime
put in a display text behavior
chose game.laptime
Put in a timer rule saying
every 1
Change attribute game.laptime TO game.laptime+1
Put actor in a visible area
---------------------------------------
Make a new actor called bestlap
put in a display text behavior
chose game.bestlap
Create rule: ALL
IF attribute game.goal is true
IF attribute game.bestlap is < game.laptime
Change attribute
Game.bestlap TO Game.laptime
Put actor in a visible area
----------------------------------------------------------------
Create a new actor called Goal line. make it transparent.
Place that actor on your goal line
Create rule:ALL
IF goal line collides or overlaps with "car"
and Attribute game.goal is false
Change attribute game.bestlap TO game.laptime
Change attribute game.goal TO true
--------------------------------------------------------
On your Car:
Create rule:
IF car collides or overlaps with goal line
Change attribute game.laptime TO 0
However my car does not move anymore and i have tried changing the controls and using another car.
chose game.laptime'
the reason why car is not moving could be that you put the rule
"If car collides overlaps with goal" in the same rule as your navigation rules.
You need separate them by creating a new rule to it in.
2.
open your laptime actor
Drag in behavior - Display text
in the display behavior, press the expression icon "e"
select. Game, then laptime
You do the exact same with the bestlap actor