A negative space puzzle game inspired by Snake and Shift.
Shapeshift in makeshift ways. Shift snakes into lakes. Snake wakes into shapes.
Skin and fang. Yin and yang. Snakes shelter sneks like sheds, then shed kin like skin.
Play Snakeshift in your browser.
You can also play it in your terminal (requires Go):
git clone https://github.com/1j01/snakeshift.git
cd snakeshift/game/go
go run .The terminal version only supports keyboard controls, and has bug where the rendering may be jumbled until you resize the terminal window.
| Action | Controls |
|---|---|
| Move | Hold left stick in a direction and press βΆ, or use D-pad |
| Switch Snakes | Shoulder buttons |
| Undo | β§ |
| Redo | β· |
| Restart (Undoable) | β |
You may need to press a button on the gamepad before the web page can see it.
NOTE: The level editor does not currently support gamepad controls.
| Action | Controls |
|---|---|
| Move | Arrow keys, WASD, vi keys (HJKL), or Numpad |
| Switch Snakes | Tab |
| Undo | Z |
| Redo | Y |
| Restart (Undoable) | R |
| Toggle Editor | ` |
The level editor supports these standard shortcuts:
| Action | Controls |
|---|---|
| Save | Ctrl+S |
| Open | Ctrl+O |
| Copy | Ctrl+C |
| Cut | Ctrl+X |
| Paste | Ctrl+V |
| Select All | Ctrl+A |
| Delete | Delete |
This project uses Vite and TypeScript.
/game/β the source code./game/go/β terminal based reimplementation of the game in Go/game/dist/β the built files, which could be deployed to a static web server./public/β Files in this folder will be copied to thedistdirectory when building. These are referenced with absolute paths in CSS, but relative paths in HTML and JS, without the/publicprefix in either case./tests/β Playwright tests./tsconfig.jsonβ Typescript settings./eslintrc.cjsβ ESLint settings./vite.config.jsβ Vite settings./package.jsonβ dependencies and scripts./package-lock.jsonβ generated file, used for reproducible builds.
/cspell.jsonβ spell check settings and dictionary.
Install dependencies and run the dev server:
npm install
npm run devThere is also an experimental level generator and terminal version written in Go, which can be run with:
cd game/go
go run . --generate >../../game/public/levels/tests/generated-level.json
go run .This command runs the spell checker, the typescript compiler, and eslint:
npm run lintThis command will run tests using Playwright:
npm run testLearn more about Playwright's philosophy and tooling.
It has great VS Code integration, a test recorder/generator, a trace viewer including screen capture replay, and more.
When the file format changes, increment FORMAT_VERSION and add an upgrade step for backwards compatibility in game-state.ts.
To update all levels to the new format, run:
npm run update-level-formatTo build for production and push to GitHub Pages:
npm run deploySee TODO.md.
This project is licensed under the MIT License. See the LICENSE.txt file for details.