← Construct apps

Construct 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 global 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 light switch app has two events: On clicked and light is off → turn on; On clicked and light is on → turn off. What happens when you click, and how do you fix it?

Check your answer

Both run on one click, so it turns on then straight off. Fix: one On clicked event with a sub-event (light is off → turn on) and an Else (turn off).

On one click, every event whose conditions are true runs, from top to bottom. Two separate On clicked events both run: the first ticks the box, the second sees the tick and takes it away.

The fix is one On clicked event with two branches. A sub-event (press S) runs only if its condition is true: the box shows ⬜, so tick it. An Else (press X) runs only when that condition was false: untick it. Exactly one branch runs per click.

One click, one branch · 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 green arrow, such as Compare variable, 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 it in step · Sound on for the voiceover
Open the lesson →

Screens and lists

4. 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 global variable; it keeps its value when the app goes to the Pay layout, so the Pay screen can set its text from it.

Each screen is a layout with its own event sheet. Go to layout moves between them.

A global variable 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.

An Array keeps a list of entries; Push adds one at the back, and Width is how many there are. To show them, clear the List once, then Repeat Width times, adding At(loopindex) each time: loopindex counts 0, 1, 2 …

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

One object

5. Creature stats

Try firstA game has 10 coins, each a copy of Coin with an instance variable value. The player touches one coin. The event adds Coin.value to Score. Whose value is added?

Check your answer

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

One sprite is an object type; each copy on the layout is an instance. Instance variables belong to the type, but each instance keeps its own values.

A condition such as Mouse, On object clicked picks the instance 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.

Clicking picks one copy · Sound on for the voiceover
Open the lesson →

Final challenge: your own app

6. 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 preview often, test by watching a real user without helping, then improve one thing based on what you saw.

Open the lesson →