You've all seen snake, but let's bring it into the fourth D I M E N S I O N!

Usage no npm install needed!

<script type="module">
  import dsnake from 'https://cdn.skypack.dev/4dsnake';


4DSnake Promo

"4D" Snake 🐍

To Play 4D Snake:

Github Favicon CLICK HERE
Heroku Favicon OR HERE
Status Issues License

You've all seen snake, but let's bring it into the true third (not really fourth) D I M E N S I O N!

📝 Table of Contents

🧐 About

After seeing Snake game after Snake game, I noticed that the trend was whenever it was adapted to 3D it always lacked Y-axis movement! Since I felt that was a total waste of a dimension that set me off to implement a version of it that wasn't constrained to two axes in JavaScript. After finding three.js I knew I would be able to complete my idea! Without futher ado:

🕹ī¸ How to Play

4D Snake!

Control Scheme

PC Mobile
Left A Swipe Left
Right D Swipe Right
Up W Swipe Up
Down S Swipe Down
Rotate Camera Left Click Drag Triple Touch
Zoom Camera Mouse Wheel Drag Double Touch


You can test and run this just by dragging public/index.html into the browser.

Feel free to install using NPM as well npm install 4dsnake.

🚀 Deployment

This project is deployed on Github Pages. By keeping the top level index.html file, it will automatically populate to github pages. The only thing you need to do is edit the route to your own public/index.html route hosted on github pages.

You can also host this project on any cloud deployment you like, I chose Heroku for its quick setup. It hosts the project using NodeJS a simple http-server that uses the $PORT environment variable (or defaults to 4000).

⛏ī¸ Built Using

✍ī¸ Authors

🎉 Acknowledgements

  • @Ironhack for supporting me during the project!
  • @bobbypwang - For keeping me sane throughout the project and helping me brainstorm the idea.
  • @crispinonicky - For helping me out with some radian math!