enable screen wrap
Problem it solves
You are building an Asteroids or Pac-Man game and want a sprite that flies off the left screen edge to reappear on the right edge.
What this block does
Continuously checks a sprite's coordinates and teleports it across opposite screen boundaries when it moves offscreen.
The block
Block ID: retro_screen_wrap
Parameters
| Name | Type | Default | Meaning |
|---|---|---|---|
| sprite | Sprite | Object | The sprite that will wrap around the screen. |
Example
let ship = sprites.create(img`.`, SpriteKind.Player) Retro.screenWrap(ship)
Add the extension
Add github:CrzLe0723/RetroFx to your project, or open: Import RetroFx.