A monster enemy roams the playable area using pathfinding to navigate around obstacles. Its behavior is controlled by a simple state machine. The monster uses raycasting to check if the player is in its line of sight, and when it detects the player, it stops pathfinding and switches to a chase state. If the monster collides with the player, the game resets.
This setup works well for horror scenarios where the player is being hunted and cannot fight back. The game supports both keyboard/mouse controls and mobile touch controls.
This game is made with GDevelop using these features:
Edit it in GDevelop
Test and edit this example in the GDevelop game engine.