MakeCode Games!

A fan-made community library of MakeCode Arcade games. Visit MakeCode Arcade to make a game!

← Back to extensions

Retro FX

Add juicy 8-bit sound synthesizers, screen shakes, particle explosions, camera effects, and retro text displays to your games.

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

flash sprite $sprite times $times||interval $interval block

Parameters

NameTypeDefaultMeaning
spriteSpritePlayerThe sprite to flash.
timesnumber4Number of full blink cycles.
intervalnumber80Duration 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.