← All interactive demos

Hitboxes — Interactive Demo

This runs the collision checks from the video "How Hitboxes Work in Video Games | A Working Model". The unit is the "dot" (one square of the picture). The character is 16×16 dots and the bullet is 4×4 dots. Every frame: "move the bullet → check for overlap". To make it easy to see, playback runs at 20 frames per second.

1. Fire a bullet (box size, bullet speed, swept check)

Box: – Picture (dot overlap): –
Task: raise the bullet speed until a bullet through the middle "passes through". Then turn the "swept check" ON so it hits at the same speed. Also find the speed in dots at which passing through starts (hint: character box 16 + bullet 4 = 20).

2. Step through frames (previous frame and current frame)

Frame 0

3. Number of comparisons (exact picture vs box)

4. Change the shape (box, smaller box, circle)

Watch a bullet graze the corner (diagonally) with different shapes. Tap / click the canvas to fire.

This page uses the same checks as the video's diagrams (box = 4 comparisons; exact picture = every pair of dots; swept = a line against the box widened by the bullet's size; circle = distance between centres vs sum of radii). These are not values from a real game. There is no single right shape or size for a hitbox. It is a choice based on what the game cares about most.
Sources and credits: same as the video description (AI was used to make the diagrams and script. No game footage or characters are used).