Which Tile Is It?
Moving on from being able to tell how far the collider is in the other. The question arose how to combine all the collisions that are happening into one. Offsetting, in this case, the entity correctly.
I think this is where the time variable comes into play. Determining which tile we hit the first, during the movement from the previous frame to the new current frame. Because that is the one who will offset the entity first, logically.
I came to this realisation at the end of my train journey. During the train ride I also made sure that the vector describing the collision and the collision length was pointing in the right direction. Not sure yet if it does so 100% of the time. At least for the world X and Y axis it does 😛
The visuals really help by the way. I think it has shown me how important those visuals are. Implementing even that rotated rectangle was worth it. It’s just used to show you the collision volume, but it makes stuff so much clearer. It’s really easy to see now if a collision is wrong and I could make it even more clear. I just need to draw more lines instead of points.