Working as intended. Allow me to explain first, then provide an option for obtaining your expected result.
A step in the JS-Interpreter is very fine-grained as it walks the abstract syntax tree. There should be about 22 steps in your three-line program. These steps are:
- Program (looking up the first line)
- Expression Statement (starting the line 'rightMovement()')
- Call Expression (starting the function call 'rightMovement()')
- Identifier (figuring out what 'rightMovement' refers to)
- Call Expression (running the function call 'rightMovement()')
- Call Expression (recording the return value of 'rightMovement()')
- Expression Statement (finishing the line 'rightMovement()')
- Program (looking up the next line)
- ...
And so on for all three lines. It's worth noting that JS-Interpreter is a JavaScript interpreter, not a Blockly interpreter. So it takes a very pedantic approach to execution. There are a lot of steps which need to be taken to account for scopes, return values, arguments, etc -- even if your specific program doesn't have any of these.
I'll assume that you really want a user-visible 'step' button that executes one statement block. Here's a demo:
This demo uses STATEMENT_PREFIX to inject a 'highlightBlock()' function call into the generated code before every line. This function (which is defined as a native function in the interpreter's setup) does two things. First it (as the name suggests) highlights the block which is about to execute. Second, it sets a variable which is used to pause the JS-Interpreter. Thus the JS-Interpreter runs as many steps as it takes until the variable is set, signaling that the next block has been reached.
In your case you may wish to use STATEMENT_SUFFIX instead of STATEMENT_PREFIX since I suspect you want the movement block to execute, then pause, rather than the reverse.
Your generated code would then look something like this:
rightMovement();
highlightBlock('rs?33k~.t,ER:/)k04n$');
downMovement();
highlightBlock('n!Y|ZMCO4H!fV,EtFd%L');
downMovement();
highlightBlock('j,]w1G6}LI!bILEqTV;_');
Any questions, let us know!