Merge pull request #1099 from towerofnix/scrollcompat-vm

"Implement" scroll blocks
This commit is contained in:
kchadha 2018-05-01 15:52:42 -04:00 committed by GitHub
commit 54ee628b27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 46 additions and 1 deletions

View file

@ -34,7 +34,13 @@ class Scratch3MotionBlocks {
motion_sety: this.setY, motion_sety: this.setY,
motion_xposition: this.getX, motion_xposition: this.getX,
motion_yposition: this.getY, motion_yposition: this.getY,
motion_direction: this.getDirection motion_direction: this.getDirection,
// Legacy no-op blocks:
motion_scroll_right: () => {},
motion_scroll_up: () => {},
motion_align_scene: () => {},
motion_xscroll: () => {},
motion_yscroll: () => {}
}; };
} }

View file

@ -206,6 +206,45 @@ const specMap = {
argMap: [ argMap: [
] ]
}, },
'scrollRight': {
opcode: 'motion_scroll_right',
argMap: [
{
type: 'input',
inputOp: 'math_number',
inputName: 'DISTANCE'
}
]
},
'scrollUp': {
opcode: 'motion_scroll_up',
argMap: [
{
type: 'input',
inputOp: 'math_number',
inputName: 'DISTANCE'
}
]
},
'scrollAlign': {
opcode: 'motion_align_scene',
argMap: [
{
type: 'field',
fieldName: 'ALIGNMENT'
}
]
},
'xScroll': {
opcode: 'motion_xscroll',
argMap: [
]
},
'yScroll': {
opcode: 'motion_yscroll',
argMap: [
]
},
'say:duration:elapsed:from:': { 'say:duration:elapsed:from:': {
opcode: 'looks_sayforsecs', opcode: 'looks_sayforsecs',
argMap: [ argMap: [