If you're completely new to Construct, this course...
This tutorial hasn't been translated.
This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.
The Families example is pretty self-explanatory.
Take the time to read the explanation in the layout and check out the event sheet.
As indicated, families can be used to reduce the number of events required.
Families can have their own “instance variables”, although in that case they are named “Family instance variables” and are handled when you click the family in the project bar.
For the sake of testing, select the family Enemies in the project bar.
In the properties bar, add a family instance variable test.
Now, in the project bar, go and select the object type BugEnemy.
Notice in its instance variables category it now contains a variable “test [Enemies]”.
The name in between the brackets indicates it is a family instance variable of the Enemies family.
It also means that to edit the properties of this variable, you need to select the family, not the object type(s) contained within the family.
If you click to edit the instance variables of BugEnemy, it contains none.
In the same vein as family instance variables, you can have family behaviors that are common to all the object types members of the family and can only be added and edited when selecting the family in the project bar.
And that's a quick, first look at families, another of the highly useful tools provided by Construct.
The rest of the examples cover specific game mechanics that you might want to have a look at.
Depending on the elements your game might require you may want to check some examples of easy implementation to start with.
It can also be a valuable learning experience to go through some of those out of sheer curiosity, just to know what is in your toolbox.
thanks keep up the good work!
I remade it with death, health, money, and more: construct.net/en/free-online-games/turret-defense-remake-58352/play
The INSTANCE VARIABLES EXAMPLE
I delete "System, Every tick" event, and add an action to "Text, Set text to Sprite.ClickCount" at "Mouse, On Left button Clicked on Sprite" event, but all Texts change when I click any Sprite, why?
May i set text when "Mouse, On Left button Clicked on Sprite"?
This is because of how picking/events work : construct.net/en/make-games/manuals/construct-3/project-primitives/events/how-events-work
You do not have a single instance of "Text" picked, so, the action applies to all existing "Text" instances.
To do what you want to achieve, you need to add a condition to your "Mouse, On left button clicked on Sprite" event and pick the associated "Text" instance.
This can be done using containers, or adding a instance variable to the "Text" object type, holding the UID for its associated Sprite for example.
Thanks for reply!
How does each instance of the text object know which instance of the sprite object it is linked to?
Are you referring to a specific template ? If you do, please mention which one it is.
Otherwise, Containers - construct.net/en/make-games/manuals/construct-3/project-primitives/objects/containers - can be an answer to your question.
Else, it might be picked, thanks to something like an instance variable.
I think he/she is talking about page 5: Instance variables example.
I can't download the template :/. If i click on it, it just opens the screenshot in a new tab.
All templates are found in the Start page of Construct 3 and not to be downloaded from here.