Global Variables?

Get help using Construct 2

Post » Fri May 03, 2013 4:14 am

hi there, right, I'm just going to state some information that I believe to be correct, if I'm wrong, PLEASE correct me as im rather stuck :(

Im making a quiz game, So i think that my event sheet needs to look something like this:

-Global Variable=0

-Question 1 group
    -System - Compare Variable to 0
    -Set Button Text info
    -Answer Button 1 - On click - +1 to global variable + Set text - Correct
    -Answer Button 1 - On click - +0 to global variable + Set text - "Nope, Try again!"
    -Answer Button 1 - On click - +0 to global variable + Set text - "Nope, Try again!"
    -Score Count code

-Question 2 group
    -System - Compare Variable to 1
    -Set Button Text info
    -Answer Button 1 - On click - +1 to global variable + Set text - Correct
    -Answer Button 1 - On click - +0 to global variable + Set text - "Nope, Try again!"
    -Answer Button 1 - On click - +0 to global variable + Set text - "Nope, Try again!"
    -Score Count code


and so on...

So in order for me(Or the user) to access the next group of questions I'll have to set the correct answer button to add +1 to the global variable, so then the global variable's total would be 1 and no longer 0, so the questions from the second group would show and the others would not?.... I think..

I feel like I'm missing something here, because when I try this with my project, I cant get it to work, buttons have a delay, text wont change ect.... :( Any answers are heavily appreciated!

- CURRENT DRAFT - Project for viewing pleasure -
https://www.dropbox.com/l/b7vVDgsW988ExW4BJfuYI8
   
B
6
Posts: 14
Reputation: 514

Post » Fri May 03, 2013 4:40 am

https://dl.dropboxusercontent.com/u/3954039/ZZZ%20TEST.rar

Set the events of each question as a sub-event. Also use the "trigger once while true" action for events that don't need to happen every frame, such as changing the text on the buttons
B
83
S
21
G
15
Posts: 1,039
Reputation: 15,134

Post » Fri May 03, 2013 5:20 am

Thankyou!!!!!!!!!!!!!!

7Soul you've cured my problem, explained it to me and given me an example so I know exactly how it works! - Perfect!
B
6
Posts: 14
Reputation: 514


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, jul, nicklowkcmagic and 18 guests