Open sunq0001 opened 7 years ago
i don't really understand why you used the fsm like that...
i think what happens is:
It is just a demo that shows my questions. my suggestion is that there should be some function that can force state transition although it is still in progress. and i think this is quite common situtation. the state is interrupted by some action and have to transit immediately.
BTW: Below is game which used state-machine, and i have to use setTimout(fn, 0) to dismiss the error message. https://github.com/sunq0001/Tetris
i used it by another way, because for me it is easier to understand when function is in state rather than in transition. but the problem comes if i don't use setTimeout, it will show error. "transition is invalid while previous transition is still in progress" but if i add setTimeout(function(){}, 0); error is gone. could you help solve it?