# Writing a Sokoban Puzzle Game in JavaScript

DevFeed: [Writing a Sokoban Puzzle Game in JavaScript](<https://devfeed.tech/articles/writing-a-sokoban-puzzle-game-in-javascript-37609.md>)

Original publisher: [Read original article](<https://www.taniarascia.com/sokoban-game/>)

Author: hello@taniarascia.com

Published: 2021-07-26T00:00:00Z

Content type: tutorial

Language: en

Sources: [Tania Rascia](<https://devfeed.tech/sources/tania-rascia.md>)

Topics: [JavaScript](<https://devfeed.tech/topics/javascript.md>), [Code](<https://devfeed.tech/topics/code.md>), [Canvas](<https://devfeed.tech/topics/canvas.md>), [HTML5](<https://devfeed.tech/topics/html5.md>), [Demo](<https://devfeed.tech/topics/demo.md>), [Web Development](<https://devfeed.tech/topics/web-development.md>)

Tags: [canvas](<https://devfeed.tech/tags/canvas.md>), [code](<https://devfeed.tech/tags/code.md>), [demo](<https://devfeed.tech/tags/demo.md>), [game](<https://devfeed.tech/tags/game.md>), [games](<https://devfeed.tech/tags/games.md>), [graphics](<https://devfeed.tech/tags/graphics.md>), [html5](<https://devfeed.tech/tags/html5.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [puzzle](<https://devfeed.tech/tags/puzzle.md>)

## AI overview

A tutorial describing the implementation of a Sokoban puzzle game in JavaScript. It explains the map representation, entity movement and pushing rules, recursive handling of multiple blocks, and rendering the game on an HTML5 canvas.

## Source excerpt

So the other day, I made an implementation of a Sokoban puzzle game in JavaScript. Here's the source code and here's the demo. The game...