Skip to content
Tetris game powered by Ruby2D
Ruby
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
Gemfile
Gemfile.lock
LICENSE.txt
README.md note about 250-loc branch in README Nov 19, 2019
main.rb

README.md

Tetris game in less than 200 lines of code

Controls

ARROWS
R to restart
P or Space to pause

Installation

bundle install
bundle exec ruby main.rb

For Linux you might need to read the Ruby2d installation notes.

TODO

  • projetion of the piece on the bottom
  • SRS canonical rotation
  • SRS wall kicks
  • scoreboard stored at $HOME/.rbtris
  • ability to fall down only partially
  • ability to hold UP (just for fun)
  • Mutex stdlib class
  • autoresize to screen?
  • option to restart
  • cheats for testing purposes
  • canonical increase of speed
  • holding LEFT and RIGHT
  • canonical scoring
  • see next piece
  • pause key
  • window size configuration?
  • canonical music
  • restore controller support?
  • color scheme configuration
  • boss key
  • compile and publish?

Notes

By default ruby2d looks for a font only in one system directory -- this is why ruby2d dependency here was forked and patched a bit to support sourcing from the working directory (and $HOME/Library/Fonts).

It can't be compiled to binary right now because of using a Mutex class that is not in MRuby.

It's hard to continue fitting it into 200 lines but I want to add more features -- maybe I'll make a "300-LOC" branch there is now 250-loc branch that has the "next piece" displayed.

Cool font is Press Start 2P from Google Fonts.

You can’t perform that action at this time.