Changing the Order of Simultaneous Rules

mercyparkmercypark Member Posts: 20
edited November -1 in Working with GS (Mac)
Ok. Here is my predicament. I have created a scene where questions are spawned on the screen and four multiple choice buttons have been created to answer the question. I have created a rule where the background spawns random questions and when the correct multiple choice button is pressed the next question is spawned. Now I can't figure out how to create a rule that lets the game know when I click a wrong answer.

I have created an attribute called correct answers and have a series of 16 random questions. I have separated the 16 questions in 4 categories and and created an attribute called Categories. The game knows that when a category 1 question is spawned that the corresponding answer button has to be touched before spawning the next question and adding a +1 integer to my correct answers attribute. All that works wonderfully when I click the correct answer. So when a question is asked and the incorrect button is pressed, then the question remains and it will not spawn the next question until the correct category button is pressed. Here is the problem.

I am trying to create an attribute called incorrect answers. I have tried creating a rule inside my category 1 button that says when I click on the button and the attribute categories is NOT equal to 1 than change the incorrect answers attribute to +1. So it adds +1 to my incorrect answer attribute when I click the wrong answer but it also adds +1 when I click the correct answer and it spawns to a category that is different than the previous correctly answered question.

So Im thinking that the rule that tells the game to spawn a new question is running at the same time the game is looking to see if I clicked the wrong answer. If i could tell the game to spawn first.... then maybe it would work correctly.

I hope this makes scents. I tried to explain it the best way I could. What should I do?

Comments

  • mercyparkmercypark Member Posts: 20
    That is what I did. But when I wanted to keep track of how many wrong answers i got so I created an Attribute called Incorrect answers. Then created a rule

    if game.answer /= 1
    then game.incorrect answer to +1

    it works but when I answer a question correctly and it spawns another question it is adding a +1 to the incorrect answer attribute when spawning.
Sign In or Register to comment.