Skip to content

Made w/ rust & raylib-rs. Used structs rather than arrays for board

Notifications You must be signed in to change notification settings

SpicyRicecaker/raylib-tetris

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Made w/ rust & raylib-rs. Used structs rather than arrays for board

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages