89
collision
Detect overlap, then resolve it. Detection without a response is a highlight, not physics.
What is collision?
Collision detection asks whether shapes overlap. Resolution separates them or fires gameplay (damage, pickup, bounce). Layers decide who checks whom: player vs wall, bullet vs enemy, not everything vs everything.
Why does collision matter when vibe coding?
Models check bounding boxes and then set a boolean. The sprite stays inside the wall. Or they check every pair every frame. Name layers and the response.
How do you do collision?
Shapes, not pixels, unless you mean it. Layers or masks. Resolve penetration for solids. Triggers report and do not push. Broad phase if the count is high.
How do you ask a model for collision?
Collide (A) with (B) using (shape). Solids resolve penetration. Triggers only report. Use layers so (A) does not collide with itself. Do not pair every object with every object.
What goes wrong with collision?
Resolving by teleporting to the last safe pixel with no slide. Corners stick. Separate axes or let a known solver do it.