Skip to content
Back to skills

Physics

ASecurity

Add basic collision detection and response for 2D/3D game entities

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 3, 2026
ai-agentsgo

Security analysis

A100/100

Scanned September 3, 2026

npx -y skills add black141312/ada --skill physics --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Physics?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Physics
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/black141312-physics/badge)](https://www.skillsdirectory.com/skills/black141312-physics)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: physics
description: Add basic collision detection and response for 2D/3D game entities
category: gamedev
---

# Physics

Reach for this to add movement, collision detection, and resolution without pulling in a full physics engine.

1. Choose collider shapes (AABB, circle/sphere, capsule) that fit your entities; prefer the simplest that works.
2. Integrate motion with semi-implicit Euler: `velocity += accel * dt; position += velocity * dt`.
3. Broad-phase first (spatial grid or sweep) to cull pairs, then narrow-phase exact overlap tests on survivors.
4. On overlap, compute penetration depth and a contact normal; separate by pushing along the normal.
5. Resolve velocity along the normal using restitution (bounce) and friction along the tangent.
6. Run collision after integration each fixed step; iterate resolution a few times for stacked contacts.

## Rules
- Run physics on the fixed timestep, not the render delta, so behavior is stable and reproducible.
- Use swept/continuous tests for fast objects to avoid tunneling through thin walls.
- Separate position correction from velocity response; resolving only velocity leaves objects sinking.
- Add a small slop/epsilon and skip resolving tiny penetrations to stop jitter at rest.
- Keep colliders convex; concave shapes need decomposition or you get caught-edge artifacts.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.