Skip to content

A Tetris example written in Rust using Piston in under 500 lines of code

License

Notifications You must be signed in to change notification settings

da-x/tetris-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tetris Example in Rust, v2

A Tetris example written in Rust using Piston.

  • For demoing basic Rust coding
  • 414 lines of code
  • A clear Git history that iterates on added features. See: git log --reverse -p 855e7fddd..HEAD
  • The completed lines are flashing
  • No scoring
  • No 'next piece view'
  • No automatic restart after 'game over'
  • No change in falling piece speed
  1. Install Rust from main site.
  2. Perform the following:
git clone https://github.com/da-x/tetris-demo
cd tetris-demo
cargo run

Changes from v1

  • Simplified the handling of the game state.
  • Using a HashMap instead of a Vec<Vec<_>> for board and pieces.
  • Less lines, same functionality.
  • A clear Git history that iterates on added features.

About

A Tetris example written in Rust using Piston in under 500 lines of code

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages