Object-oriented programming utilizes "constructors" which at its basic level allow the programmer to instantiate a bunch of member (instance) variables upon creating the object.
Correct me if I'm wrong, but it appears Construct 2 doesn't have that built in.
For this simple example where we just set the position and scale of Ball on creation, are these the current alternatives:
Make the constructor simply just an On created trigger:
<img src="http://cannedessence.com/construct2screens/constructor1.png" border="0" />
Problem: you can't elegantly send values to the constructor. This would be desired if the place where you create the object has contextual information from some other picked object, etc.
OR
Make a function as a constructor replacement, and this is where it gets confusing to me:
<img src="http://cannedessence.com/construct2screens/constructor2.png" border="0" />
Why does this work? Notice the second action in the Create_Ball function. Shouldn't this pick all instances of Ball, since the event doesn't pick any instances of Ball? Somehow it picks the most recently created Ball, which works here. However, it doesn't seem right, so I don't want to rely on it.
I can't put an On Created trigger inside the function definition because they are both triggers.
Is there something I'm missing about this?
Thanks!