Module: Rubinstein::Actions::Movement

Defined in:
lib/rubinstein/actions/movement.rb

Instance Method Summary collapse

Instance Method Details

#walk(*args) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/rubinstein/actions/movement.rb', line 5

def walk(*args)
  args.flatten!
  if !args[0]
    __puts "Which way?" 
  elsif @__world.player.location.exits[args[0]]
    @__world.player.location = @__world.locations[@__world.player.location.exits[args[0]]]
    look
  else
    __puts "You can't go that way"
  end
  __handle!
end