Skip to content

catt-tung/web-browser-snake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Garden of Eden's Snake

Snake-screenshot

The game is deployed on Surge and can be played here

About Snake & Why I Built It

The original conception of Snake came about in 1976 as a two-player arcade game called Blockade. It was popularized as a preloaded game on Nokia mobile phones in 1998 by Taneli Armanto, which opened up an entirely new paradigm of use case for mobile phones. Call it the OG App, today we use our phones for much more than just calls, in large part thanks to this humble yet insanely addicting game.

Choosing to recreate Snake was more than just the idea of a game I used to play on my mom's mobile phone as a kid. It was also the first app I had ever pushed onto an IoT device via the software from my previous company, balena. I remember discovering the power of IoT from pushing a Snake App onto a Sense-HAT/Raspberry Pi 4 setup. It literally blew my mind out of the waters, and became the initial conception for a project I later worked on with former coworker, Inkyshot.

Apart from that, my goal for this project was to learn more about manipulating data structures and moving things with a timer. While I can't say it's much innovation in terms of design and functionality, my coding skills had to go through a lot of innovating to figure out how to build a Snake game using only HTML, CSS, and vanilla Javascript from scratch!

This is the first coding project I built; I hope it's the start of many more projects that can do much more in the future.

Technologies Used

The following technologies were used to build this app:

HTML5 CSS3 JavaScript Visual Studio Code

Pseudocode

I used Trello to plan the workings of this entire game - which can be found here

How to play

The goal of the game is to have the snake (you!) collect as many apples without running into yourself. Snake is played using the control keys on the keyboard - the snake will move on its own while the timer is running, use the keyboard arrows to change its direction. Every time a fruit is eaten, the Snake will grow longer. As the game progresses, the speed of the snake will very subtly get faster.

Stretch Goals

Ideally if there is more time I'd like to hack about with this code, I'd like to build:

  • A mobile version with on-screen touch buttons to play on mobile
  • Maze functions where you have to avoid certain walls in the grid
  • Snake droppings you have to avoid

Credits