RubyFlow The Ruby and Rails community linklog

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) { @player.run(:left) }
  down?(right &&  shift) { @player.run(:right) }
  down?(!left && !right) { @player.stand }
end</pre>

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