Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warrior.look returns wall for stairs? #49

Open
meesterdude opened this issue Jan 21, 2012 · 5 comments
Open

warrior.look returns wall for stairs? #49

meesterdude opened this issue Jan 21, 2012 · 5 comments

Comments

@meesterdude
Copy link

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
Copy link
Owner

ryanb commented Apr 28, 2012

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

@meesterdude
Copy link
Author

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
Copy link

ronald commented Sep 24, 2013

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
Copy link

ghost commented Jul 26, 2015

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

@ghost ghost mentioned this issue Jul 26, 2015
@bf4
Copy link

bf4 commented Jul 26, 2015

You volunteering?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants