Skip to contentTalk to us

Hitbox

In Arabic: صندوق التصادم

Game making

The invisible rectangle around a character or enemy that the game uses to decide whether a touch happened.

A game does not see the drawing of a character; it sees a simple rectangle around it called the hitbox. When the player's rectangle overlaps a coin's rectangle, the coin is collected; when it overlaps a spike's rectangle, the player loses a life. This rectangle rarely matches the drawing exactly and is usually a little smaller.

Hitbox size makes a big difference to how fair a game feels. If it is larger than the drawing, players feel they died without touching anything, get angry and quit. If it is slightly smaller, they feel they escaped through skill. Most successful games lean in the player's favor. In 2D Game Design you try it and adjust while the game runs. Practical tip: if testers say your game cheats, the problem is usually the hitboxes, not the difficulty. Ask for smaller hitboxes on hazards and bigger ones on coins.

ExampleA spike is drawn 32 pixels wide but its hitbox is only 24, so the player brushes past its edge without losing.
All terms

Your idea deserves to see the light.

Describe it in Arabic or English and Fanann builds, tests and ships it — no coding knowledge needed. Start free, no credit card.