A port of raylib-tetris -> wgpu, also using rodio for audio. Api inspiration for thomas engine
from ggez.
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
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
Learned basic wgpu api from learn-wgpu, projections from, learnopengl, batch rendering and engine design from The Cherno
Install nightly rust compiler
rustup install nightly
Clone repo & build run
git clone https://github.com/SpicyRicecaker/tetris-wgpu-rs/tree/master
cd tetris-wgpu-rs
cargo run --release