-
Notifications
You must be signed in to change notification settings - Fork 1
/
movement_block.js
63 lines (57 loc) · 1.62 KB
/
movement_block.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/* Generate blocks with https://blockly-demo.appspot.com/static/demos/blockfactory/index.html */
Blockly.Blocks['move_right'] = {
init: function() {
this.appendDummyInput()
.appendField("move right");
this.appendValueInput("shouldJump")
.setCheck("Boolean")
.setAlign(Blockly.ALIGN_RIGHT)
.appendField("jump?");
this.setInputsInline(false);
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
this.setColour(330);
this.setTooltip("");
this.setHelpUrl("");
}
};
Blockly.Blocks['move_left'] = {
init: function() {
this.appendDummyInput()
.appendField("move left");
this.appendValueInput("shouldJump")
.setCheck("Boolean")
.setAlign(Blockly.ALIGN_RIGHT)
.appendField("jump?");
this.setInputsInline(false);
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
this.setColour(330);
this.setTooltip("");
this.setHelpUrl("");
}
};
Blockly.Blocks['jump'] = {
init: function() {
this.appendDummyInput()
.appendField("jump");
this.setOutput(true, "Boolean");
this.setColour(330);
this.setTooltip("");
this.setHelpUrl("");
}
};
Blockly.Blocks['display_text'] = {
init: function() {
this.appendDummyInput()
.appendField("display text ");
this.appendValueInput("NAME")
.setCheck(null);
this.setInputsInline(true);
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
this.setColour(230);
this.setTooltip("");
this.setHelpUrl("");
}
};