I'm new to this whole Construct thing, but i've used similar programs like Game Maker. So far, i'm enjoying this program a whole lot more.
Anyways, i've been tinkering around a little and i have this little game where i want a bunch of physics objects to scoot around the screen from side to side. When they hit an object and their velocityx reaches zero (or close to it) they change direction. Problem is, the way i have it set up now, they all change direction at the same time and i don't know how to change the event sheet so that i change only the private variable of the object instance the event occurs for. (i hope that makes sense) How do i make it so that they function independently of each other?
To see an example, check out the cap below:
I would like this question answered so i can figure out how exactly events and private variables work with each other. But also, if you have better ideas on how to make these objects change direction when they hit a wall, let me know that too.
Using 'System - compare values' is what's causing this. This will just calculate two numbers and compare them, ignoring the fact there are multiple instances of the sprite (so it just picks the first one and uses values from that). You should either use comparison conditions within the sprite object itself (which has a 'compare private variable' condition which respects picking), or alternatively, you can put a 'for each sprite' condition at the top of the event, which forces the compare values to run once for each sprite.
Great! Using the "once for each object" system condition works perfectly.
I suppose to solve it by comparing private variables within the object there needs to be some condition statements under an object's physics tab (which i'm guessing is on the todo list for the next Construct version) then i could just compare "object[physics].velocityx" with the object's private variable.
Thanks for the help!
If you want to pick an object by value comparison, store the value in a private variable (with (ALWAYS>>set VARIABLENAME to VALUE) and use "compare a private variable". it will pick instances which meet the condition.
Develop games in your browser. Powerful, performant & highly capable.
Use the 'Pick by comparison' condition of Sprite, then enter (for example):
This will pick all instances which match it.