class Walker
Public Class Methods
new( dungeon )
click to toggle source
# File lib/misc/walker.rb, line 3 def initialize( dungeon ) @dungeon = dungeon end
Public Instance Methods
directions()
click to toggle source
# File lib/misc/walker.rb, line 7 def directions Hash[ @dungeon.hallways.directions( @dungeon.current_room ).map{ |e| [ e.to_s[0], e ] } ] end
main_loop()
click to toggle source
# File lib/misc/walker.rb, line 11 def main_loop loop do _directions = directions p _directions direction = gets.chomp direction = _directions[direction] p direction p @dungeon.set_next_room( direction ) @dungeon.draw_current_room( 'out/room.jpg' ) end end