← App Builder apps

App Builder apps: recap

For after the lessons: one card per lesson, to check what you remember. Answer each question in your head or on paper first, then check it. Nothing here is marked.

Apps that respond

1. A practice tracker

Try firstA variable called Score goes from 3 to 4 when a button is clicked, but the screen still says 3. What's missing?

Check your answer

A Set text action in the button's event, so the screen shows the new score.

A variable remembers a number for the whole app, such as Minutes.

An event changes it: Save on clicked, add to Minutes.

The screen doesn't change by itself. It shows whatever the last Set text said, so the same event needs a Set text action to show the new total. Words in quote marks are shown as they are; a variable outside the quotes is replaced by its value; & joins the pieces.

Save, then show · Sound on for the voiceover
Open the lesson →

2. A chores checklist

Try firstA mute button app has two events: Mute clicked and Muted = false → set Muted to true; clicked and Muted = true → set Muted to false. What happens when you click, and how do you fix it?

Check your answer

Both run on one click, so it mutes then straight away unmutes. Fix: one click event with a sub-event (Muted = false → mute) and an Else (unmute).

On one click, every event whose conditions are true runs, from top to bottom. Two separate click events both run: the first goes dark and sets Dark to true, the second sees Dark is true and goes straight back.

The fix is one click event with two branches. A sub-event (⋯, Add a sub-event) runs only if its condition is true: Dark is false, so go dark. An Else (⋯, Add an Else below) runs only when that condition was false: go light. Exactly one branch runs per click.

A Toggle with the Tick box look is the same switch, built into App Builder.

One trigger, two branches · Sound on for the voiceover
Open the lesson →

Keep track

3. A water tracker

Try firstWhat goes wrong if you put "add 1 to Glasses" in the Every tick event?

Check your answer

It adds 1 about 60 times a second, so the count shoots up. Every tick is for keeping the display in step, not for changing the count.

Every tick runs about 60 times a second, so an Every tick event that sets the text keeps the screen in step with the variables, whatever changed them.

A condition without a ⚡, such as Variable Glasses = Goal, is checked every tick too, and stays true while the comparison holds.

A sub-event's condition only controls the actions inside the sub-event. An action on the event above it runs whenever that event runs.

Every tick keeps the screen in step · Sound on for the voiceover
Open the lesson →

4. Goal reached: sound and video

Try firstA quiz app checks every tick whether Score = 10 and shows a pop-up. The pop-up keeps flashing. What's happening, and what's the fix?

Check your answer

The Score = 10 event runs every tick while it's true, so the pop-up is shown again and again. Add Trigger once while true so it shows once when Score reaches 10.

A Sound object holds a sound; Play starts it from the beginning.

An event with a condition but no trigger, like Variable Glasses = Goal, is checked every tick. While it's true, its actions run every tick, so Play keeps starting the sound again.

Trigger once while true makes it happen once each time the condition becomes true, then wait until it's false again.

A Video object plays a video file from a link, such as NASA's The Water Cycle.

Open the lesson →

Screens and lists

5. A values journal

Try firstA shopping app has a Cart screen and a Pay screen. The Cart screen sets a variable Total to 25. How can the Pay screen show $25?

Check your answer

Make Total a whole-app variable (in the sidebar); it keeps its value when the app goes to the Pay screen, so the Pay screen can set its text from it.

Each screen has its own objects and events. Go to screen moves between them.

A variable in the sidebar belongs to the whole app, so it keeps its value when the app changes screen. That's how screen 2 knows what you chose on screen 1.

A list variable keeps many entries; Add … to the end of list adds one at the back, and count(Journal) is how many there are. A List object shows a list, one row per entry.

The choice travels with you · Sound on for the voiceover
Open the lesson →

Pictures from the user

6. Draw how you showed it

Try firstYour app keeps a photo when a Take photo button is clicked, then clears the photo for next time. Which should come first, and why?

Check your answer

Keep the photo first (set the variable to Photo.picture), then clear. Actions run top to bottom; clearing first would keep an empty picture.

A Drawing is a space the user draws on while the app runs.

