Forum Academy Marketplace Showcase Pricing Features

QR Code Validation

Hello,

I have an intermediate level on Bubble.

I am developing a game as a mobile web app.
The goal of this game is to find a maximum of QR codes hidden in a city. I plan to hide 75 of them.

:warning: For information the QR Codes will all be identical ! :warning:

I have created a database with the address of the QR Code location. Their location is visible on a map by the players.
When the player finds the QR Code, he has to scan it with a scanner (plugin : QR Code Scanner). This will change the status of the QR Code to scanned = “yes”.

To validate them, I was advised to use the function of range according to a geographical perimeter according to the position of the player. Unfortunately, I can’t formulate this in the workflows.

Do you think you can help me? Or do you have other ideas or suggestions?

Thanks in advance

Are the 75 QR-codes around town all the same or are they unique?
If they are different, I don’t think you really need the geolocation (unless you think ppl will somehow try and cheat the game).
Just check for the unique QR code and you will know which one was scanned.

1 Like

Thank you very much for your response. We use 75 QR Identical Codes. That is my problem. And I can’t formulate my workflow correctly And I can’t properly formulate my workflow.

One way to go would be to have unique QR-codes. That takes away the need for geolocation.

Otherwise I think you can use “Current geographic location” and compare that to the location of the QR code in the DB. Works the same with latitude/longitude.
As long as you can figure that calculation out (it would be a vector from your position to the QR-code)
Unless there’s a more automatic way of doing it (I’m sure there is) you could use pythagoras theorem:
distance = sqroot(square(x) +square(y))
Where X and Y are the lat and long distances between the points you are comparing.

Then you check if that distance is lower than whatever threshold distance you want it to be in your “Only when” for the setting of “scanned = yes”

1 Like

Thank you for your reply.
It is very clear. I will try it today. I will keep you informed. Thanks again.