diff --git a/src/blocks/scratch3_operators.js b/src/blocks/scratch3_operators.js index a2a5ab4bd2b..4a86e4738b9 100644 --- a/src/blocks/scratch3_operators.js +++ b/src/blocks/scratch3_operators.js @@ -33,10 +33,15 @@ class Scratch3OperatorsBlocks { operator_contains: this.contains, operator_mod: this.mod, operator_round: this.round, - operator_mathop: this.mathop + operator_mathop: this.mathop, + checkbox: this.checkbox }; } + checkbox () { + return true; + } + add (args) { return Cast.toNumber(args.NUM1) + Cast.toNumber(args.NUM2); } diff --git a/src/compiler/irgen.js b/src/compiler/irgen.js index 4c3137939a9..c2724f4685d 100644 --- a/src/compiler/irgen.js +++ b/src/compiler/irgen.js @@ -177,6 +177,11 @@ class ScriptTreeGenerator { kind: 'constant', value: block.fields.TEXT.value }; + case 'checkbox': + return { + kind: 'constant', + value: true + }; case 'argument_reporter_string_number': { const name = block.fields.VALUE.value;