Stoping the timer if the game is completed
hi,, i would like to ask how to stop the timer if the game is completed. i have 2 real attributes: My Timer=1 and Start Time=0 below is my code for my actor timer.
Display Text
abs(prec(game.MyTimer,1))
Change Attribute
game.Start Time to game.Time
Rule
if attribute game.My Timer > 0
Constrain Attribute: game.My Timer to 30-( game.Time - game.Start Time )
Rule
if attribute game.My Timer = 0
Change scene to Clean again
and i have the control actor which will check if all is true,, and it will spawn the actor game completed,.
can anyone help me on this?
Display Text
abs(prec(game.MyTimer,1))
Change Attribute
game.Start Time to game.Time
Rule
if attribute game.My Timer > 0
Constrain Attribute: game.My Timer to 30-( game.Time - game.Start Time )
Rule
if attribute game.My Timer = 0
Change scene to Clean again
and i have the control actor which will check if all is true,, and it will spawn the actor game completed,.
can anyone help me on this?
Comments
Or are you asking how to stop game.My Timer from decreasing if a certain condition is true? If it's this, then just add the condition's opposite to the Rule: "if attribute game.My TImer > 0 AND game.completed is false --> Constrain Attribute: game.My Timer to 30-( game.Time - game.Start Time ).