The real actor in this is "The Value".
Examples of values are: the score, lives, level, health, damage ..... etc.
The value can be a number or a text.
In order to store and retrieve those values, we need a special place that remembers them,
and a way to address them.
When we store the values in a variable belonging to an object. We call it a "private variable"
Private Variables in Construct get addressed by there object and there name.
First we need to create this special place, and that can be done in 2 ways.
Bring up the .cap with the darts i provided, or download it again from previous post.
bring yourself to the layout editor.
Select any of the darts ...
locate "Private variables" in the properties pane. Uncollapse it.
Click add to add a new one.
A window "manage private variables" will pop up.
click on the green + to add one.
name it Xstep
keep the type op op number
and let it keep the value zero.
Check on errors before you click "done"
And thats it.
Select the other darts .. and notice that they now all have this private variable added.
They are instances of the same object. If you add/delete a variable in 1 instance ...
it will be added/deleted in all instances. Handy though.
So that was the first way.
Go to the Events Editor.
Click on the "New action"
The wizard shows up.
Step1: self object = dart
Step2: action = set value (yes the actor in this is a value)
Step3: the parameters ... under "private variable" you will find a drop down menu.
Notice that Xstep is allready present.
There is also <..add new..>
just select "add new" and you get the same "manage variables" window.
make one with the name "Ystep"
and value = zero
click done and finish.
That was the second way.
Construct will not let you unneeded run from layout editor to events editor and back and forth.
For the same reason, the properties plane is visible in both editors.
Handy though ?
Ok now the dart object has 2 private variables. Xstep and Ystep
We can store a different values in each instance.
As i said before this will give a instance an identity too.
You can store by events, and you can store in the layout editor.
Go to the layout editor.
Give Ystep of the second dart in the upper row the value -1 (negative one) by changing it in the properties plane.
Give Ystep of the third dart on the bottom row the value 1 (just one)
Now lets isolate those 2 based on there private variables and do an action on them
Go to the events editor.
Delete all events in there, and all actions. There is at least the action from making the Ystep.
And maybe you have auto save on and there will be the events from last session.
Add a system flow condition "always"
Add a sub event
step1: self object = dart
step2: action = compare a private variable
step3: parameters .. Ystep as variable .. greater then as comparison .. 0 as value
we just retrieved a private variable btw
Add an action to this condition that rotates the dart by .angle + 1
(re-read previous post if you forgot how to)
Now lets save us a lot typing. And do what computers are made for. Copy and paste.
Select the sub event. (click the E-spot, member ?) The whole tree of the sub event will be selected.
Press CTRL+c, Press CTRL+v.
A copy of the sub event will appear.
And more important: Its all ready a sub event on the right place.
And on top, the action followed in the copy.
Handy no ?
Now double click the compare condition (C-spot, member ?) ..
The wizard will come up to allow you to edit the condition.
Just change the "greater then" to "less then" .. and finish.
Change the .angle + 1 in the action to .angle -1
As you see, construct has some great edit functions, but you do have to find them.
Run all, and see that we picked instances based on there private variables.
You dont feel the love for construct yet ?