(I have no idea how to say this) [SOLVED]

  • Okay. So in my game when you get a correct answer it adds to the correct variable. and another event will do

    CONDITION

    Correct = 1

    ACTION:

    Show seed (sprite)

    And the same with 2 correct answers in a row

    CONDITION

    Corrrect= 2

    ACTION:

    Show Sapling (sprite)

    And if it is Wrong then

    Condition:

    Add 1 to Wrong

    ACTION:

    Show Wrong (sprite)

    Sub Event

    Trigger once

    Action:

    Subtract 1 from correct.

    Got me so far? Here is where it gets confusing.

    If I get correct and then 1 wrong, It'll show the Wrong (sprite) but also show the Seed because even though it got 1 wrong the variable becomes 1. After all, it subtracted but the value is still more than 1. And my event shows that when Correct = 1 shows seed. So yeah. I know its confusing and I'll show my coding so I hope it helps. If you can, It'll help a ton. Thanks!

    I didn't get to fit all the coding in 1 pic so it's the continuation

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hello , first of all check the 1st picture at event 4 maybe you insert the event as sub event.

    Second , if you did not care about the variable "Wrong" after turn to 1 or higher you can remove "trigger once" and move the "Subtract 1 from correct" at top of the "turn Wrong to 0".

    And third , why so many layouts? You have different pictures in each layout? Or is just different question?

  • Hello, first of all, check the 1st picture at event 4 maybe you insert the event as sub-event.

    Second, if you did not care about the variable "Wrong" after a turn to 1 or higher you can remove "trigger once" and move the "Subtract 1 from correct" at top of the "turn Wrong to 0".

    And third, why so many layouts? Do you have different pictures in each layout? Or is it just a different question?

    Thank you. It is a different question.

  • You can save save all the questions in a string variable here is an example of a variable with 3 questions "1+1 ; 2+2 ; 3+3" after that when you start your game you can set what question to show like: set text -> tokenat(variable,0,";") this will show the question 1 etc.

    Also you can kinda fix your code , lets say you check if Wrong >= 1 Wrongco set invincible , you do it too much times , but you only need to add it in one event.

    Also you have the if Wrong => 1 and if seed is visible / if Wrong => 1 and if seed2 is visible / seed3 , seed4.

    You can add as event the if wrong => 1 and the other as subevents.

  • You can save all the questions in a string variable here is an example of a variable with 3 questions "1+1; 2+2; 3+3" after that when you start your game you can set what question to show like: set text -> tokenat(variable,0,";") this will show the question 1, etc.

    Also you can kinda fix your code, let's say you check if Wrong >= 1 Wrongco set invisible, you do it too many times, but you only need to add it in one event. invisible

    Also you have the if Wrong => 1 and if seed is visible / if Wrong => 1 and if seed2 is visible / seed3 , seed4.

    You can add as event the if wrong => 1 and the other as subevents.

    I don't understand. Can you do it in code format?

  • Here is an example of how you can store all your questions , answers and incorrects in variables and retrieve it when game starts.

    3 questions , 1 correct answer for each question and 3 incorrect answers.

    At start we set the correct answer to a random text so no everytime is at same place.

    And we choose and a false answer also.

    dropbox.com/s/luramtt23h81u5b/Q%26A.c3p

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)