1- Blockly . Blocks [ 'wabot_new ' ] = {
1+ Blockly . Blocks [ 'wabots_new ' ] = {
22 init : function ( ) {
33 this . appendDummyInput ( )
4- . appendField ( Blockly . Msg . WEBDUINO_WABOT , "瓦寶機器人 " ) ;
4+ . appendField ( Blockly . Msg . WEBDUINO_WABOTS , "哇寶機器人 " ) ;
55 this . setOutput ( true ) ;
66 this . setColour ( 230 ) ;
77 this . setTooltip ( '' ) ;
88 this . setHelpUrl ( 'https://webduino.io' ) ;
99 }
1010} ;
1111
12-
13- Blockly . Blocks [ 'wabot_step' ] = {
12+ Blockly . Blocks [ 'wabots_basic_action' ] = {
1413 init : function ( ) {
15- this . appendValueInput ( "step" )
16- . setCheck ( "Number" )
17- . appendField ( new Blockly . FieldVariable ( "wabot" ) , "wabot" )
18- . appendField ( "動作" )
19- . appendField ( new Blockly . FieldDropdown (
20- [
21- [ "往前走" , "walk" ] ,
22- [ "跑步" , "run" ]
23- ] ) , "step" ) ;
14+ this . appendDummyInput ( )
15+ . appendField ( new Blockly . FieldVariable ( "wabots" ) , "wabots" )
16+ . appendField ( "動作" )
17+ . appendField ( new Blockly . FieldDropdown (
18+ [
19+ [ "向前走" , "walk" ] ,
20+ [ "向後走" , "goBack" ] ,
21+ [ "向左走" , "moonWalkLeft" ] ,
22+ [ "向右走" , "moonWalkRight" ] ,
23+ [ "向左轉" , "turnLeft" ] ,
24+ [ "向右轉" , "turnRight" ] ,
25+ [ "向後轉" , "backyard" ]
26+ ] ) , "action" )
2427 this . setPreviousStatement ( true , null ) ;
2528 this . setNextStatement ( true , null ) ;
2629 this . setColour ( 65 ) ;
@@ -29,19 +32,19 @@ Blockly.Blocks['wabot_step'] = {
2932 }
3033} ;
3134
32-
33-
34- Blockly . Blocks [ 'wabot_backyard' ] = {
35+ Blockly . Blocks [ 'wabots_tempo' ] = {
3536 init : function ( ) {
36- this . appendValueInput ( "step" )
37- . setCheck ( "Number" )
38- . appendField ( new Blockly . FieldVariable ( "wabot" ) , "wabot" )
37+ this . appendDummyInput ( )
38+ . appendField ( new Blockly . FieldVariable ( "wabots" ) , "wabots" )
3939 . appendField ( "動作" )
4040 . appendField ( new Blockly . FieldDropdown (
4141 [
42- [ "向後轉" , "backyard" ] ,
43- [ "慢慢向後轉" , "backyardSlow" ]
44- ] ) , "step" ) ;
42+ [ "裝可愛" , "swing" ] ,
43+ [ "上下跳動" , "upDown" ] ,
44+ [ "快樂向前" , "flapping" ] ,
45+ [ "玻璃舞" , "crusaito" ] ,
46+ [ "跑步" , "run" ]
47+ ] ) , "special" ) ;
4548 this . setPreviousStatement ( true , null ) ;
4649 this . setNextStatement ( true , null ) ;
4750 this . setColour ( 65 ) ;
@@ -50,19 +53,21 @@ Blockly.Blocks['wabot_backyard'] = {
5053 }
5154} ;
5255
53-
54-
55- Blockly . Blocks [ 'wabot_turn' ] = {
56+ Blockly . Blocks [ 'wabots_status' ] = {
5657 init : function ( ) {
57- this . appendValueInput ( "step" )
58- . setCheck ( "Number" )
59- . appendField ( new Blockly . FieldVariable ( "wabot" ) , "wabot" )
60- . appendField ( "動作" )
61- . appendField ( new Blockly . FieldDropdown (
62- [
63- [ "向左轉" , "turnLeft" ] ,
64- [ "向右轉" , "turnRight" ]
65- ] ) , "step" ) ;
58+ this . appendDummyInput ( )
59+ . appendField ( new Blockly . FieldVariable ( "wabots" ) , "wabots" )
60+ . appendField ( "動作" )
61+ . appendField ( new Blockly . FieldDropdown (
62+ [
63+ [ "立正" , "standard" ] ,
64+ [ "踢左腳" , "kickLeft" ] ,
65+ [ "踢右腳" , "kickRight" ] ,
66+ // ["墊腳尖","goingUp"],
67+ [ "跌倒" , "noGravity" ] ,
68+ [ "酒醉" , "drunk" ] ,
69+ [ "跳舞" , "dance" ]
70+ ] ) , "status" ) ;
6671 this . setPreviousStatement ( true , null ) ;
6772 this . setNextStatement ( true , null ) ;
6873 this . setColour ( 65 ) ;
@@ -71,27 +76,22 @@ Blockly.Blocks['wabot_turn'] = {
7176 }
7277} ;
7378
74-
75-
76- Blockly . Blocks [ 'wabot_action' ] = {
79+ Blockly . Blocks [ 'wabots_angle' ] = {
7780 init : function ( ) {
78- this . appendValueInput ( "step" )
79- . setCheck ( "Number" )
80- . appendField ( new Blockly . FieldVariable ( "wabot" ) , "wabot" )
81- . appendField ( "動作" )
82- . appendField ( new Blockly . FieldDropdown (
83- [
84- [ "立正" , "standard" ] ,
85- [ "墊腳尖" , "goingUp" ] ,
86- [ "踢左腳" , "kickLeft" ] ,
87- [ "踢右腳" , "kickRight" ] ,
88- [ "向左月球漫步" , "moonWalkLeft" ] ,
89- [ "向右月球漫步" , "moonWalkRight" ] ,
90- [ "玻璃舞" , "crusaito" ] ,
91- [ "裝可愛" , "swing" ] ,
92- [ "上下跳動" , "upDown" ] ,
93- [ "快樂向前" , "flapping" ]
94- ] ) , "step" ) ;
81+ this . appendValueInput ( "angle" )
82+ . appendField ( new Blockly . FieldVariable ( "wabots" ) , "wabots" )
83+ . appendField ( "設定" )
84+ . appendField ( new Blockly . FieldDropdown (
85+ [
86+ [ "右足" , "0" ] ,
87+ [ "左足" , "1" ] ,
88+ [ "右腿" , "2" ] ,
89+ [ "左腿" , "3" ] ,
90+ [ "左手" , "4" ] ,
91+ [ "右手" , "5" ]
92+ ] ) , "limb" ) ;
93+ this . appendDummyInput ( )
94+ . appendField ( "度" ) ;
9595 this . setPreviousStatement ( true , null ) ;
9696 this . setNextStatement ( true , null ) ;
9797 this . setColour ( 65 ) ;
@@ -100,20 +100,22 @@ Blockly.Blocks['wabot_action'] = {
100100 }
101101} ;
102102
103-
104-
105- Blockly . Blocks [ 'wabot_tempo' ] = {
103+ Blockly . Blocks [ 'wabots_angle_tool' ] = {
106104 init : function ( ) {
107- this . appendValueInput ( "step" )
108- . setCheck ( "Number" )
109- . appendField ( new Blockly . FieldVariable ( "wabot" ) , "wabot" )
110- . appendField ( "動作" )
105+ this . appendDummyInput ( )
106+ . appendField ( new Blockly . FieldVariable ( "wabots" ) , "wabots" )
107+ . appendField ( "設定" )
111108 . appendField ( new Blockly . FieldDropdown (
112- [
113- [ "跳舞" , "dance" ] ,
114- [ "酒醉" , "drunk" ] ,
115- [ "跌倒" , "noGravity" ] ,
116- ] ) , "step" ) ;
109+ [
110+ [ "右足" , "0" ] ,
111+ [ "左足" , "1" ] ,
112+ [ "右腿" , "2" ] ,
113+ [ "左腿" , "3" ] ,
114+ [ "左手" , "4" ] ,
115+ [ "右手" , "5" ]
116+ ] ) , "limb" )
117+ . appendField ( "為" )
118+ . appendField ( new Blockly . FieldAngle ( 90 ) , "pos" ) ;
117119 this . setPreviousStatement ( true , null ) ;
118120 this . setNextStatement ( true , null ) ;
119121 this . setColour ( 65 ) ;
@@ -122,18 +124,16 @@ Blockly.Blocks['wabot_tempo'] = {
122124 }
123125} ;
124126
125-
126-
127- Blockly . Blocks [ 'wabot_walk' ] = {
127+ Blockly . Blocks [ 'wabots_stop' ] = {
128128 init : function ( ) {
129- this . appendValueInput ( "step" )
130- . setCheck ( "Number" )
131- . appendField ( new Blockly . FieldVariable ( "wabot" ) , "wabot" )
132- . appendField ( Blockly . Msg . WEBDUINO_WABOT_WALK ) ;
133- this . setInputsInline ( false ) ;
129+ this . appendDummyInput ( )
130+ . appendField ( new Blockly . FieldVariable ( "wabots" ) , "wabots" )
131+ . appendField ( "停止動作" ) ;
132+ this . setColour ( 65 ) ;
134133 this . setPreviousStatement ( true , null ) ;
135134 this . setNextStatement ( true , null ) ;
136- this . setColour ( 65 ) ;
137- this . setTooltip ( ' ') ;
135+ this . setTooltip ( "" ) ;
136+ this . setHelpUrl ( 'https://webduino.io ') ;
138137 }
139- } ;
138+ } ;
139+
0 commit comments