DEV Community


Posted on

JavaScript responsive snake game

My first JS game -

I have always been grinding to do the best side project.Most usefull one for interviews as well. But it takes toll after sometime. Hence, i worked and created something simple and fun.

This is a snake game. I tried to make it as much fun as possible. Please play and let me know. Some of its highlights are,

  1. Its completely responsive. Work in mobile and web.
  2. For mobile mode. i have developed a joystick which can be used for snake navigation. Its custom built and not copied or referenced from anywhere.
  3. It has sound effect. Just for fun.
  4. Its has humorous descriptions and funny messages.


  • Responsive design - It was very challenging. I had to adjust canvas based on the size. On top of that i had to adjust the snake size as well. This completely alters calculations.
  • Joystick - Tried various other ways but joystick was difficult to design as it had to work in all mobile devices.
  • Random food - Generating a random number between the canvas sizes was also a challenge. But was not very difficult.

Top comments (2)

Sloan, the sloth mascot
Comment deleted
vishesh profile image

Ha ha... Sorry I wanted it to be funny 😝