Collision alignment with multiple actors
Hello, and thank you for a great forum. I have been searching for a solution, so if there is a thread on this already, my apologies, I did not find it. I would appreciate any assistance you can provide, thank you!
Like many, I have run into an issue with actor alignment after collision. However, I have lined myself up for a slightly different challenge. I am building a logic/maze game that involves rotating the scene and allowing the actors to drop (I currently do this with acceleration). The main actor collides with "maze" walls and stops, allowing the scene to be rotated again.
All actors are 32x32, including the walls. Invisible collision (smooth) actors will not always work because sometimes the scene contains single blocks in the middle of the scene. I have manually placed all of the scene pieces on a 32x32 grid layout and had success with a single actor moving around the board. The actor does not catch any edges.
However, when I add a second actor, and they fall on top of each other, the actor on top appears to "sink" 1-2 pixels into the bottom actor after falling and stay there. When I then rotate the scene, the actor is caught on the "walls" rather than falling (accelerating) like it did before. I am not using round collisions because the actor must fall straight down, and round collisions have proven to bounce sideways when catching an edge.
All moving actors have bounce set to 0, density set to 0. The walls have bounce set to 0, density set to 1.
I have considered moving objects by checking the next grid block for the existence of a wall and moving it to that grid square if no wall exists. However, this seems cumbersome and memory intensive, especially when I need to start checking for other moving actors in that spot and then seeing if that actor is going to move or not due to a wall... the code gets long and brute-force. I was hoping there may be a simpler physics, trick-the-physics, or lack of physics solution I am missing.
If the explanation is not clear, please ask me to explain it a different way. I will include a picture or two if the forum lets me. Thank you for any ideas, I know there are plenty of great ones out there!
Single Actor (after falling)
Two or more actors (after falling)
Caught on edge of wall (pixel overlap?)