I have created a jumping game where you collect gold coins and given a score per coin you pick up.
I was wondering if it would be possible to add a question every x amount of gold coins picked up for example.
If I picked up 10 gold coins I would like a maths question to show up such as what is 13+18 and the correct answer lets you continue the game and the incorrect answer will cause the game to end
Develop games in your browser. Powerful, performant & highly capable.
You should need an event wrapped around a coin counter variable.
Compare #Coins >=10
Show the UI with the math question.
Check the answer
If Answer is wrong Goto Layout EndGame
If the Answer is right remove the question UI.
It would be easier to use another layout, but it depends if you game needs to continue or go somewhere else.
With the above, you need to control when to display the math question otherwise as soon as you continue it will show the question again (since #Coins is still > 10)