Skip to content
ExploreMapGamesStoriesComicsVideosStudioPrintablesCode LabJourneys
By age โ–พ
  • ๐Ÿงธ Tiny Explorers2โ€“5
  • ๐Ÿฆ‰ Curious Learners6โ€“8
  • ๐Ÿ”ญ Young Investigators9โ€“12
  • ๐Ÿš€ Trailblazers13โ€“17
๐Ÿ‘คParent sign in
Kids Amazing World

A creative learning playground. No ads, no tracking, no chat. Every item is reviewed before it appears.

Explore

  • Explore
  • Learning journeys
  • Surprise me
  • Parent planner

For grown-ups

  • Child safety
  • Privacy
  • Terms (draft)
  • Free & Premium
  • Parent sign in

About this content

Some items in this build are placeholders written for development. Third-party resources are only listed with permission, a license, or an official embed.

โ† All game tutorials

โ“ Quiz Show

Write your own questions and rules.

How to playYour functionsSettings you can changeStep by stepIdeas to tryLessons

๐ŸŽฎ How to play

Answer enough questions correctly to reach the goal before you run out of lives.

  • Click or tap an answer: Choose that answer.

โš™๏ธ Your functions

You write these functions. The game calls them when something happens.

  • onCorrect()

    Runs after a right answer.

    function onCorrect() {
      score = score + 1;
    }
  • onWrong()

    Runs after a wrong answer.

    function onWrong() {
      lives = lives - 1;
    }

๐ŸŽš๏ธ Settings you can change

Variables at the top of your code are the game's settings. Change a value, press Play, and see what happens.

questions = your list of questions
Your list of questions. Each one is { q: "โ€ฆ", options: ["โ€ฆ", "โ€ฆ"], answer: 0 }. answer counts from 0, so the first option is 0. optional
goal = 2
Correct answers (points) needed to win.
lives = 3
Wrong answers you are allowed.
score = 0
Your points. The game starts it at 0 and you change it in your functions. set by the game

๐Ÿชœ Step by step

Each step shows code you can add to the end of your game's code. A function or variable written later replaces the earlier one, so you never have to delete anything.

  1. 1Read a question

    Each question is an object with three parts: q (the question), options (2 to 4 choices) and answer (the number of the right choice, counting from 0).

    let questions = [
      { q: "What is 2 + 2?", options: ["3", "4", "5"], answer: 1 },
      { q: "Which animal says moo?", options: ["Cow", "Duck"], answer: 0 },
    ];
  2. 2Set the rules

    Make each right answer worth 4 points and the goal 20. Rules are just numbers you choose.

    let goal = 20;
    
    function onCorrect() {
      score = score + 4;
    }
  3. 3Wrong answers cost points

    Lives are not the only way to be punished. Here a wrong answer takes 3 points off instead, and Math.max stops the score going below 0.

    function onWrong() {
      score = Math.max(0, score - 3);
    }
Show the full starter code
// โ“ My Quiz Show
let goal = 2;          // correct answers needed to win
let lives = 3;

// Each question has: q (the question), options (2 to 4 choices),
// and answer (which choice is right, counting from 0).
let questions = [
  { q: "What is 2 + 2?", options: ["3", "4", "5"], answer: 1 },
  { q: "Which animal says moo?", options: ["Cow", "Duck"], answer: 0 },
  { q: "How many legs does a spider have?", options: ["6", "8", "10"], answer: 1 },
];

function onCorrect() {
  score = score + 1;
}

function onWrong() {
  lives = lives - 1;
}

๐Ÿ’ก Ideas to try

  • A quiz about your favourite game, animal, planet or football team.
  • Make wrong answers cost 5 points instead of a life.
  • Write 10 questions and make the goal 60.

Tips

  • The most common mistake is a missing comma between questions. Check the line number in the error.
  • Put the right answer in different positions so players can't guess the pattern.

๐ŸŽ“ Lessons for this game

  • ๐Ÿ”’Write a quizPremium
  • ๐Ÿ”’Quiz scoringPremium
  • ๐Ÿ”’Boss level: Quiz ShowPremium

๐Ÿ› ๏ธ Make your own Quiz Show game

Game Studio and the full lessons are part of Premium.

See Premium
โ† ๐Ÿ”จ Whack-a-Mole๐Ÿ Snake โ†’