Collision detection
Collision detection is the computational determination of whether modeled objects or entities intersect, touch, or otherwise occupy conflicting spatial regions.
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.
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.
Also covered in
- Get Programming with JavaScript Next: New features of ECMAScript 2015, 2016, and beyond
- Get Programming: Learn to code with Python
- Math for Web Design
Related concepts
- Rectangleuses · A rectangle is a planar quadrilateral with four right angles and opposite sides of equal length.
- enemyuses · An enemy is a game entity that opposes, threatens, or obstructs the player or playable characters.
- tensor shapeuses · A tensor shape is an ordered sequence of dimension sizes specifying the extent of a tensor along each axis.
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.