Drawing.picture turns the drawing into a picture the app keeps. A variable can hold it: Set variable LastDrawing to Drawing.picture.

An Image can show it on another screen: Set LastImage picture to the one in LastDrawing.

Actions run in order, so keep the picture before you clear the drawing. One variable holds one drawing: the next one replaces it.

Open the lesson →

7. Show it's done: photos

Try firstA parcel app takes a photo for whichever parcel was tapped last. What does the app need to remember, and where does it check it?

Check your answer

A variable with the tapped parcel (set when it's tapped), checked in the photo event's sub-events so the photo goes with the right parcel.

A Photo object takes a photo with the camera, or the user can Choose a photo. Either way, A photo is taken with Camera runs and Camera.picture is the photo.

The tick and the photo are separate moments, so a variable, ForChore, remembers which chore was ticked.

In the photo event, a sub-event for each chore checks ForChore and shows the photo in that chore's picture.

Open the lesson →

8. Record your practice

Try firstA language app records you saying a word, then plays it back next to the teacher's version. Where does it set up your recording to play, and why there?

Check your answer

In the event that runs when recording finishes, because the recording doesn't exist before then.

A Recorder records up to 20 seconds with the microphone (● to start, ■ to stop), or 🎵 Choose picks a sound file instead.

When the user stops, Mic finishes a recording runs, and Mic.sound is the recording. It doesn't exist before then.

A Sound can play it: Set Playback sound to the one named Mic.sound. Mic.length is how long it was, in seconds.

Open the lesson →

One object

9. Creature stats

Try firstAn app has 10 coins, each a copy of Coin with an object variable value. The player clicks one coin. The event adds Coin.value to Score. Whose value is added?

Check your answer

Only the clicked coin's: the click picked that copy, so Coin.value means its value.

One Image object can have many copies. Object variables belong to the object, but each copy keeps its own values.

A condition such as Creature is clicked picks the copy you clicked. For the rest of that event, Creature.name and the actions on Creature mean that one copy only. That's why one event works for every creature, even a new one.

One event, three creatures · Sound on for the voiceover
Open the lesson →

Tidy up

10. Tidy up the journal

Try firstA quiz app has five answer buttons. Each one's event adds 1 to Score, plays a sound and goes to the next question. How could you tidy it, and how would you know you hadn't broken it?

Check your answer

Make one function, such as Answer(), with those three actions, and have each button call it. Then play the same quiz before and after and check the score, sound and next question are the same.

Refactoring means changing how an app is built without changing what it does.

When several events do almost the same thing, put the same part in a function once. The part that changes becomes a parameter: Pick(value) sets Chosen to value, and each button calls it with its own value, such as Call Pick with value = "Courage".

When the same event is on several screens, write it once on All screens. It runs on every screen that has an object with that name.

Then run the same journey as before. The same result means nothing broke.

Same app, tidier inside · Sound on for the voiceover
Open the lesson →

11. Creature scores

Try firstA canteen app works out price × quantity for every item on an order. What function would you make, what would it give back, and how would you use it?

Check your answer

Total(price, qty) gives back price * qty. Each item's line uses Total(item price, item quantity) in a value box, and the order total adds them up.

Some functions give back a value, like a calculator button. Inside, Set return value to is the answer it hands back.

You use it in a value box: BarWidth(Creature.power) asks BarWidth for a width, with Creature.power as its stat.

With several parameters, the call fills them in order: Overall(Creature.power, Creature.speed, Creature.defence).

Working something out into a variable isn't giving it back: only Set return value hands the answer to the place that asked.

Ask a function for a value · Sound on for the voiceover
Open the lesson →

Final challenge: your own app

12. Challenge: your own app

Try firstWhat did your user do that you didn't expect, and what did you change because of it?

Check your answer

Any specific answer tied to what they watched, not a general opinion.

A prototype is an early version you can click through and test with someone, before building the real thing.

The design loop: plan (who, screens, flow, variables, events), build in small steps and try it often, test by watching a real user without helping, then improve one thing based on what you saw.

Open the lesson →