TrainsCoding

Guide

Getting started

This page walks through the app from the moment it opens: the home screen, projects, the workspace on iPad and Mac, and a first program built step by step.

The home screen

The app opens on a pixel-art evening scene: a violet-to-amber sky with stars and a crescent moon, teal hills and a little red locomotive steaming along a rail at the bottom. The first time after launch a short startup sequence plays. The red letters of TRAINS drop in one by one, the round red mascot puffs steam, CODING appears under a brass line, and the menu cards rise into place. Tap anywhere to skip it. With Reduce Motion switched on, the backdrop and mascot stay still.

Home screen with My projects and Samples
Home: the “New project” card, your projects, and the built-in samples (marked with a star).

The START theme plays on the home screen. The cards are arranged in two sections:

First launch. On the very first launch the four samples are also copied into My projects, so a new user has something to open straight away.

Managing projects

Long-press a project card on iPad, or right-click it on Mac, to open its menu:

A new project is named “Project n”. It contains one character, an owl standing in the middle of the stage, with one empty When ▶ is pressed train.

There is no Save button. Every change is written to disk about a second after you make it, and again right before every run.

The workspace

Opening a project shows the workspace. It has four parts: a slim toolbar along the top, the character dock down the left edge, the square stage, and the code editor with its wagon depot at the bottom.

The toolbar

ControlWhat it does
HomeBack to the home screen. The project is already saved.
Project nameTap to rename the project (not while running).
Undo / RedoStep back and forward through edits, up to 100 steps. Every gesture is one step: a drop, a parameter change, moving a character. Disabled while a program runs. On Mac: ⌘Z and ⇧⌘Z.
ThrottleThe brass lever starts and stops the program. Tap it, or drag the lever to the right to run and back to the left to stop. On Mac: ⌘R runs and ⌘. stops.
Signal lampNext to the throttle. Red means stopped and green means running.
Stage / Code switchiPad swap mode only: shows the stage or the code full-screen.
Settings (gear)Background, walls, gravity at start, music, sound effects and (on iPad) the layout. See Settings.

The character dock

The left edge lists the project’s characters as costume chips.

iPad: swap mode

On iPad the stage and the code editor each take the full screen.

A new project on the stage pane
Stage pane: a brand-new project with its owl selected.
The code pane with a Move wagon coupled to a start locomotive
Code pane: the live mini stage sits in the top-right corner.

Mac: side by side

On Mac the stage is on the left and the code is on the right, with a pixel rail between them. Drag the rail to resize. The stage can take from 25 % to 70 % of the window, and the app remembers the split. The keyboard doubles as the gamepad, see Controls.

Your first program

This builds a character that greets you, hops, and spins when tapped. The steps work the same on iPad and Mac.

  1. Create a project. On the home screen tap New project. You get an owl in the middle of the stage.
  2. Open the code. On iPad tap the Code half of the switch. The owl already has a red When ▶ is pressed locomotive parked on a rail.
  3. Add a speech bubble. In the depot at the bottom, pick the purple Looks tab and tap the Say wagon. Tapping a wagon couples it to the end of the selected train. You hear a “clack”.
  4. Change what it says. Tap the text plate on the Say wagon and type Hi!. Every parameter has a sensible default, so you only change what you need.
  5. Add a hop. Pick the orange Control tab and drag a Repeat wagon behind the Say wagon. When you lift it near the rail, a gap opens where it will land. Then drag a blue Move wagon (from Motion) into the repeat’s empty slot, and a Wait after it.
  6. Set the parameters. On Move, tap the direction plate and choose ↑ up. Add a second Move with direction ↓ down after the Wait. Now the owl hops three times.
  7. React to a tap. Pick the red Locomotives tab and tap When tapped. A new train appears below the first one. Couple a Turn wagon to it and set its degrees to 360.
  8. Run it. Push the throttle (or press ⌘R). The signal turns green, the GAME music starts, and each wagon lights up as it runs. Tap the owl on the stage to make it spin.
  9. Stop. Pull the throttle back. Everything returns to exactly where it was before the run.

The finished program

When ▶ pressed
Say“Hi!” · 2 s
Repeat3
×3
Moveup · 1 tile
Wait0.5 s
Movedown · 1 tile
When tapped
Turnleft · 360°

Tip. Tapping a locomotive or wagon also selects its train. Wagons you tap in the depot are added to the end of the selected train, or of the character’s last train when none is selected. If the character has no trains at all, a new When ▶ is pressed train is made for the wagon.

Running and stopping

While a program runs:

Stopping ends every train, removes all clones and restores the design exactly: positions, angles, sizes, variables, gravity, and the pen drawing. A run never changes your project. That is why you can always run again from the same starting point.

When a Win or Lose wagon runs, the world freezes and confetti (or a red flash) appears. A “You win!” or “Game over” card then offers Play again or Edit, and the WIN or FAIL jingle plays before the coding music returns.

Languages and accessibility