Skip to content

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

Notifications You must be signed in to change notification settings

jamalroger/bubble-shooter-game

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 85.7%
  • CSS 8.5%
  • HTML 5.8%