Hello, so it’s the first game I make with a development program and I found it nice how I was able to create a randomiser of my array of questions so fast!
I created only 1 scene in which the text changes randomly and never repeats once the specific question has appeared
Next thing I need to understand is how do I link these randomised questions to their respective correct true/false answer? Because I won’t always have the correct answer as true, but of course it’ll change depending on the question! And then as an action to the correct answer I’ll add a +1 to the score, and the false answer will just change question. The answers are just buttons (made from sprite) so no need of a text input from the user.
Have a second array that holds all the answers, with the order the same as their questions. When you remove from the question array, also remove from the answer array
Instead of having the question as the array element, make it a structure. Make one structure element the question, the other the answer :
For the second way (one I prefer, as you’ve got the question and answer together and so easier to maintain), you can set it up like :
But now I do have a doubt now, how do I click on the answers? And therefore add a +1 on a score system that I want to implement after clicking on the correct answer?
It is multichoice, the player just needs to click on the right answer. In my current progress, even if I just hover over the correct answer I just print inifite 1s on the score text, while if i hover over the wrong asnwer it just says incorrect. What I want is to just add a +1 to the number shown on the score every time the user clicks on the right answer.
It works wonderfully thanks. One last question : once I finished the quiz’s questions, how do I make it change the scene to, for example, a scene that tells you how much you scored?
I don’t think this is the right path, but what I’m basically trying to do is that once the random questions in my array have all been shown to the player (as in the timer of all questions has expired or the player has answered all the questions), I want to change scene.