M
MercyGRID
Guest
Hello all! First post, but I've been toying around for a bit and getting used to the ropes of GML. I'm still pretty new, but I learn quick!
I'm trying to accomplish stacking multiple objects on top of one another in the game window, while at the same time giving priority to some objects to be further in the stack.
There are 3 types of objects: Let's call them A, B, and C. The priority should be all of A stack at the bottom, followed by B, followed by C. The problem is B is 2 times larger than A or C.
If all the objects were the same size, it would be simple: Move the object down until it hits the same priority object type, the one higher in priority, or the "floor". Then any other object you collide with moves up at the same time. But in this case, if Object A is moving down the stack toward its priority and collides with Object B (which is 2x bigger) Object B will be moving twice as much as it needs to, and I then end up with overlapping Objects that don't function the way I'm looking for.
I'm probably describing this terribly, but...
Current -- Target
A ---------- C
B ---------- C
C ---------- B
A ---------- A
C ---------- A
Keeping in mind B is 2x the size.
How can I get this kind of movement and collision problem working? Should I be looking to use a 3D Array and store data inside it to determine movement locations, or is there a simpler way?
I'm trying to accomplish stacking multiple objects on top of one another in the game window, while at the same time giving priority to some objects to be further in the stack.
There are 3 types of objects: Let's call them A, B, and C. The priority should be all of A stack at the bottom, followed by B, followed by C. The problem is B is 2 times larger than A or C.
If all the objects were the same size, it would be simple: Move the object down until it hits the same priority object type, the one higher in priority, or the "floor". Then any other object you collide with moves up at the same time. But in this case, if Object A is moving down the stack toward its priority and collides with Object B (which is 2x bigger) Object B will be moving twice as much as it needs to, and I then end up with overlapping Objects that don't function the way I'm looking for.
I'm probably describing this terribly, but...
Current -- Target
A ---------- C
B ---------- C
C ---------- B
A ---------- A
C ---------- A
Keeping in mind B is 2x the size.
How can I get this kind of movement and collision problem working? Should I be looking to use a 3D Array and store data inside it to determine movement locations, or is there a simpler way?