I got a simple method of detecting collision between two objects. The next step is to figure out what side of the hitbox was hit so I know whether I need to push the other object back in X or Y axis. I am using 6502 assembly to keep things simple. This means that some modern methods are too slow. Here is some known information about the objects:
- object X/Y positions
- object A begin above/below and to left/right of object B
- object X/Y speeds
- hitbox top/left/bottom/right bound distance from object position
- the amount of hitbox overlap in X/Y axis
Also there should be a way to detect if a corner is hit so that can be treated differently (eg. when hitting top corner favor pushing object on top of the other object, landing on it, rather than pushing the object aside and falling)