RubyFlow The Ruby and Rails community linklog


The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

Gosu-Keyboard - An easy DSL for handling keyboard events in Gosu

gosu-keyboard - A DSL for easily handling keyboard events within a Gosu::Window.

Small example:

Gosu::Keyboard.handle_keys(@gosu_window) do
  down?(escape)          { close }
  down?(left  && !shift) { @player.walk(:left) }
  down?(right && !shift) { @player.walk(:right) }
  down?(left  &&  shift) { }
  down?(right &&  shift) { }
  down?(!left && !right) { @player.stand }

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in