ryanb / ruby-warrior

Game written in Ruby for learning Ruby.
MIT License
3.83k stars 838 forks source link

warrior.look returns wall for stairs? #49

Open meesterdude opened 12 years ago

meesterdude commented 12 years ago

Maybe I don't understand the grander dynamics yet of the game, but, shouldn't our warrior be able to see stairs? He can warrior.feel stairs, and the stairs are a distinct icon on the map like everything else, but he can't see them? I'm a little puzzled by that.

ryanb commented 12 years ago

Does warrior.feel.stairs? not work for you? That should return true/false depending on if there are stairs on that space.

meesterdude commented 12 years ago

warrior.feel.stairs? does work. My question was why does the warrior see a wall where there are stairs? From what I recall I had cleared out the room of bad dudes and wanted the warrior to just walk forward if he saw stairs in front of him.

ronald commented 10 years ago

Problem exists when using Strings.


@ >

p w.look.map(&:to_s) => ["nothing", "nothing", "wall"] p w.look.map(&:stairs?) => [false, true, false]

Perhaps https://github.com/ryanb/ruby-warrior/blob/master/lib/ruby_warrior/space.rb#L61 needs a special case for stairs.

ghost commented 9 years ago

Stairs should really be another case, and not a sub of wall. This code should be refactored

bf4 commented 9 years ago

You volunteering?