Introduction
15 minYour hall command from last lesson has a problem you may not have noticed yet.
Fly a few hundred blocks away and type hall 10. Nothing appears. The room was built — perfectly, instantly — back at the numbers you typed into the program, and you are nowhere near it.
Every fill you have written so far is nailed to an address you chose while sitting in Code Builder. Today your builds learn to follow you.
Two kinds of position
The Positions drawer holds two blocks that look similar and behave completely differently:
| Block | Reads | Measured from | Moves with you? |
|---|---|---|---|
world 100 4 200 | an exact address | the world's origin | no — always the same block |
~0 ~0 ~0 | an offset | your own feet | yes — wherever you stand |
The little ~ is called a tilde, and it means "from me". ~0 ~0 ~0 is the block you are standing on. ~5 ~0 ~0 is five blocks east of it. ~0 ~10 ~0 is ten blocks above your head.
Which one do you want?
Both are right, for different jobs:
- World is for a place everyone agrees on — a meeting point, a shared build, a tower the whole class can visit because it is always at the same address.
- Tilde is for a tool you carry — a command that drops a house, a bridge or a platform wherever you happen to be standing.
Getting this wrong is why your room appeared in a field two hundred blocks away.
⚠️ The tilde does not know which way you are facing. ~5 ~0 ~0 is always five blocks east, whether you are looking east, west or straight up. It offsets along the world's axes, not yours.
A box is not a building
That is half the lesson. Here is the other half.
Everything you have filled so far has been one material throughout — a stone box, a glass box. Real buildings are made of layers, and each layer is a separate fill:
| Layer | Typically |
|---|---|
| foundation | stone, one block deep, at the bottom |
| walls | planks or brick, several blocks tall |
| windows | a band of glass part-way up |
| roof | something different again, on top |
Each of those is one fill block with its own material and its own range of Y. Stack four or five of them and you stop building boxes and start building architecture.
Warm-up — two ways to say where
"Number 14, Mill Road" finds the same house for everybody, forever.
"Three doors along from where I am standing" finds a different house depending on who is speaking and where they are.
Both are useful. Neither is a substitute for the other, and confusing them is how parcels go missing.
What you will be able to do
- Say what the tilde means and when to use it instead of a world address.
- Build the same thing in three different places without editing the program.
- Stack fills of different materials into something that looks deliberate.
- Cut windows and a doorway with air.
Basic
20 minFollow along on your own computer. Everyone should finish this part with the same working build.
Step 1 — Watch the problem happen
Go into the world and run your floor command from Lesson 7. It appears where the numbers said.
Now fly a long way — a few hundred blocks — and run it again.
Nothing appears. It built again, exactly on top of the first one, at the address in your program. You simply are not there to see it.
Step 2 — Swap in the tilde
Press C and find your fill block. Drag the ~0 ~0 ~0 block out of the Positions drawer and drop it on top of each world block.
Read the numbers. ~-1 is one block below your feet — the ground you are standing on. ~0 to ~9 is ten blocks running away from you.
Go into the world, stand anywhere, and type pad.
A platform appears at your feet. Walk fifty blocks and type it again. Another one. Walk anywhere at all and you can drop a platform there.
Step 3 — Know what the numbers mean
Try these one at a time and watch where each lands:
~0 ~0 ~0— the block you are standing on~0 ~5 ~0— five blocks above you~10 ~0 ~0— ten blocks east, level with you~0 ~-1 ~0— one below your feet: the floor
The tilde offsets run along the world's directions, not the way you are facing. Turn around and run it again to prove it: the platform appears in the same place relative to the ground, not swung round behind you.
Step 4 — One material is a box
Here is a hut, all in stone:
Challenge 1
15 minA hut that follows you.
Your hut from Lesson 7 is stuck at one address. Set it free.
- Press
Cand open yourhutcommand from Lesson 7. - Replace every world position in it with a relative one, so the hut builds where you are standing.
- Remember that the ground is one block below your feet — the foundation and the doorway both depend on getting that right.
- Go into the world and type
hut. Then walk at least twenty blocks away and type it again. Then a third time, somewhere else entirely. - Walk into each of the three.
It works if: three huts stand in three different places, you never touched the program between them, and you can walk in through the door of every one at ground level.
Challenge 2
20 minA tower worth looking at.
One material is a box. Use four.
- Press
Cand start a new chat command calledtower. - Build a hollow tower beside you, 6 blocks square and at least 12 blocks tall, using relative positions throughout.
- It must use at least four different materials, and each one must be a band at its own height — not scattered about.
- Put a band of glass somewhere in the middle so daylight gets in, and make sure it is a ring of windows rather than a solid floor of glass.
- Type
tower, then fly up the outside of it and look at the bands.
Work out your Y ranges on paper first. Every layer is a fill, and two layers that share a Y will fight over the same blocks — the later one wins.
It works if: the tower is hollow all the way up, four materials are visible from outside as clear horizontal bands, and you can see daylight through the window band from inside.
Challenge 3
25 minA house you would want to live in.
Everything today, in one build, in one place of your choosing.
- Press
Cand start a new chat command calledhome. - Design and build a house that appears wherever you are standing, with all of these:
- a foundation in one material,
- walls in another, hollow so there is a room inside,
- windows cut or filled so daylight gets in,
- a roof in a third material,
- and a doorway you can walk through at ground level.
- Use relative positions throughout. No world addresses anywhere in the program.
- Build it at least three times in three different places to prove it travels.
- Walk inside and stand in the middle of your own house.
It works if: you can run it anywhere, walk in through the door without flying or jumping, stand up inside without your head in the roof, and see daylight through a window from within.
Extra challenge
spare timeThe striped tower.
Four bands you typed out by hand is fine. Twenty would not be — and you already know the block that fixes that.
- Press
Cand start a new chat command calledstripes. - Build a hollow tower beside you of 8 storeys, each storey 2 blocks tall, using a repeat loop — not eight fill blocks.
- Each lap of the loop fills one storey. The height it builds at has to change every lap, so you will need a variable that grows, exactly as the spiral did in Lesson 5.
- Make the storeys alternate between two materials, so the tower comes out striped. The program has to decide which material each lap, not you.
- Type
stripesand fly up the side of it.
The alternating part is the interesting bit. Something has to be true on laps 1, 3, 5, 7 and false on 2, 4, 6, 8 — and you met the block that chooses between two things in Lesson 6.
It works if: the tower is 16 blocks tall in 8 visible stripes, the colours alternate all the way up with none repeated side by side, and your program contains one fill block, not eight.
Why this one is worth finishing
Look at what is in that loop: a fill from this lesson, a variable that grows from Lesson 5, a repeat from Lesson 3, and an if from Lesson 6 deciding the material.
Four lessons, four blocks, one tower. Nothing in Section 1 so far has needed all of them at once — and from here on, most things will.