set player sprite
Problem it solves
You want the game to automatically switch to the next room when your hero walks off the edge of the current screen.
What this block does
Designates which sprite is the player. When this sprite reaches the boundary of the current tilemap, the extension automatically loads the neighboring map.
The block
Block ID: overworld_setPlayerSprite
Parameters
| Name | Type | Default | Meaning |
|---|---|---|---|
| sprite | Sprite | mySprite | The player sprite whose movement triggers map transitions. |
Example
let hero = sprites.create(img`.`, SpriteKind.Player) controller.moveSprite(hero) overworld.setPlayerSprite(hero)
Add the extension
Add github:riknoll/arcade-overworld to your project, or open: Import arcade-overworld.