Code Monkey home page Code Monkey logo

rbtris's Introduction

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.

rbtris's People

Contributors

kojix2 avatar nakilon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rbtris's Issues

Problem with zip

uninitialized constant Zip::File (NameError)

Zip::File.open(tempfile){ |zip| zip.extract "PressStart2P-Regular.ttf", "PressStart2P-Regular.ttf" }
^^^^^^

^^^ I get the above error.

Could the main .rb file perhaps be rewritten? That is an unusual error. I did install zip
but even after a gem install it still did not work.

gem install?

Would it be possible to install rbtris via "gem install rbtris" too? I am an avid user of rubygems (gem) but I avoid bundler when possible.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.