Game 067 — Collision Optimization

New concept: spatial partitioning (grid binning) to avoid O(n²)

Lots of moving dots can get expensive if you check every pair. This demo compares naive collision checks to a simple spatial grid binning approach.

Mode
Grid
Checks / frame
0
Collisions
0
Approx FPS

Grid mode only compares dots in nearby “cells” instead of everyone with everyone.

What’s different from last game?

You keep animation smooth with many objects by reducing collision work.

Optional challenge variants

    Tips

    Open DevTools → Console to see helpful logs. Try changing constants at the top of the script.