nikamshubham / bubble-shooter-game

Individual Project: Bubble Shooter (React Hooks & Context, TypeScript)

Home Page:https://bubble-shooter-game.herokuapp.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

demo

Table of contents:

Technologies used

  • React
  • React Hooks & Context
  • TypeScript

Goal

The goal for this project was to get more practice with algorithms, React Hooks & Context and TypeScript.

Description

This is an interpretation of the famous Bubble Shooter game. I haven't done this the popular way by using the HTML5 <canvas> element. It has all been done with a simple two-dimensional array and CSS animation to animate the shot bubble. When you shoot a bubble a trajectory of the array elements the shot bubble passes through is being calculated. For every element it checks if there's a collision with another bubble. Once it hits a bubble, it checks the color. If the colors match I run a recursive function to check if the adjacent bubbles are of the same color too. If there are more than 3 adjacent bubbles of the same color they get removed and you increment your score. And the more aligning bubbles of the same color for each shot, the higher the score. Each game lasts 2 minutes.

Install instructions

$ npm install
$ npm run start

API

The repository for the API can be found here.

Future work

  • Enable bubbles to bounce off the walls

About

Individual Project: Bubble Shooter (React Hooks & Context, TypeScript)

https://bubble-shooter-game.herokuapp.com/


Languages

Language:TypeScript 85.7%Language:CSS 8.5%Language:HTML 5.8%