← Back to Treaducation
Teacher's Guide
Treaducation - Code & Learn

For teachers or session leaders running Treaducation with a group. You don't need to be a programmer. The material is self-guiding - your job is to keep students moving, help them get unstuck, and ask the right questions.

Overview

What students will build

A two-player 3D tank battle game, running entirely in a browser. No downloads, no accounts, no install. By the end of Step 5 each student has a working game they built themselves - and can take home, share, and modify.

Who this is for

Curious beginners aged roughly 12-16. No prior coding experience required. Students who have done a little HTML or JavaScript before will move faster, but the material assumes nothing.

What each student needs
Session planning
Before the session - preparation checklist

Your role as facilitator

You don't need to know JavaScript to run these sessions. The step files are the answer key. If a student is stuck, the first step is always: "Open the reference file and compare your code to it line by line." The reference files can be opened directly in the browser - to read the code, right-click anywhere on the page and choose View Page Source or Inspect. That skill - reading and comparing code - is itself something worth learning.

The most important rule: let students struggle a little before helping. Five minutes of being stuck and then solving it themselves is worth more than being shown the answer. Ten minutes stuck with no progress is when to step in.

Each step ends with a "Make it yours" section. Treat this as mandatory, not optional. Students should change colours, sizes, speeds, and spacing so their version looks different from the reference and from each other. If every student finishes with an identical green cube, the learning did not happen - they copied rather than understood. A quick check: ask a student to explain why they chose a particular value. If they can't, ask them to change it and see what happens.

At the start of each step, remind students: open starter.html, save a copy with a new name, then open it in the browser side by side with their text editor. They should be making changes and refreshing the browser constantly - not writing the whole step before checking anything.

Useful things to say when a student is stuck:

The browser console (F12) is your most powerful tool. Almost every error appears there in plain English. You don't need to understand JavaScript to read "Uncaught ReferenceError: camera is not defined" and help a student find where they forgot to declare a variable.

Step by step

01 Hello World

Students create a blank HTML file and get a rotating green cube on screen. This is the hardest step emotionally - starting from nothing is daunting. Once the cube appears, confidence jumps sharply.

Key concepts introduced
Common mistakes
Good questions to ask
Scene / Camera / Renderer BoxGeometry Animation loop requestAnimationFrame
02 Flat Terrain

The cube is replaced with an open landscape - a flat plane, a grid overlay, a sky colour, and fog that hides the edge. OrbitControls let students fly around. This step is short and satisfying.

Key concepts introduced
Common mistakes
Good questions to ask
PlaneGeometry GridHelper Fog OrbitControls
03 Tank and Controls

The longest step. Students build a tank from three grouped boxes, add keyboard controls, and get the camera to follow behind. The key concept - delta time - is introduced here and is worth spending time on.

Key concepts introduced
The delta time concept - worth explaining

Without delta time, a game runs faster on a fast computer and slower on a slow one. Delta time fixes this: instead of moving 1 unit per frame, the tank moves 10 units per second, and each frame it moves 10 * dt. A fast machine takes many small steps; a slow one takes fewer but larger ones. The result is the same.

Try this with the class: find the movement line in step3-tank.html, remove the dt multiplier, and watch the tank become uncontrollably fast. That's what a game without delta time feels like on a fast machine.
Common mistakes
Good questions to ask
THREE.Group Keyboard input translateZ Delta time Follow camera
04 Shooting

Students add turret rotation, a firing mechanic, and a target that reacts to being hit. This step introduces arrays of moving objects and collision detection - two patterns that appear in almost every game ever made.

Key concepts introduced
The backwards loop - worth explaining

When removing items from an array while looping through it, looping forwards causes bugs: removing item 3 shifts item 4 into position 3, and the loop skips it. Looping backwards avoids this - removing an item only affects indices below the current position, which have already been processed.

Common mistakes
Good questions to ask
Turret rotation Projectile array localToWorld Box3 collision scene.add / remove
05 1v1 - The Full Game

A second player is added, health bars appear, and the game now has a win condition and a reset. This step introduces factory functions - one of the most important ideas in programming - and a dynamic camera that watches both players.

Key concepts introduced
Controls for both players

Tell both players the controls before they start - it is easy to miss that P2 uses the arrow keys and Enter, not WASD and Space.

Common mistakes
Good questions to ask
Great point for a class debrief. Ask students: what was the hardest part? What would you add next? Having students play each other's games for five minutes before the debrief works well.
Factory function Player data objects Dynamic camera Health / win state DOM HUD

After step 5 - keeping momentum

Students who finish early or want to keep going have several natural directions. The README.md in the download lists these - here is how to frame them as challenges:

Common problems and fixes

Nothing appears on screen
Three.js won't load (blank screen or console error)
Movement is very fast or very slow
Student is completely lost and can't make progress

Reference resources

These links are useful to have open during a session - either for yourself or to share with students who want a clearer explanation of a concept.

Colours - hex colour picker

g.co/color/picker - Google's built-in colour picker. Pick any colour visually and copy the hex code shown. Replace the # with 0x when using it in Three.js code.

Coordinates - x, y and z axes

mathsisfun.com - Cartesian Coordinates - a visual, beginner-friendly explanation of how 3D coordinate systems work, with diagrams and an interactive component. Scroll to the 3D section.

Radians - the unit Three.js uses for rotation

mathsisfun.com - Radians - visual diagrams showing how radians relate to degrees. Best for ages 14 and up.

Khan Academy - Introduction to Radians - short video explanation, better suited to younger or less confident students.

Where to go next?

Once your students have finished Step 5 and want to keep going, here are the most useful places to send them.

The Treads of War source code

github.com/filecore/treads-of-war - the full source code for the game that inspired this tutorial. It uses all the same ideas from Steps 1-5 but taken much further: procedural terrain, AI enemies, online multiplayer, weather, and more. Ambitious students can read through it and identify patterns they recognise from the tutorial.

Three.js documentation and examples

threejs.org/docs - the official reference for every class and method used in this tutorial. It is written for developers rather than beginners, but students can look up anything they encounter (BoxGeometry, MeshBasicMaterial, etc.) and find a clear description of what it does and what parameters it accepts.

threejs.org/examples - a large gallery of live demos with source code. A good source of inspiration and a useful way to see what is possible with the same library.

JavaScript fundamentals

MDN Web Docs - JavaScript First Steps - Mozilla's beginner guide to JavaScript. Well-written, free, and thorough. Good for students who want to understand the language itself rather than just the Three.js layer.

Khan Academy - Computer Programming - interactive lessons covering JavaScript and general programming concepts, pitched at a younger audience. A good starting point for students who feel they need to go back to basics before tackling the tutorial steps.

For teachers - curriculum and lesson plan ideas

code.org - free resources for teachers including lesson plans, Hour of Code activities, and structured courses. Useful as a companion curriculum alongside Treaducation, or as preparation before starting the tutorial.

STEM Learning - Game Design resources - curated teaching resources on game design for UK schools, covering both the creative and technical sides of making games.