A Three.js game is just 3 things repeating:
- Scene β the world (lights, ground grid, camera).
- Things β ship (cone + wings), stars (spinning octahedrons), rocks (red icosahedrons).
- Loop β every frame: move ship, spin stars, check distances.
if (star.position.distanceTo(ship.position) < 1.1) {
score += 10; // collect!
}
Thatβs the whole trick! Distance checks = collisions. Next weβll learn about requestAnimationFrame and why we use dt (delta time) so the game runs the same speed on any computer.