Web AR QR code hide and seek game

Hi all.

I’m making a hide and seek game where the user runs around an area and scans six QR codes (they can be the same QR code image but repeated six times in different places) to “collect” coins.

There isn’t too much information on using QR codes rather than Zap codes (or please point me in the right direction if I’ve missed it!) so I’m trying to work out how to script this?

I wanted to base it on the Archery Game Series tutorial where we can use the Score subsymbol to count and amend it from there, but how can I tell it what it’s counting are QR codes or how many times a QR code has been scanned?:

//Adds score value to existing score
score += scoreIncrement;

//If the score is equal to the end score set in parent, emit custom event to be used in parent
if(score == endScore){
//Emits custom event to be used in parent script
symbol.emit(“custom:end”);

Thank you in advance!

I have thought about doing something like this.

Think of the QR code as just another way of getting to the zap just like a zapcode.

Now if you are thinking of using it to start an experience and then in that experience as a counter that won’t work. But you can use the same QR code in 6 places and have them scanned and use the same app but your going to need to use the [Storing Persistent Data] (https://docs.zap.works/studio/scripting/examples/storing-persistent-data/) Store and Retrieve.

You will need to check and see if any data was saved (your count so far) when first scanned. Then add to your count. Store your new number on the device. Next have say a button that has (Scan) on it which will start the app/webar to look for a new QR code. After you get to your max count do your you win.

Steve

Thank you as always for your quick reply, Steve! I will investigate what you’ve suggested!

1 Like