-
-
Save freqn/017d752b59ef01f6908c3cf765d29be4 to your computer and use it in GitHub Desktop.
Example usage pattern
This file contains hidden or 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