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)

  • 2
    \$\begingroup\$ How have you tried to apply past answers about distinguishing which side was hit, so far? Where did you run into difficulty applying this to your assembly case? \$\endgroup\$ – DMGregory Nov 19 '20 at 18:07
  • 5
    \$\begingroup\$ "I am using 6502 assembly to keep things simple." Those words do not belong into the same sentence. The only reason to use assembly in the 21st century is if you want to intentionally make things complicated for yourself. \$\endgroup\$ – Philipp Nov 19 '20 at 18:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.