< BACK

Stealth Sandbox

By: Autumn Wright

Stealth Sandbox is a short stealth game experience that gives you the chance to alter the game in real time! Tweak the difficulty as you please, or just mess around with the common stealth game formula by altering:

This project utilizes Canvas to render out a customizable JavaScript stealth game. Each game element is drawn using Canvas paths, with methods such as arc(), lineTo(), and moveTo(). The rest of the website is formatted using a CSS stylesheet and the Bulma CSS Framework. A number of sliders below the game allow the user to alter the game's values in real-time. A number of preset difficulties are also stored in a JSON file that can be applied through a dropdown above the sliders.

Player collision and enemy sight-cones are determined through raycasting, which is calculated mathematically every frame. If an enemy catches sight of the player, their cone will grow and follow the player until they've lost sight of them for a long enough time. The enemy patrol patterns are also very flexible, allowing for them to pause between waypoints, facing either towards the next waypoint or in the direction they were originally facing.

Try Here
Stealth Sandbox gameplay showcasing the labyrinth-like level filled with patrolling enemies. Stealth Sandbox game over screen - the player has been caught by two enemies. Stealth Sandbox gameplay showcasing how the game parameters may be altered - enemies have a circular sight radius.