Microsoft MakeCode

Clicking A start animation from begining

Hi there,
here is my testing project

I do not know how to stop the process of clicking on the A button when the animation starts. Clicking A button starts animation from the first frame, so the effect is that clicking repeatedly A results in seeing only the first frame.
I would like to wait till the animation finishes before starting a new one (new sword slash).
Any thoughts?

Your code is 90% there already! Just add a pause block to make it wait for the animation to finish:

I put in 2000ms for the pause because you have a 4 frame animation with 500ms for each frame.

Hi Richard,

Yes indeed but check that situation, click like 10 times A button, this will result in 20 seconds animation (10 slashes). Like, arcade is putting call A actions on stack / list and runs it till the end.
I am looking for option to stop “putting” those A calls on stack, e.g.: I was clicking A button 5 times in 3 seconds, so only two slashes occured.

The best solution is to use the timer extention, use the wait block and put the code you want to execute in there. That will prevent stacking

1 Like

Works as expected, thanks @S0m3_random_guy

1 Like

No problem, glad to help