5 minutes
Get the Pitch on Screen
A soccer match needs a pitch. Right now the canvas is black: no grass, no goalposts, no light to see by. Before anything can move, the pitch has to exist.
Five terms carry the whole course. An entity is a named thing in the world, like a wall, a light, or the ball. A component is data attached to an entity. A MeshPrimitive holds a shape and colour. A Goal holds a box. A System reads one kind of component every frame and acts on it. The World holds them all and ticks once per frame. A scene is a JSON file listing the starting entities and their components. You build this game by writing that file, not a render loop.
Scaffold a project with create-arcade, then open the empty scene at src/scenes/soccer.json. Every component this course uses lives under src/components/ — the path printed on each code chip below.
The scene file, lights, and camera
A scene file starts with a few headers and an entities map. Add the sun, the ambient fill light, and the overhead camera:
The DirectionalLight is the sun: one angled beam that lights up surfaces and, because shadowEnabled is true, also casts shadows. Its toSpec() packs those fields into a renderer spec:
Continue reading
Unlock the Full Course
Every lesson, the runnable examples, and the finished build — yours to keep.