Skip to content

Commit 6594421

Browse files
authored
Merge pull request #202 from yusuke0227/makeymakey
MakeyMakeyのwhenCodePressedを追加
2 parents 52673a1 + fbc2c05 commit 6594421

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/lib/ruby-generator/makeymakey.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,16 @@ export default function (Generator) {
1515
return `${Generator.spriteName()}.when(:makey_key_pressed, ${key}) do\n`;
1616
};
1717

18+
Generator.makeymakey_menu_SEQUENCE = function (block) {
19+
const sequence = Generator.quote_(Generator.getFieldValue(block, 'SEQUENCE') || 'LEFT UP RIGHT');
20+
return [sequence, Generator.ORDER_ATOMIC];
21+
};
22+
23+
Generator.makeymakey_whenCodePressed = function (block) {
24+
block.isStatement = true;
25+
const sequence = Generator.valueToCode(block, 'SEQUENCE', Generator.ORDER_NONE) || null;
26+
return `${Generator.spriteName()}.when(:makey_pressed_in_oder, ${sequence}) do\n`;
27+
};
28+
1829
return Generator;
1930
}

0 commit comments

Comments
 (0)