diff options
-rw-r--r-- | src/js/sb3-gen.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/js/sb3-gen.js b/src/js/sb3-gen.js index 615d73a..6a42f0a 100644 --- a/src/js/sb3-gen.js +++ b/src/js/sb3-gen.js @@ -216,17 +216,17 @@ function blockToScratchblocks(block, target) { case 'control_wait': return `wait ${i('DURATION')} seconds`; case 'control_repeat': - return `repeat ${i('TIMES')}` + i('SUBSTACK', true) + 'end'; + return `repeat ${i('TIMES')}` + (i('SUBSTACK', true) || '\n') + 'end'; case 'control_forever': - return 'forever' + i('SUBSTACK', true) + 'end'; + return 'forever' + (i('SUBSTACK', true) || '\n') + 'end'; case 'control_if': - return `if ${i('CONDITION') || '<>'} then` + i('SUBSTACK', true) + 'end'; + return `if ${i('CONDITION') || '<>'} then` + (i('SUBSTACK', true) || '\n') + 'end'; case 'control_if_else': - return `if ${i('CONDITION') || '<>'} then` + i('SUBSTACK', true) + 'else' + i('SUBSTACK2', true) + 'end'; + return `if ${i('CONDITION') || '<>'} then` + (i('SUBSTACK', true) || '\n') + 'else' + (i('SUBSTACK2', true) || '\n') + 'end'; case 'control_wait_until': return `wait until ${i('CONDITION') || '<>'}`; case 'control_repeat_until': - return `repeat until ${i('CONDITION') || '<>'}` + i('SUBSTACK', true) + 'end'; + return `repeat until ${i('CONDITION') || '<>'}` + (i('SUBSTACK', true) || '\n') + 'end'; case 'control_stop': return `stop ${i('STOP_OPTION')}`; case 'control_start_as_clone': |