Live data from Hacker News

RubyWarrior - Bloc

bloc.io

11–20 of 70 posts

Re: RubyWarrior - Bloc

#12
Cool idea, but I don't think it makes sense for there to be both a Player class and a warrior object. They seem like they are/should be one in the same. At the very least, I think behind the scenes, the Player class should look more like this such that the warrior object is always available, and I don't need to pass it around from method to method that I define. e.g.:

    class Player
      attr_reader :warrior

      def initialize(warrior)
        @warrior = warrior
      end

      def play_turn
        # I can now access `warrior` here or in any other methods I write
      end
    end

Re: RubyWarrior - Bloc

#13

Cool idea, but I don't think it makes sense for there to be both a Player class and a warrior object. They seem like they are/should be one in the same. At the very least, I think behind the scenes, the Player class should look more like this such that the warrior object is always available, and I don't need to pass it around from method to method that I define. e.g.: class Player attr_reader :warrior def initialize(…

The player object would represent the current person playing the game, i.e. you. The warrior represents the object on the screen. The player tells the warrior to take actions, so it makes sense that they're different objects.

If there were multiple warriors then your code would no longer make sense, as the control logic would have to be changing the player_instance.warrior object.

Re: RubyWarrior - Bloc

#14

Very cool! Proud to see that it's made with ImpactJS[1] (my game engine :)) [1] http://impactjs.com/

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.

Re: RubyWarrior - Bloc

#19
This is really great, but it would be even better if it showed where the error it's finding is located. I am getting some weird errors that I can't spot-find.

Re: RubyWarrior - Bloc

#20
It 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.

Post reply on HN