Skip to content
/ rbtris Public

Tetris game powered by Ruby2D

License

Notifications You must be signed in to change notification settings

Nakilon/rbtris

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.