Skip to content

Commit fb1b184

Browse files
committed
[ADD] converter of microbit_tilted function
1 parent 953127f commit fb1b184

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/lib/ruby-to-blocks-converter/microbit.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ const MicroBitConverter = {
3636
this._setParent(rubyBlock, block);
3737
}
3838
break;
39+
case 'microbit_tilted':
40+
if (args.length === 2 && this._isString(args[1])) {
41+
block = this._createBlock('microbit_whenTilted', 'hat');
42+
this._addFieldInput(
43+
block, 'DIRECTION', 'microbit_menu_tiltDirectionAny', 'tiltDirectionAny',
44+
args[1], 'any'
45+
)
46+
this._setParent(rubyBlock, block);
47+
}
48+
break;
3949
}
4050
} else if (this._isSelf(receiver) || receiver === Opal.nil) {
4151
switch (name) {

0 commit comments

Comments
 (0)