How do I?

0 favourites
  • 9 posts
  • HI!

    I have three layouts in the game where one is introductory, and the other two are separate minigames (you can start whatever you want first)

    at the two mini games I put two variables for two different scores; when you are in the first layout, the introductory one, the summed score of the minigames should appear.

    I tried to create a variable that has the sum of the two variables of the two layouts but it doesn't work; I created a global variable that I also inserted in the two minigames invisibly (visible only in the introductory layout) but that doesn't work either.

    how can I do?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There could be many reasons it's not working. I would start by checking the global variables in debug preview and verify they are as expected.

  • I made an instance variable to the text.

    then in the event sheet at layout startup i set the text to the instance variable which i made global

  • I made an instance variable to the text.

    then in the event sheet at layout startup i set the text to the instance variable which i made global

    Why?

  • so as to have in the rest of the layouts the invisible variable which adds the same values of the single score of each layout and then the total score should appear on the main one

  • You should only be using global variables, one for each layout. In the introductory layout you can set text to globalvar1+globalvar2 from the other layouts.

  • but from the system what setting should I put to make me "exit" globalvar1+globalvar2? to what action? because I already tried to put it but it doesn't work

  • Exit meaning ? Global variables retain their value between layouts they are useful for what you're describing, setting scores.

  • it doesn't work by adding the two globals to the initial one. is there another way to accomplish this?

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