Patterns to use in DragonRuby

Input Actions

Instead of using args.inputs directly you parse it into an input actions objects, which is then used instead to control your game.

Input Actions

When is it useful?

Some scenarios when this pattern can be useful:

  • Having several different kinds of inputs with the same effect
  • Configurable controls
  • Letting an AI player control your game (character)
  • Multiplayer

In general I think it results in cleaner, better organized code but YMMV of course.


Children
  1. Input Actions