Glad to know you liked it!
Logic works like this:
- There is a list of questions
- When pressing the button, 1 question is taken randomly from the list.
- The question has a reference to its answer.
- On every iteration, there is a temporary list of answer options.
- The answer options include a mix of 1 right option and 3 random wrong options.
- If you press the right option, you get a point, if you press the wrong option, you lose 2 points.
There are probably much better ways of doing it of course (it is my first time making a quiz game XD)
There are a bunch of things that are possible to do to make the game harder/better (like having more than one right answer per question and choice randomly in every repetition).