From b6cb198144085befe6afa20a6432d205daa3e6d1 Mon Sep 17 00:00:00 2001 From: Florrie Date: Mon, 30 Apr 2018 12:18:38 -0300 Subject: [PATCH] Implement all-at-once block --- src/blocks/scratch3_control.js | 7 ++++++- src/serialization/sb2_specmap.js | 9 +++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/blocks/scratch3_control.js b/src/blocks/scratch3_control.js index 4636d282d..a958068a7 100644 --- a/src/blocks/scratch3_control.js +++ b/src/blocks/scratch3_control.js @@ -35,7 +35,8 @@ class Scratch3ControlBlocks { control_delete_this_clone: this.deleteClone, control_get_counter: this.getCounter, control_incr_counter: this.incrCounter, - control_clear_counter: this.clearCounter + control_clear_counter: this.clearCounter, + control_all_at_once: this.allAtOnce }; } @@ -182,6 +183,10 @@ class Scratch3ControlBlocks { incrCounter () { this._counter++; } + + allAtOnce (args, util) { + util.startBranch(1, false); + } } module.exports = Scratch3ControlBlocks; diff --git a/src/serialization/sb2_specmap.js b/src/serialization/sb2_specmap.js index ff5ddd812..88bfc2ab5 100644 --- a/src/serialization/sb2_specmap.js +++ b/src/serialization/sb2_specmap.js @@ -874,6 +874,15 @@ const specMap = { argMap: [ ] }, + 'warpSpeed': { + opcode: 'control_all_at_once', + argMap: [ + { + type: 'input', + inputName: 'SUBSTACK' + } + ] + }, 'touching:': { opcode: 'sensing_touchingobject', argMap: [