Intro to Game Development
Lesson 3 of 3 6 min +40 XP

Collisions & Score

Detecting hits and keeping points.

What you'll learn

  • Understand collisions & score
  • Apply it to real examples
  • Check yourself with a quiz
Do the boxes touch?

To know if the player grabbed a coin, the game checks whether their two boxes overlap. That simple 'do the rectangles touch?' test drives coins, hits, and game-overs.

Overlap and state

Collision detection tests if two hitboxes overlap. On a hit, the game updates state — add score, lose a life, or end the game.

Knowledge Check

+10 XP / correct

1. Collision detection checks if two…

2. When the player collects a coin, the game…