Skip to content

Instantly share code, notes, and snippets.

@AJFaraday
Created April 10, 2017 16:23
Show Gist options
  • Save AJFaraday/1840c2810bb79e4f7e96808e3e3b7a9a to your computer and use it in GitHub Desktop.
Save AJFaraday/1840c2810bb79e4f7e96808e3e3b7a9a to your computer and use it in GitHub Desktop.
Example usage pattern
# Previous example in github.com/ajfaraday/re-rpg in script/simple_battle.rb
character.actions
# [:attack, :fire, :block, :heal, :"full heal"]
character.action(:attack, target)
# purely hypothetical, mostly unimplemented
def turn(character)
action = character.actions.offensive.pick
target = character.enemies.pick
character.action(action, target)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment