Table of Contents

QR Code Scanner in a Task

A level can carry a button that turns on the phone camera and submits the scanned QR code as an ordinary answer. Handy when the codes on location are printed as QR: the player does not have to retype a long string by hand.

Do not confuse this with Printing QR Codes for One-off Teams — that is about handout QR codes for entering the game, while this is about scanning codes inside a level.

How to Enable It

Just call qrReaderInit() in the “Level script” field. The engine loads the scanner library only when it finds that name in the script.

qrReaderInit();

A QR Code button appears next to the “Answer” button. Pressing it opens the camera window (the browser asks for permission), pressing it again closes it.

What Happens When Scanning

The recognised text is submitted as an answer — exactly as if the player had typed it into the input field and pressed “Answer”. No separate setup is needed: the QR code carries the same text you have entered in the level codes.

The same code is not resubmitted twice in a row, so the camera can be left open — it will not fire the same answer dozens of times per second.

Worth Remembering

Example in game