diff --git a/src/corelib/physics.c b/src/corelib/physics.c index 8940cf9..1c146f1 100644 --- a/src/corelib/physics.c +++ b/src/corelib/physics.c @@ -156,10 +156,10 @@ float _solve_aabb_aabb(const object_t* a, const object_t* b, float* out_px, floa float bminy = b->physics.aabb.y + b->sprite.y; float bmaxy = bminy + b->physics.aabb.h; - float right = amaxx - bminx; - float left = aminx - bmaxx; - float top = aminy - bmaxy; - float bottom = amaxy - bminy; + float right = bmaxx - aminx; + float left = bminx - amaxx; + float top = bminy - amaxy; + float bottom = bmaxy - aminy; float ret = right; *out_px = right;