How do I make a simple skill system.

0 favourites
  • 2 posts
From the Asset Store
Set of 200 hand drawn skill icons. All icons are of a high quality.
  • Hi! I have read the manual and different tutorials about C2 but I didn't catch the idea of making a simple skill system of my hero in platform game. The goal which i'm going to achieve is very simple, I need

    -dmg (for example 2-6)

    -defence

    -health

    -mp

    and for a mage I need different skills, which you should open on the new level.

    The problem is that I don't understand the difference between instance value, array, and dictionary. All of these instruments can be used to reach my goal?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • An Instance Variable is a variable that is tied to an instance of an object. So you could create an object call Monster and give it an instance variable of Health. If you place multiple copies of that Monster object on the layout they are instances of Monster, each with their own Health.

    An Array is kind of like a box that is divided up into compartments to hold things. The default Array is divided up into 10 compartments numbered (0, 1, 2, 3, 4, 5, 6, 7, 8, 9). So to set a value in the 3rd compartment to 20 you would apply an action on the Array to Set value at (2) to 20. The (2) represents the 3rd compartment because the array index starts at 0. You can also have a multidimensional Array. So you could divide that same 3rd compartment up into 8 compartments. So to set a value of the 6th compartment of the 3rd compartment to 50 you would apply an action on the Array to Set value at (2, 5) to 50. In Construct 2 the dimensions of the Array are referred to as X, Y, and Z. In my above example the "Z" would happen if you divided that 6th compartment up into additional compartments. This seems like it could be getting confusing, so I'll stop and see if you are following what I'm saying.

    Found this:

    https://www.scirra.com/tutorials/307/ar ... -beginners

    A Dictionary is a set of key/value pairs. So you can have a key of "Tom" and set its value to 30. The key is similar to the Array compartment index value. In the Array example above we stored a value in the 3rd compartment. In the dictionary we store the value at compartment "Tom". In a Dictionary you have no control over the order. So if you had Dictionary with keys for "Tom", "Dick", and "Jane" you have no idea which one comes before the other. I haven't tested it in C2 but in Python it is considerably faster to access data stored in a Dictionary compared to an Array.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)