← All templates
Quiz
BeginnerTemplateWeb & desktopMobile friendly

Quiz

Game · Puzzle

Three questions, one screen each. The right answer cheers and moves you on; a wrong one buzzes and asks you to try again. No code: every answer is a button with a couple of actions.

by Arcadia Studio
Read the guide ↓

Quiz

A quick three-question quiz. Each question has its own screen with three answers:

  • Pick the right one: a happy sound plays and the next question opens.
  • Pick a wrong one: a buzz plays and Not quite. Try again! appears.
  • Answer all three: you reach the Well done! screen.

There's no code in this project. Every answer is a button with two actions. You decide what happens by choosing which actions each button gets.

A question

What you'll learn

  • Planning a game as a chain of screens.
  • Giving different buttons different actions: the same click, very different results.
  • Showing a hidden control with the set_visible action.
  • Making sound effects for right and wrong answers.

Glossary

WordWhat it means
ScreenOne page of your game. Here: the title, one screen per question, and the end.
EventSomething that happens to a control. Every answer uses click.
ActionSomething that happens because of an event: play_sound, open_ui (open a screen) or set_visible (show or hide a control).
TargetFor some actions, the control they change. For set_visible, the label to show.
ValueWhat the action does to its target. For set_visible, true (show) or false (hide). For open_ui, the screen to open.
VisibleA tickbox in a control's Properties. Untick it and the control starts hidden.

Rebuild it from scratch

1. Plan the screens

Before you click anything, write the chain down:

title → q1 → q2 → q3 → done

Each question screen only needs to know one thing: which screen comes next.

2. The project and its sounds

  1. File → New project, named Quiz with the Id quiz. In Project → Project settings…, set Made for to Web & desktop only.
  2. Open Project → Sound effect maker… and make three sounds. Name each one and click Save:
    • right with Power-up
    • wrong with Hurt
    • click with Blip

3. The screens

  1. Make five screens, all 320 × 180: title (tick Main screen), q1, q2, q3 and done.
  2. Give each one a dark background Panel that fills it.
TitleWell done!
TitleWell done!
  • On title: a big label, a hint, and a Start button. Its click gets play_sound (quiz:click) and open_ui (q1).
  • On done: Well done!, a Play again button (open_ui q1) and a Menu button (open_ui title).

4. A question screen

On q1, add:

  1. A small label at the top: Question 1 of 3.
  2. A bigger label, question: Which planet is called the Red Planet?
  3. Three buttons, answer1, answer2 and answer3: Venus, Mars and Jupiter.
  4. A label called try_again at the bottom: Not quite. Try again!, in red. In Properties, under Behavior, untick Visible so it starts hidden.

5. The answers' actions

Select each answer button, open the Events tab, pick click, and use + Add action.

The right answer (Mars) gets:

TypeTargetValue
play_soundquiz:right
open_uiq2

Each wrong answer (Venus, Jupiter) gets:

TypeTargetValue
play_soundquiz:wrong
set_visibletry_againtrue

A wrong answer shows the hidden label

6. The other questions

  1. Duplicate the idea for q2 and q3. Copy the controls from q1 (Ctrl+C), switch screens, and paste (Ctrl+V).
  2. Change the texts, and move the right answer around so it isn't always the same button:
    • q2: What do bees make? Honey (right), Milk, Silk. The right answer opens q3.
    • q3: How many legs does a spider have? Six, Ten, Eight (right). The right answer opens done.

7. Play it

Press Preview (F5). Try a wrong answer first, then the right one.

How it works

  • The screens are the game. There's no score to keep. Being on screen q2 means you got question 1 right.
  • Same event, different actions. All nine answer buttons use click. Only their actions differ, and that's what makes one right and the others wrong.
  • A hidden control waits its turn. try_again is on the screen all along, just not visible. set_visible shows it. When you move to the next question, that screen's own try_again starts hidden again.

Make it yours

  • Ask your own questions, and add more: one more screen per question, and point the previous question's right answer at it.
  • Give the wrong answers different messages, each its own hidden label.
  • Add a picture question: put an Image above the answers.
  • Want a score out of 3? You'd need to count right answers across screens. For now, keep every question on one screen and use a script like the one in Star clicker.