liveBook · Manning

Collision detection

Collision detection is the computational determination of whether modeled objects or entities intersect, touch, or otherwise occupy conflicting spatial regions.

How 2 Manning books explain it

Classic Game Programming on the NES: Make your own retro video game

Collision detection is the technique of determining when game entities occupy intersecting or otherwise interacting spatial regions.

How it is used
Drives hit handling between bullets, enemies, and the player during game updates.
How deep it goes
Builds a reusable rectangle-intersection routine with parameters, axis tests, early exits, and carry-flag results.
Examples
Works through bullet-versus-meteor removal and enemy-versus-player life loss in Mega Blast.
What you can do after
Build it from scratch as a rectangle collision routine and integrate it into an existing enemy loop.

Read how Classic Game Programming on the NES: Make your own retro video game explains collision detection →

HTML5 in Action

Collision detection is the computational technique of determining whether objects intersect or come into contact.

How it is used
Enables game responses to overlapping objects and checks against play-area boundaries.
How deep it goes
Walks through boundary and object-overlap handling, but stops short of full physics integration.
Examples
Uses a bouncing ball and paddle alongside lasers shooting multipart shields.
What you can do after
Build collision checks from scratch and trigger responses such as deflection or an object's hit method.

Read how HTML5 in Action explains collision detection →

Also covered in

Related concepts

Questions about collision detection

What is collision detection?

Collision detection is the computational determination of whether modeled objects or entities intersect, touch, or otherwise occupy conflicting spatial regions.

Which Manning books explain collision detection?

Classic Game Programming on the NES: Make your own retro video game and HTML5 in Action.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.