logo

Snake Game

Fully responsive game written in React.

2022

Long time ago...

Do you remember playing Snake Game on Nokia 3210? I do! And that’s why decided to recreate the game as one of my portfolio projects. It is built in React with Tailwind CSS used for styling. Highscores are stored in Google’s Cloud Firestore.

start screen

It is fully responsive and works both on mobile and desktop. Users can control the snake with the keyboard or buttons on touch screens.

PS: Don't forget to save your score 😄

game screen

Scoring & scores saving

Scoring is based on the level. The higher the level, the faster the snake moves and each star gives more points.

Bonuses (apples 🍎) appear in random positions on every 5th element eaten by the snake. The faster an apple is eaten, the more points it gives.

The result of the game can be saved. The user just needs to type their name. The score is saved in Firebase Firestore.

scores

Settings

Players can change the sizes of the playing board and turn the wall teleport on/off. Those settings are available in the "Instructions & Settings" subpage. Everything is being saved in react's context so there is no need to confirm. Changes are visible in the game.

settings

Even better if...

As with every coding project, there is always something that can be done differently or better. In this one, there is no backend. Firebase is handled fully by the front end. That makes the game vulnerable to score manipulation. A solution to make it cheating-proof would be to implement some sort of backend that receives the course of the game and calculates the score on BE side, and then save it.

Design

I designed all the views using Figma. You can check my design files here

Technologies

ReactTailwind CSSFirestoreFirebase Hosting

My projects

Take a look at my portfolio projects.

Pixel-perfect website and CMS for Travel Agency. A seamless client facing experience and easy to use CMS. Working on the entire development as a solo one-man army freelancer.

NextJS 14TypeScriptDirectus CMSDocker

Comprehensive platform for car auction searches with over one million entries, developed for a client, featuring advanced filtering, multi-language support, and a dynamic blog.

NextJS 14TypeScriptTailwindCSSPostgreSQL

A copy of PacMan game. Keyboard or screen navigation and "inteligent" ghosts following the PacMan thanks tu A* pathfinding algorithm.

Next.jsReactTailwindCSSTypeScript
Project PacMan logo

PacMan

Jan 2023

It’s an online shop designed for businesses that sell multiple products, typically purchased in quantities greater than one.

ReactNext.jsTailwindCSSPrismaImgixNext AuthStripe

This project is visualising how sorting algorithms work. It helps to understand each step. Users can pause the visualisation and go forward or backward step by step.

ReactChakraUIFramer MotionGitHub Pages

Do you remember playing Snake Game on Nokia 3210? I do! And that’s why decided to recreate the game as one of my portfolio projects.

ReactTailwind CSSFirestoreFirebase Hosting

I built this site to present myself and some of my projects in an interesting way.

NextJSReactFramer MotionContentfulGraphQL