Add block-by-block feedback to the VM playground

This commit is contained in:
Tim Mickel 2016-06-07 20:59:34 -04:00
parent f2734950d7
commit 5767e05d56
3 changed files with 20 additions and 2 deletions
src/engine

View file

@ -199,7 +199,13 @@ Runtime.prototype.startDistanceSensors = function () {
Runtime.prototype.stopAll = function () {
var threadsCopy = this.threads.slice();
while (threadsCopy.length > 0) {
this._removeThread(threadsCopy.pop());
var poppedThread = threadsCopy.pop();
// Unglow any blocks on this thread's stack.
for (var i = 0; i < poppedThread.stack.length; i++) {
this.glowBlock(poppedThread.stack[i], false);
}
// Actually remove the thread.
this._removeThread(poppedThread);
}
// @todo call stop function in all extensions/packages/WeDo stub
if (window.native) {