Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

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.

About

Tetris game powered by Ruby2D

Topics

Resources

License

Stars

Watchers

Forks

Languages