Movement Control
I implemented character movement and animation control using a state machine. For each character state, I utilized Scriptable Objects to manage and adjust its parameters. The Unity Input System was used to capture inputs from keyboard, gamepad, and touchscreen.
For mobile platforms, I developed two solutions for input handling: button controls and virtual joystick.
The joystick will appear at the point where the player first touches the screen. The player can then move the joystick in any direction. The system calculates the movement direction and speed based on the joystick’s position, allowing the player to move left or right with appropriate responsiveness.




Light Mechanic System
The light masking mechanism is the core of this game. In brief, the requirement is that a circular light surrounding the player causes special tiles it covers to disappear, with the light radius gradually shrinking over time.
I achieved this by combining masks and 2D lighting. The light is divided into three stages: large, medium, and small, each using different mask sizes and lighting with varying brightness and colors. At the same time, I implemented a system to dynamically check which special tiles are within the corresponding light radius and update their states accordingly.






Ghost AI
The player will get hurt and respawn at the last checkpoint when touching it.The states of the ghost are illustrated in the diagram below.

