code-dot-org/blockly — pull request #519 by cpirich (2014-04-23 22:46:05+00:00)
Title: [Finishes 70023656, 70023168, Continues 68414526]

(1) Finished levels 3-6 from puzzle progression spec
(2) support queued moveDistance commands (https://www.pivotaltracker.com/story/show/70023656)
(3) modified whenGameStarts looping to wait for async completion
(4) changed the term "character" to "sprite" - more general & smaller!
(5) remove moveSeparator and replaced with tab character
(6) remove pidList from studio - it was unused

More on #2:
Now, if we see a moveDistance command on the same sprite, the same axis, and the same execution context (meaning that it is running from the same event handler), we will queue it up and execute it later. This allows you to do a "move up" followed by a "move down" and have them run in series (instead of in parallel). The queued command and any in-progress moves will still be canceled if another event handler executes a moveDistance command on the same sprite and the same axis.

More on #3:
Previously, the code under the whenGameIsRunning event handler ran 30 times per second. Now, we track sprites that are still executing moveDistance commands from inside the whenGameIsRunning event handler and speech commands and bubbles that have still not disappeared that were requested inside whenGameIsRunning. We wait for those to complete before firing that event again. This means you can continually loop a "move up" and "move down" in that event handler or a "say YES" followed by a "say NO". or both!

We are building lots of heuristics in the studio app to avoid introducing threading concepts and sync vs. async programming while still giving the student a fair amount of flexibility.