Classic puzzle game written in the Jack programming language (nand2tetris).
This is my project for chapter 9 of the nand2tetris course.
Ported over from my golang project - Sokoban Go.
MVC from the ground up - this is not the usual Jack approach, but it works pretty well! The only caveat is that the Hack platform isn't really suited to full screen refreshes on each tick (results in a flickering display), so there's some muddying of the waters caused by introducing a 'screenDirty' flag to the model (this allows the view to only clear the screen when really necessary, else it simply draws over the existing state).
git clone https://github.com/TheInvader360/sokoban-jackThen compile using the nand2tetris JackCompiler and run in the nand2tetris VMEmulator, for example:
./nand2tetris/tools/JackCompiler.sh ./sokoban-jack
./nand2tetris/tools/VMEmulator.shSprites.jack is auto-generated by passing the /Resources/Sprites path as an argument to my Jack Sprites Generator.
I run the following bash script in the project root directory to generate Sprites.jack, copy it to the right location, compile, then start the emulator:
cd ..
go run jack-sprites-generator/main.go sokoban-jack/Resources/Sprites/
cd sokoban-jack
mv Resources/Sprites/Sprites.jack .
cd ..
./nand2tetris/tools/JackCompiler.sh sokoban-jack
./nand2tetris/tools/VMEmulator.sh