$ ./guess_the_languageGame Dev
Game Dev · medium · #258

Why square the trauma value here?

float shake = trauma * trauma;
offset = maxOffset * shake * noise(t);
  1. To make the shake last twice as long
  2. Small hits shake far less than big ones
  3. To keep the camera offset always positive
  4. To sync the shake with the music
With trauma in 0..1, squaring (or cubing) makes the response non-linear: light hits barely move the camera while big ones shake hard, and the shake eases out as trauma decays.
Play Game Dev ▸