โ† All DaysยทDay 5
๐ŸŒฑ FoundationsGame FeelThursday, July 2, 2026

Collision & Hitboxes: The Lie That Feels Fair

Collision detection is where your game decides what touched what โ€” and almost every good game lies about it on purpose. The hitbox (the invisible shape used for collisions) is almost never the same as the sprite the player sees. That gap is one of the most important tools you have.

The two shapes you're always juggling:

  • โ–ธThe sprite โ€” what the player sees.
  • โ–ธThe hitbox โ€” the rectangle (or circle) the physics actually checks. Usually an AABB: Axis-Aligned Bounding Box, the cheapest, fastest collision shape there is.

The rule that makes games feel fair: Make the player's hurtbox slightly smaller than their sprite, and the player's attack hitbox slightly larger than the visual. Enemies get the opposite treatment. The result: hits the player lands feel generous; hits the player takes feel deserved. Real-world examples ship this everywhere โ€” Super Mario's hurtbox is famously forgiving near the edges; bullet-hell games (Touhou, Ikaruga) shrink the player's hitbox to a single pixel at the center so near-misses read as skill, not luck.

Why this isn't cheating: The player's brain judges fairness by what it sees just before a hit. A pixel-perfect simulation produces deaths the player swears they avoided โ€” that's the simulation lying to their perception. A forgiving hitbox makes the visible truth and the mechanical truth agree. (This is the same forgiveness principle behind coyote time, applied to space instead of time.)

The practical foundation: For a 2D platformer, you almost never need pixel-perfect or polygon collision. AABB-vs-AABB overlap tests are enough for 95% of games and are trivially fast. Reach for circles for projectiles and round things; reach for polygon colliders only when geometry genuinely demands it.

Game to Study

Super Mario Bros / Touhou (bullet hell)

Open your platformer in the Unity editor and turn on collider gizmos. Is your player's collider bigger or smaller than the sprite? Is your enemy's? Were those choices deliberate โ€” or just whatever the default importer gave you?

Unity Tip

Select your player and shrink the BoxCollider2D / CapsuleCollider2D to be slightly *inside* the sprite โ€” try 85โ€“90% of the visual width. Playtest. Tight spots that felt unfair will suddenly feel survivable, and you changed zero gameplay code.

A playtester keeps dying to spikes and insists 'I clearly jumped over that.' The replay shows their sprite's pixels never visibly touched the spike. Your collider is a tight box matching the full sprite bounds. Diagnose what's happening perceptually and give the two-line fix.