Skip to content

Latest commit

 

History

History
13 lines (11 loc) · 1.18 KB

README.md

File metadata and controls

13 lines (11 loc) · 1.18 KB

Tetris-rs

Written in rust, with the raylib-rs bindings for the raylib library.

Picture of Tetris Game Over Screen

Implementation

Board: Used a vector of tetrominos that hold their own coords rather than a global array (for some reason), with width and height just for rendering
Tetrominos: Struct of vector of coords, with the center being the first coord in the vector
Collisions: Comparing current focused tetromino with every other tetromino on the board
Rotations: Used an offset table with indices to center O and I tetromino rotations as well as take care of wallkicks

Helpful Resources

How to Properly Rotate Tetris Pieces - Game Development Tutorial A video explaining how to implement tetromino rotations by Turbo Makes Games

  • SRS website mentioned in the above video with offset data and explanations for how to use it