5 minutes
Launch the Ball
Four lessons in, the table is a photograph. Nice lighting, correct walls, a camera that frames itself — and not one moving pixel. Drop a sphere with a dynamic Havok body onto it right now and you'd get a fifth static object, because Havok's default gravity points at the floor and a pinball table is a ramp. The ball would land on the slab and stay there.
A pinball table only works if gravity leans. Everything that follows in this course — bumpers, spinners, saucers, the flippers you'll add next — assumes a ball that is always falling toward the bottom of the playfield. That lean, and the ball's whole life around it, belongs to one component.
Add the ball and the World entity
Two new entities. The ball, and a bare marker entity that carries the systems nothing else owns:
The ball carries no pinball component whatsoever. A sphere, a shadow, a dynamic body, and one tag. Everything that happens to it is done from a different entity, by a system that finds it with world.getEntitiesByTag('ball'). That one string is the entire coupling.
Continue reading
Unlock the Full Course
Every lesson, the runnable examples, and the finished build — yours to keep.