diff --git a/package.json b/package.json index 918ae0c..10ed451 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vcs-game-maker", - "version": "0.10.0", + "version": "0.10.1", "private": true, "scripts": { "serve": "vue-cli-service serve", diff --git a/src/generators/bbasic/variables.js b/src/generators/bbasic/variables.js index 5e300e4..bd102e7 100644 --- a/src/generators/bbasic/variables.js +++ b/src/generators/bbasic/variables.js @@ -33,4 +33,13 @@ export default (Blockly) => { block.getFieldValue('VAR'), Blockly.VARIABLE_CATEGORY_NAME); return varName + ' = ' + argument0 + '\n'; }; + + Blockly.BBasic['math_change'] = function(block) { + // Variable increment. + const argument0 = Blockly.BBasic.valueToCode(block, 'DELTA', + Blockly.BBasic.ORDER_ASSIGNMENT) || '0'; + const varName = Blockly.BBasic.nameDB_.getName( + block.getFieldValue('VAR'), Blockly.VARIABLE_CATEGORY_NAME); + return varName + ' = ' + varName + ' + ' + argument0 + '\n'; + }; };