I have a question in 2 parts:
I have 2 rectangles, A and B. B is a wall and A is moving. My simple logic is this: every time A moves, he moves according to an offset (x, y) and then checks whether he has collided with something. If it collides with something, step back in the opposite direction until the collision does not occur anymore.
The problem here is that if A moves in big pieces, he could jump B completely.
The desired behavior is to know where A should be when he touched for the first time one of the faces of B, then return to that point and apply the collision resolution.
And if B moves too?
What I am currently doing to avoid this problem is to create large collision boxes and to ensure moving objects do not exceed the maximum. This approach seems to be limiting in the future.
I suppose there is a mathematical way to solve this problem, but I have found no answer to my research. All tips / suggestions are greatly appreciated.