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.
Drag anywhere to move the snake in the direction of the drag.
Click on a snake to switch to it.
Use the left stick to point in the direction you want to move, and then press A to move to the highlighted cell. Or use the D-pad to move.
Shoulder buttons switch snakes.
Press ⓧ to undo, Ⓑ to redo.
Press Ⓨ to restart the level.
You may need to press a button to activate the gamepad, before the web page can see it.
NOTE: The level editor does not currently support gamepad controls.
You can use the arrow keys, WASD, HJKL, or the number pad to move.
Tab switches between snakes.
Press Z to undo, Y to redo.
Press R to restart the level. This is undoable.
Press ` to toggle the level editor.
Press Ctrl+S to save the level, and Ctrl+O to open a level.
This project uses Vite and TypeScript.
/game/
— the source code./game/dist/
— the built files, which could be deployed to a static web server./public/
— Files in this folder will be copied to thedist
directory when building. These are referenced with absolute paths in CSS, but relative paths in HTML and JS, without the/public
prefix 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 dev
This command runs the spell checker, the typescript compiler, and eslint:
npm run lint
This command will run tests using Playwright:
npm run test
Learn 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:
node update-level-format.js
To build for production and push to GitHub Pages:
npm run deploy
See TODO.md.
This project is licensed under the MIT License. See the LICENSE.txt file for details.