Stop repeat use of input and interrupt one active timer if another is activated
Got movement setup where player block autoruns up, down, left, right with a single press of the according D-pad input. I've done this using switches and selector. I also have a set of timers hooked up to the advanced movers so that when a different direction is chosen, the player block halts for a second before the new auto run direction is taken (to signify a charge up run).
So far so good, however there is an issue. If the player chooses to move UP, after the timer has finished, if they press UP again the player block halts once more before going UP again. I want to stop the player be able to press UP again and halting the player block if they're already moving in that direction. I only want the halt and move mechanic to be activated when a different direction is chosen.
I also have an issue with more than one timer being active at a time. So, if I press UP but then quickly press DOWN, the up timer still continues and carries out its thing despite the down timer now also being activated. I want to stop this. Now, I kinda have this done already by wiring to each timers reset when the current direction has been chosen, but it's such a mess of wires - 4 wires going into reset of each of the 4 timers - that I'm wondering if there is a neater way to do this. Thanks
-
You want to activate some "blocking" logic while the movement plays out. So for that I'd use a timeline. Timelines just power gadgets on and off at the right times, so you can place any gadget on there. Make the timeline last the length of the movement and use it instead of a timer. You could even put the mover on there if you wish.
If you only want one to work at a time, use a selector to power that logic. So, channel A lets timer A work, channel B lets timer B work, etc.
請登入寫評論。