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.

camera punch

Problem it solves

A heavy boss lands on the ground and you want a sudden, sharp camera jolt before it snaps back to normal.

What this block does

Offsets the camera violently in a random direction for a brief moment and then centers it back.

The block

Block ID: retro_camera_punch

camera punch for $sprite intensity $intensity duration $duration ms block

Parameters

NameTypeDefaultMeaning
spriteSpriteObjectThe sprite triggering the camera punch.
intensitynumber4Maximum pixel distance to offset the camera.
durationnumber60Duration of the camera offset in milliseconds.

Example

let hero = sprites.create(img`.`, SpriteKind.Player)
Retro.cameraPunch(hero, 8, 80)

Add the extension

Add github:CrzLe0723/RetroFx to your project, or open: Import RetroFx.