File tree Expand file tree Collapse file tree 2 files changed +61
-0
lines changed Expand file tree Collapse file tree 2 files changed +61
-0
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,17 @@ Blockly.Blocks.defaultToolbox = '<xml id="toolbox-categories" style="display: no
99
99
'</shadow>' +
100
100
'</value>' +
101
101
'</block>' +
102
+ '<block type="motion_glideto" id="motion_glideto">' +
103
+ '<value name="SECS">' +
104
+ '<shadow type="math_number">' +
105
+ '<field name="NUM">1</field>' +
106
+ '</shadow>' +
107
+ '</value>' +
108
+ '<value name="TO">' +
109
+ '<shadow type="motion_glideto_menu">' +
110
+ '</shadow>' +
111
+ '</value>' +
112
+ '</block>' +
102
113
'<block type="motion_changexby" id="motion_changexby">' +
103
114
'<value name="DX">' +
104
115
'<shadow type="math_number">' +
Original file line number Diff line number Diff line change @@ -265,6 +265,56 @@ Blockly.Blocks['motion_glidesecstoxy'] = {
265
265
}
266
266
} ;
267
267
268
+ Blockly . Blocks [ 'motion_glideto_menu' ] = {
269
+ /**
270
+ * Glide to drop-down menu
271
+ * @this Blockly.Block
272
+ */
273
+ init : function ( ) {
274
+ this . jsonInit ( {
275
+ "message0" : "%1" ,
276
+ "args0" : [
277
+ {
278
+ "type" : "field_dropdown" ,
279
+ "name" : "TO" ,
280
+ "options" : [
281
+ [ 'mouse-pointer' , '_mouse_' ] ,
282
+ [ 'random position' , '_random_' ]
283
+ ]
284
+ }
285
+ ] ,
286
+ "colour" : Blockly . Colours . motion . secondary ,
287
+ "colourSecondary" : Blockly . Colours . motion . secondary ,
288
+ "colourTertiary" : Blockly . Colours . motion . tertiary ,
289
+ "extensions" : [ "output_string" ]
290
+ } ) ;
291
+ }
292
+ } ;
293
+
294
+ Blockly . Blocks [ 'motion_glideto' ] = {
295
+ /**
296
+ * Block to glide to a menu item
297
+ * @this Blockly.Block
298
+ */
299
+ init : function ( ) {
300
+ this . jsonInit ( {
301
+ "message0" : "glide %1 secs to %2" ,
302
+ "args0" : [
303
+ {
304
+ "type" : "input_value" ,
305
+ "name" : "SECS"
306
+ } ,
307
+ {
308
+ "type" : "input_value" ,
309
+ "name" : "TO"
310
+ }
311
+ ] ,
312
+ "category" : Blockly . Categories . motion ,
313
+ "extensions" : [ "colours_motion" , "shape_statement" ]
314
+ } ) ;
315
+ }
316
+ } ;
317
+
268
318
Blockly . Blocks [ 'motion_changexby' ] = {
269
319
/**
270
320
* Block to change X.
You can’t perform that action at this time.
0 commit comments