A system for loading in levels our designer created in JSON format as well as managing resources. Level sprite assets are loaded and displayed as they become visible with the ascent. When level is changed the physics calculation is disabled for the previous level and physics bodies are created and enabled for the new level.
A simple state machine for the child character to wander the available space taking into account the obstructions the player moves around, run to hide and glance back frantically when scared by witnessing ghost activity, and run to the level exit when the path is cleared.
Setting up all of the physics objects that were generated, refactoring when switching from Phaser physics engine to Matter.js, and fiddling with variables for the best movement feeling with different scales.
The interpolation and direction changes used for the kid and the ghost’s movement to give the kid a solid, tangible feeling in the level and the ghost a light floaty feeling.