Attribute Philosophy

conrad74conrad74 Member Posts: 50
edited November -1 in Working with GS (Mac)
When working with attributes, does it entirely matter whether I make them a game attribute or an actor attribute?

For example: I have an attribute called "game.speed." The attribute "game.speed" changes depending on what difficulty levels the user selects on the main menu. Since the "game.speed" attribute only applies to the main actor, couldn't I just as easily make that attribute an "actor attribute?" Are there any major benefits of having that attribute as a "game.attribute?" Or does it not matter in this case? I have attributes for colliding with enemies, picking up objects, etc and just want to make sure they are in the correct places. Thanks for any help!

Comments

  • AsymptoteellAsymptoteell Member Posts: 1,362
    If it's an actor attribute, it can only be altered and used by the actor. If it's a game attribute, it can be altered and used by any actor. I usually use actor attributes when I'm going to spawn multiple versions of the same actor, since then I can use attributes differently for each instance.

    Asymptoteell
  • conrad74conrad74 Member Posts: 50
    Thanks for your help and quick reply. Makes sense. So, correct me if I am wrong: if I really wanted to, I could have all of my "self.attributes" be "game.attributes?"
  • AsymptoteellAsymptoteell Member Posts: 1,362
    Yes, if you don't have instances of an actor that will be spawned that need their own attributes, independent of the other instances.
Sign In or Register to comment.