Constructicon1985's Forum Posts

  • 3 posts
  • Thanks for the explanation!

  • Thanks guys, it sounds like maybe I'm overthinking it and should use the feature natively put there for that purpose until I find a reason not to. dop2000, by coincidence I happened to be reading a comment of yours from a few years ago where you said something like "Dictionaries have the benefit that you can cycle through them, which you can't do with Instance Variables". I would have to search around to find the exact quote, but do you remember what you were referring to and explain it? I didn't understand that statement at all.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hey Everyone,

    I have a very broad question about best practices for storing enemy attributes or other sprite instance object. I am making my first game and my Family "Enemies", which contains all my various enemy object types, has gotten up to 31 attributes that I'm tracking in the Family instance-variables. I've been reading about Dictionaries, wondering if they were a better way to store all the enemy attributes and figured I should make that decision sooner rather than later. So with that in mind, I'm open to any suggestions and/or explanation, but my main questions are:

    • If I have lot of enemy types with lots of differing attributes and I have an "Enemy" Family containing all of them. Is there any reason NOT to put all the enemy attributes in the "Enemy" Instance Variables, vs using the instance variables on each individual enemy object type? Does it make a difference if many of my enemy types will use unique (or only in a small subset) attributes that won't be used at all by the other enemy types?
    • Is the Dictionary vs Instance decision based on the number of variables? At what number of variables would you switch?
    • In general, what advantages do Dictionaries offer over Instance Variables?

    Thanks for your time if you respond to this.

  • 3 posts