@@ -44,25 +44,27 @@ export default function (Generator) {
44
44
} ;
45
45
46
46
Generator . ev3_getMotorPosition = function ( block ) {
47
+ const order = Generator . ORDER_FUNCTION_CALL ;
47
48
const port = Generator . valueToCode ( block , 'PORT' , Generator . ORDER_NONE ) || null ;
48
- return `ev3_motor_position(${ port } )\n` ;
49
+ return [ `ev3_motor_position(${ port } )` , order ] ;
49
50
} ;
50
51
51
52
Generator . ev3_whenDistanceLessThan = function ( block ) {
52
53
block . isStatement = true ;
53
54
const distance = Generator . valueToCode ( block , 'DISTANCE' , Generator . ORDER_NONE ) || null ;
54
- return `${ Generator . spriteName ( ) } .when(:ev3_distance_< , ${ distance } ) do\n` ;
55
+ return `${ Generator . spriteName ( ) } .when(:ev3_distance_gt , ${ distance } ) do\n` ;
55
56
} ;
56
57
57
58
Generator . ev3_whenBrightnessLessThan = function ( block ) {
58
59
block . isStatement = true ;
59
60
const distance = Generator . valueToCode ( block , 'DISTANCE' , Generator . ORDER_NONE ) || null ;
60
- return `${ Generator . spriteName ( ) } .when(:ev3_brightness_< , ${ distance } ) do\n` ;
61
+ return `${ Generator . spriteName ( ) } .when(:ev3_brightness_gt , ${ distance } ) do\n` ;
61
62
} ;
62
63
63
64
Generator . ev3_buttonPressed = function ( block ) {
64
- const port = Generator . valueToCode ( block , 'PORT' , Generator . ORDER_NONE ) || null ;
65
- return `ev3_button_pressed(${ port } )\n` ;
65
+ const order = Generator . ORDER_FUNCTION_CALL ;
66
+ const port = Generator . valueToCode ( block , 'PORT' , order ) || null ;
67
+ return [ `ev3_button_pressed?(${ port } )` , order ] ;
66
68
} ;
67
69
68
70
Generator . ev3_getDistance = function ( ) {
0 commit comments