Skip to content

CieriA/rusty-tetris

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Tetris with SDL2

A Tetris clone written in Rust using the SDL2 graphics library.

Features

  • Classic Tetris game mechanics
  • Smooth 2D rendering via SDL2
  • Keyboard controls
  • Score system

Requirements

  • Rust (stable) — install via rustup
  • SDL2 — graphics and input
  • SDL2_ttf — for rendering text (e.g., score display)

SDL2 and SDL2_ttf installation

Linux

sudo apt install libsdl2-dev libsdl2-ttf-dev

macOS (using Homebrew)

brew install sdl2 sdl2_ttf

Windows

Use vcpkg or manually install SDL2 and SDL2_ttf developer packages. Make sure the .ddl files are in your PATH or project folder at runtime.

Building the Project

Clone the repository and build in release mode:

git clone https://github.com/CieriA/rusty-tetris
cd rusty-tetris
cargo build --release

Running the game

cargo run --release

Controls

  • Left Arrow / A — Move the piece left
  • Right Arrow / D — Move the piece right
  • Down Arrow / S — Soft Drop
  • Space — Hard Drop
  • Up Arrow / W / Right Control — Rotate the piece clockwise
  • Q / Left Control — Rotate the piece counterclockwise

Development Notes

This project uses the following crates:

  • sdl2
  • rand

TO regenerate documentation locally:

cargo doc --open

License

This project is licensed under the ISC License. For more info see the LICENSE file.

About

A clone of Tetris made with Rust and SDL2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages