latebit / latebit-engine

Pixel based game engine integrated in your IDE
3 stars 0 forks source link

Collisions stop your movement even when your not moving towards the collision #4

Open shikaan opened 8 months ago

shikaan commented 8 months ago

Currently collision checks are implemented with a very simple overlap check: if the bounding boxes of two objects have an intersection, then there is a collision.

However, the following case would not work

  +-----+
<-|     +---+
  +-----+   | ->
        +---+

The objects are touching but their attempting to move in diverging directions. Movement should be allowed, but currently it is not (due to the overlap)