Class: God
- Inherits:
-
Object
- Object
- God
- Defined in:
- lib/god.rb
Instance Method Summary collapse
- #accept_command ⇒ Object
-
#check ⇒ Object
The glorious check method ###.
-
#input ⇒ Object
The basic method of the game ###.
-
#wait ⇒ Object
Defines variables ###.
Instance Method Details
#accept_command ⇒ Object
51 52 53 54 |
# File 'lib/god.rb', line 51 def accept_command input check end |
#check ⇒ Object
The glorious check method ###
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/god.rb', line 20 def check case $input when 'inv' list when 'get' get add when 'n', 'north' $player.go(:n) when 's', 'south' $player.go(:s) when 'e', 'east' $player.go(:e) when 'w', 'west' $player.go(:w) when 'search' $player.location.search when 'buy' buy when 'l', 'look' $player.location.look when 'help' help when 'info' info when 'stats' $player.stats else puts 'That is not a valid command.' end end |
#input ⇒ Object
The basic method of the game ###
11 12 13 14 |
# File 'lib/god.rb', line 11 def input print '>> ' $input = gets.chomp.downcase end |
#wait ⇒ Object
Defines variables ###
5 6 7 |
# File 'lib/god.rb', line 5 def wait sleep 2 end |