Adding or subtracting seconds of timer?
Hello to GS Community,
I have issues in finding a way how properly to add +1 or subtract -3 seconds out of timer. Once the player makes a successful move a second should be added to the timer whereas wrong move subtracts 3 seconds of the timer. Timer starts from 30 seconds and every second it goes -1 (29..28..etc..). However, once the right or wrong move is made, it seems the timer doesn't go to the explained above. When a successful move is made, sometimes 6 or 8 seconds, are subtracted. What I do is...
If a successful move is made (bunch of IF Attributes)
Change game.timer to game.timer+1
If a wrong move is made (bunch of IF attributes)
Change game.timer to game.timer-3
However, I suspect where the issue comes from - I have another actor who has the following rules:
if game.timer > 30
timer every second Run to completion checked
change game.timer to game.timer-1
I think when the actor who subtract a second every second interferes with the rules for adding/subtracting of the other actor results in weirdness.
Any idea how to make it work?
Comments
You're really going to have to post your project file or a complete screenshot of rules for those two actors. They aren't interfering with each other so much as there's a rule with conditions that are causing the timer attribute to change at times when you don't want it to.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Since game.timer is a global attribute it will be modified by all the actors that add/substract value to it.
http://www.arcaderz.com
@tatiang
I am going to PM you the project file in a few minutes with detailed explanations.