flash sprite
Problem it solves
Your player takes damage and needs temporary invincibility flashing to signal that they were hit.
What this block does
Toggles a sprite's visibility on and off repeatedly to create an invincibility or damage blink effect.
The block
Block ID: retro_flash_sprite
Parameters
| Name | Type | Default | Meaning |
|---|---|---|---|
| sprite | Sprite | Player | The sprite to flash. |
| times | number | 4 | Number of full blink cycles. |
| interval | number | 80 | Duration of each flash state in milliseconds. |
Example
let hero = sprites.create(img`.`, SpriteKind.Player) Retro.flashSprite(hero, 5, 60)
Add the extension
Add github:CrzLe0723/RetroFx to your project, or open: Import RetroFx.