Escape the Pit

Saved games stay in this browser only.

About the game

You are the green square, and you have fallen into a pit. The way out is the orange square on the far side of the board. The only trouble is that each pit has snakes in it, and the snakes are hungry.

The game is turn-based: every time you move one square, each snake moves one square too, and it always takes the shortest path toward you. That makes it behave like a puzzle, not like an action game. Nothing happens in real time, so you can stop and think about where each snake will be after your next step, and the step after that. The red snake and the blue one are not allowed to pass through each other, so they can get in each other's way, and a long snake has a tail that blocks squares as well.

There are nine pits to climb out of, counted down from depth 9. The first one is empty and lets you learn the controls. The later ones put the snakes closer, make them longer, and name themselves with a few jokes along the way. Get caught and you are thrown back one level, down into a deeper pit. Reach the exit of depth 1 to win. Mark Vasilkov made it for js13kGames 2014, where it had to fit in 13 KB, and the whole board is drawn with CSS, tilted into 3D as soon as the enemies arrive.

Playing it here

Click Play, then press an arrow key to start. If the keys do nothing, click on the game once so it has the keyboard. A snake touching you at any point of its body counts as a catch, not only its head. When you win, press 9 to start over from the bottom. Nothing is saved between visits.

Controls

Input Action
Arrow keys, WASD or HJKL move one square (left, down, up, right with HJKL)
9 restart after winning
Music and Sound effects boxes turn the background music and the sounds on or off

A few things worth knowing

Snakes follow the shortest path, not you. They do not guess where you will go; they go to where you are. That means you can lead one into a corner and let its own tail block it.

There is no waiting. There is no pass button, so every move is a choice. Think about the square you are leaving as well as the one you enter.

Learn from the throw-back. Being thrown back one level is not a restart: the level you land in is a different board, and the first one is the empty pit.

Credits and licence

Escape the Pit was created by Mark Vasilkov for js13kGames 2014 and is released under the MIT licence. This site serves the game with one change, to the background music: the original generated it from a formula taken from a tweet without a licence, so the formula was replaced by a simple one of our own. The game uses the jsfxr sound synthesiser (Apache licence 2.0) and the javascript-astar library (MIT), and their notices are in the licence file linked from this page. The source is on GitHub.