Hello. I'm trying to wrap my head around Construct's picking system. I have to wrestle with it a lot, especially when working with pairs of objects or testing objects against the same types of objects.
I'm using a single object type for the bounding boxes(BB) of all my game entities. Some bounding boxes are from static, immovable game objects and the rest will collide and push off of each other. These properties are stored in private variables.
So there are two possibilities in a collision:
- If a moveable BB collides with a static BB, then the moveable one will push itself out.
- If a moveable BB collides with another moveable BB, then they will both push each other a little bit every tick.
Here's how I first imagined I would structure my events:
For every paired entity, pick its BB.
If it collides with another BB.
If second BB is moveable
> Have both BB's push each other in opposite directions.
If second BB is static
> Have the moveable BB completely push itself out of the static BB
My first confusion with this is in the first condition statement. If I pick only the BBs that are paired with an entity , then how does it know to test them against other BBs on the layout (since the only BB that should be picked at this moment is the one that is paired with the entity)? This actually does what I want despite not knowing why.
The second confusion comes at either of the sub events when you have to test the colliding objects against each other. Since they are the same object type, how do you tell them apart?
I'm guessing there's a construct-like way to solve this that I'm just not getting.
Also, is there anyway to store a hard reference to instances? I realize I end up doing a lot of needless searches.
Edit: And one more thing: How do you access behavior actions from python?