Created
April 10, 2017 16:23
-
-
Save AJFaraday/1840c2810bb79e4f7e96808e3e3b7a9a to your computer and use it in GitHub Desktop.
Example usage pattern
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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