I am really disappointed that Ryan Bates is not being STRONGLY credited anywhere on this page... this is just a graphical wrapper on his original creation. https://github.com/ryanb/ruby-warrior
It's in the footer...
RubyWarrior - Bloc
61–70 of 70 posts
Re: RubyWarrior - Bloc
#62Re: RubyWarrior - Bloc
#63Earlier quoted context omitted.
I don't feel `.is_a?(Class)` is ever idiomatic ruby. You should always be coding to an interface, not an implementation. This prevents things like mocks and duck typing, making testing more difficult and adding complexity when you want to add AnotherEnemy that doesn't share the same inheritance tree. I try to avoid using `.is_a?(Class)` in all of my ruby code when possible. `.respond_to?` is much more responsible way…
> I try to avoid using `.is_a?(Class)` in all of my ruby code when possible. `.respond_to?` is much more responsible way of probing whether an object has the interface you are looking for. #is_a?(class) is a much more specific check of semantics than #respond_to?(method_name). is_a? is the more cautious approach (least likely to produce false positives at the expense of being most likely to produce false negatives) w…
But that really isn't the only way to do things. Read up on http://en.wikipedia.org/wiki/Duck_typing
Re: RubyWarrior - Bloc
#64Re: RubyWarrior - Bloc
#65Re: RubyWarrior - Bloc
#66Earlier quoted context omitted.
> I try to avoid using `.is_a?(Class)` in all of my ruby code when possible. `.respond_to?` is much more responsible way of probing whether an object has the interface you are looking for. #is_a?(class) is a much more specific check of semantics than #respond_to?(method_name). is_a? is the more cautious approach (least likely to produce false positives at the expense of being most likely to produce false negatives) w…
Are you coming from java? That's my background (at least one of them), and felt that way too. Interface === API contract == safe. But that really isn't the only way to do things. Read up on http://en.wikipedia.org/wiki/Duck_typing
Re: RubyWarrior - Bloc
#67Earlier quoted context omitted.
> I try to avoid using `.is_a?(Class)` in all of my ruby code when possible. `.respond_to?` is much more responsible way of probing whether an object has the interface you are looking for. #is_a?(class) is a much more specific check of semantics than #respond_to?(method_name). is_a? is the more cautious approach (least likely to produce false positives at the expense of being most likely to produce false negatives) w…
Are you coming from java? That's my background (at least one of them), and felt that way too. Interface === API contract == safe. But that really isn't the only way to do things. Read up on http://en.wikipedia.org/wiki/Duck_typing
Well, java was one of the languages I used before Ruby, but I've done more Ruby than Java.
> Read up on http://en.wikipedia.org/wiki/Duck_typing
I am well aware of duck typing, and rarely use either #is_a? or #respond_to?
That doesn't change that, if you have a reason to use that type of inquiry to check interfaces, #is_a? is the more safe of the two (more likely to reject an object that provides the semantics of concern and less likely to accept one that does not) and #respond_to? is the less safe (more likely to accept an object that does not provide the semantics of concern and less likely to reject one that does.)
Re: RubyWarrior - Bloc
#68Earlier quoted context omitted.
Hey! You made ImpactJS? That's very cool, but it's really hard to commit $99 to buy an engine when I can't even try it! It looks super-rad and I'd love to give it a shot, but it's a bit high of a bar for a casual game dev.
If you buy it and don't like it for whatever reason, I can give you a full refund within the first month. That's easier for me to handle than a separate trial license.
(At least from an end-user standpont. Obviously, you should do your own testing for conversion rate/etc.)
Re: RubyWarrior - Bloc
#69"undefined method `elements' for [:return0]:Array" Marvelous
Re: RubyWarrior - Bloc
#70It would be cool if the game commited your code to a github repo every level. This way you could see your own progress, and see what solutions other came up with without bugging them.