chmette / reactive-tetris

Funny little Tetris game

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reactive Tetris

See it live on Netlify

About

A final project for the React module at DCI by chmette and olhanotolga.

We wanted to make something interactive and challenging, that's how we came across games in general, and Tetris is a classic one!

About the Game

Tetris is a puzzle tile-matching Computer Game from 1984 (with origins in the USSR).

How to play

The player needs to position the blocks (tetrominos) which come from the top of the screen. The player can move the blocks left and right and also rotate them clockwise. The objective is to get tetrominos to fill all the empty cells in horizontal lines; whenever this is done, the blocks vanish and the player earns points. More points == higher levels == higher speed == greater difficulty.


Project Description

This project was bootstrapped with Create React App.

The tech stack:

  • React (with hooks)
  • styled components
  • react-icons
  • react-responsive

Screenshots

screenshot

screenshot screenshot


Features

๐ŸŽฎ Stage and tetrominos

๐ŸŽฎ Controls and rotation with arrow keys

๐ŸŽฎ Collision checking

๐ŸŽฎ Row sweeping

๐ŸŽฎ Dropping & speeding up the tetro with intervals

๐ŸŽฎ Score count, levels

Bonus:

๐Ÿ‘พ Mobile Controls

๐Ÿ‘พ Pausing

๐Ÿ‘พ Stage overlays: Pause, GameOver, StartGame

๐Ÿ‘พ Coming next tetromino display


Learnings

  • Game logic (the notions of player and stage, their interaction)
  • Making something this visual
  • Using a CSS in JS library (styled components)
  • Extended use of custom hooks
  • Separating concerns with the help of custom hooks (e.g. keeping player and stage functionality separate)
  • Responsiveness in React apps (adapting UI to device/screen, displaying components conditionally)

Cloning and using locally

  1. Clone the repo locally: git clone git@github.com:chmette/reactive-tetris.git
  2. go to the project folder: cd reactive-tetris
  3. install the dependencies with npm install
  4. run npm start to view the project on your local host

Credits

Thanks to Thomas Weibenfalk whose amazing tutorial โ†—๏ธ served as the base for this project. He has more awesome Projects on his GitHub Page โ†—๏ธ.

About

Funny little Tetris game


Languages

Language:JavaScript 95.5%Language:HTML 2.7%Language:CSS 1.8%