Skip to content

Instantly share code, notes, and snippets.

@freqn
Forked from AJFaraday/turn.rb
Created April 10, 2017 19:12
Show Gist options
  • Save freqn/017d752b59ef01f6908c3cf765d29be4 to your computer and use it in GitHub Desktop.
Save freqn/017d752b59ef01f6908c3cf765d29be4 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