Why does ActorParams class is in charge of creating Actors?

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Why does ActorParams class is in charge of creating Actors?

      Hi

      I've been studying your book for a few weeks by now, and still I don't understand why the ActorParams class creates the "Graphic Actor" and "Logic Actor", it makes more sense to me that the Game Logic, or Game, class should be responsible of creating and removing logical actors, and the "Graphics system" of the graphical actors.

      Is there a "design" reason behind it? Or something that I'm totally missing? Can someone explain?

      Thanks
    • RE: Why does ActorParams class is in charge of creating Actors?

      This is done in one place because it keeps all the parameters of an "Actor" in a single place. Games tend to have hundreds if not thousands of these things, and managing two separate parallel definitions might be more correct from a design patterns point of view, but not really a logistical one.

      But, as in many things, choosing this over your idea isn't necessarily better, it is just a choice.

      Perhaps it would have been better to call ActorParams something like ActorDefinition instead...
      Mr.Mike
      Author, Programmer, Brewer, Patriot