Sprite move
Problem it solves
An enemy gets hit by an explosion and you want them knocked up into the air even if they are already mid-jump.
What this block does
Directly sets vertical velocity and acceleration along the Z-axis for a sprite, even if it is not resting on the floor.
The block
Block ID: rcRender_move
Parameters
| Name | Type | Default | Meaning |
|---|---|---|---|
| sprite | Sprite | mySprite | The sprite to move vertically. |
| v | number | 60 | Vertical speed in pixels per second. |
| a | number | -250 | Vertical acceleration in pixels per second squared. |
Returns
void — Nothing.
Example
let enemy = sprites.create(img`.`, SpriteKind.Enemy) Render.move(enemy, 50, -200)
Add the extension
Add github:The-Code-Zone/Raycasting-pxt-extension to your project, or open: Import Raycasting-pxt-extension.