Changing a Timer's Time as It's Going
I'm currently building a combo system where every time the player kills a new enemy it resets the time.
I'm currently trying to do this by having the timer start when the player kills an enemy it sets off a boolean to start the timer so the rule goes:
If boolean is true:
Timer starts with time based on an attribute called ComboTime. After ComboTime expires all the variables reset and this part works great.
The problem comes when I want the timer to start over at the original time when a new enemy is hit. I did this by having the ComboTime attribute change to 5 every a new enemy is killed when the combo is started. It doesn't seem to be resetting the timer.
I'm not entirely sure this method is working am I doing something wrong or is there a better way?
I'm currently trying to do this by having the timer start when the player kills an enemy it sets off a boolean to start the timer so the rule goes:
If boolean is true:
Timer starts with time based on an attribute called ComboTime. After ComboTime expires all the variables reset and this part works great.
The problem comes when I want the timer to start over at the original time when a new enemy is hit. I did this by having the ComboTime attribute change to 5 every a new enemy is killed when the combo is started. It doesn't seem to be resetting the timer.
I'm not entirely sure this method is working am I doing something wrong or is there a better way?
Comments
@neondevil
Hi, yes, you need a way to reset the Timer before it starts off again, in a loop mechanism.
One way to do this: makeyour boolean set to false when an enemy is hit, then immediately after set it back to true again. Make sure you haven't got Run to Completion checked on your Timer.
This is off the top of my head, but it should work out; if not, I'll checkout something similar I've used in a previous game file for you.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
try keeping the control/tracking/running of the those actions/events on that actor
… have each enemy track its individual hits for combos
demo: http://www.mediafire.com/?fetfceivn65fuws
Now I just need to switch it so the combo count and timer are global because all my enemies die in one hit then I should be golden.
Here is the code:
http://i.imgur.com/SK9h6.jpg