Coding Dev Log (Robson): Adding Cinematic Impact with Screen Shake


As Paper Crown aims to deliver an emotionally resonant experience rooted in psychological horror, cinematic feedback and impactful events are crucial. Robson's focus today was on implementing one such feature: a dynamic Screen Shake effect, tied to the interaction with a key game object, the music box.

Screen Shake System: The Music Box Interaction

The implementation allows players to trigger a visual feedback effect when interacting with a designated object, making that interaction feel weighty and significant.

  • Key Additions: The system required adding the logic for the Music Box interaction, a dedicated interaction key bind, and the randomized screen shaking effect itself.
  • Mechanism in Action:
    1. When the player is positioned near the music box, pressing the assigned interaction key (currently 'E') initiates the effect.
    2. This triggers a coroutine, a piece of code that can run over several frames—to handle the shaking.
    3. The coroutine causes the camera to shake randomly around its center position.
    4. This shake is executed 10 times in quick succession, with a very short delay between each shake, creating a jarring, brief visual tremor.
    5. Finally, once the coroutine completes its cycle, the camera smoothly returns to its original position, ensuring comfortable viewing for the player.

This Screen Shake system not only adds visual punch to interactions but can be easily adapted to provide feedback for other critical events in the game, such as damage taken or powerful environmental changes, helping to enhance the psychological tension that is a core pillar of Paper Crown.

Leave a comment

Log in with itch.io to leave a comment.