The Craft
Maths for Games
Explore chance, movement and drawing through experiments and reusable routines.
Choose a starting point. Each sequence explains the maths it uses; you do not need to complete one before trying another.
Chance and samples
Build Dice Roller and watch a distribution take shape. Compare small and large samples, then see what changes when you keep adding rolls.
Start chance and samplesAiming and movement
Turn coordinates into a direction, aim at a target, and see how rounding changes a shot. Explore triangles, trigonometry and fixed-point movement.
Start aiming and movementDrawing on a grid
Choose pixels with integer error, reflect curved edges, fill rows and move bitmap glyphs. Connect the maths to reusable machine code.
Start drawing on a gridFurther explorations
PlannedMore ways to explore the maths behind games. These lessons are still to come.
- Transformations and 3D
- Rotate a cube, move a camera, and understand matrices, local and world coordinates, and perspective.
- Vectors and motion
- Build orbits, pursuit and bouncing movement from directions and distances.
- Measurement and collision
- Use lines, rays and intersections to test sightlines, contact and sliding.
- Curves and surfaces
- Follow curved tracks and build spheres using interpolation, tangents and normals.
- Time, waves and patterns
- Explore acceleration, springs, oscillation, terrain and the effects of discrete updates.
- Chance and decisions
- Extend Dice Roller into weighted encounters, expected value and perceived fairness.
- Mathematics for game AI
- Understand graphs, path costs, heuristics and utility scores: the mathematical groundwork for Game AI.
Fixed-point arithmetic and numerical accuracy run throughout, with visible examples of rounding, drift and precision trade-offs.