Create a Q&A game
This tutorial shows how to build an interactive question-and-answer game where QTrobot waits for a response and follows different paths depending on the choice you make. You will use the Select Block and the Pause Block.
Prerequisites
Your first game — you know how to create a game, add blocks, and run it.
Key blocks
Select Block
The Select Block (in the Blocks category) pauses the game and presents the operator with a set of labeled buttons. The operator watches the learner and presses the button that matches what happened — for example, "Learner gives a correct answer" — and the game follows that path.
Each path can contain its own sequence of blocks: a different response from QTrobot, another question, or even a nested Select Block for retrying.
Pause Block
The Pause Block halts the game until the operator presses continue. Use it to give the operator time to assist the learner or prepare for the next step before QTrobot continues speaking.
Example: a name Q&A
The example below asks the learner their name. The operator selects whether the learner answered correctly. If not, QTrobot tries once more before asking for assistance:
How to build it
- Start with a LuxAI Start Block.
- Add Show Says Act blocks for the greeting and the question.
- After the question block, drag a Select Block from the Blocks category and drop it below.
- Fill in a label for each path (e.g. "Learner gives a correct answer", "Learner gives wrong or no answer").
- Connect response blocks inside each path slot.
- For a retry path, add another Select Block nested inside, and use a Pause Block before the final fallback response to give the operator time to step in.
- Save and run. When the game reaches a Select Block, it pauses and displays the path labels as buttons; click the appropriate one to continue.
Next steps
Continue with Games with images to learn how to show visual content to the learner.