diff options
Diffstat (limited to 'src/physics.c')
| -rw-r--r-- | src/physics.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/physics.c b/src/physics.c index 6781c41..72d9410 100644 --- a/src/physics.c +++ b/src/physics.c @@ -1,6 +1,7 @@ #include "physics.h" #include "game.h" #include "utils.h" +#include "constants.h" extern Game game; @@ -54,8 +55,24 @@ void DebugHighlights(const Entity* e) { Rectangle dstRect = GetPhysicsColliderGlobal(e); Color colliderDrawColor = e->physicsColliderColor; - colliderDrawColor.a = 170; + colliderDrawColor.a = COLLIDER_ALPHA; - DrawRectangle(dstRect.x, dstRect.y, dstRect.width, dstRect.height, colliderDrawColor); + DrawRectangleRec(dstRect, colliderDrawColor); + + for (int i = 0; i < e->numHitBoxes; i++) { + Color hitboxDrawColor = e->hitboxColors[i]; + hitboxDrawColor.a = COLLIDER_ALPHA; + + Rectangle dstRect = GetEntityHitboxGlobal(e, i); + DrawRectangleRec(dstRect, hitboxDrawColor); + } + + for (int i = 0; i < e->numHurtBoxes; i++) { + Color hurtboxDrawColor = e->hurtboxColors[i]; + hurtboxDrawColor.a = COLLIDER_ALPHA; + + Rectangle dstRect = GetEntityHurtboxGlobal(e, i); + DrawRectangleRec(dstRect, hurtboxDrawColor); + } } #endif |
