Screen shake and flash

By the end, every hit in your game will shake the screen and make the hero blink, and it only takes two actions.

What you need

Both actions are Simple.

Shake the screenIn the โš™ Special column. Asks for Strength (pixels) and For (seconds).
Flash (blink)In any object's cell, under Visibility. Asks For (seconds).
A gameAnything with a hero and something that hurts. Here: Hero and Spikes from the library.
SoundHit.
NutHouse
Star Defender mid-shake after the ship is hit

Build it

  1. Events tab โ†’ + New event โ†’ Hero โ†’ Collides with another object โ†’ Spikes.
  2. In โ˜บ Player 1 choose Subtract lives, 1.
  3. In the โš™ Special cell choose Shake the screen. Strength (pixels) 8, For (seconds) 0.5.
  4. In the Hero cell choose Flash (blink), For (seconds) 1.
  5. In โ™ช Sound choose Play a sound โ†’ Hit.
  6. Press โ–ถ Play level and walk into the spikes.
WhenHero collides with Spikes
DoSubtract 1 from livesShake the screen (8 pixels for 0.5 seconds)Hero flashes for 1 secondsPlay sound Hit

Both actions finish by themselves. The screen settles after For (seconds), and the hero stops blinking on its own. You never need a second rule to turn them off.

Good numbers

A small bumpShake 3 pixels for 0.2 seconds.
Getting hurtShake 8 pixels for 0.5 seconds, flash for 1 to 1.5 seconds.
An explosionShake 12 pixels for 0.6 seconds.
Too muchAnything over 20 pixels or a whole second. Players feel sick.

Make it yours

  • Flash the thing that got hit, not the hero: Flash (blink) on the Boss in a boss fight.
  • A big finish: Shake the screen 12 for 0.6 when the last brick goes, with There are none of these left.
  • Landing thump: Hero lands on ground โ†’ shake 2 pixels for 0.1 seconds.
  • A warning blink: Compare number of lives = equal to 1 + Only the first time โ†’ Flash (blink) the Lives object for 2 seconds.

Still stuck?

Try the Chocobreak tutorial, open a sample game and read its rules, or look at the questions people ask.