How do I return a value to a sprite instance variable?

0 favourites
  • 3 posts
From the Asset Store
Game "Little Dino Adventure Returns" with complete Source-Code (Construct3 / .c3p) + HTML5 Exported.
  • Hi everyone.

    I'm making a quiz game and I'm stuck in this problem.

    I have a sprite that works as a button with instances variable that sets the level of the game, the number of questions and the percentage of rigth answers. (level, questions and percentage are their names).

    I use this "button" to call every level, changing the level instance variable.

    So, sending values to a stage is easy.

    The problem is when i have to do the reverse way.

    The game stage has a Global Variable tha counts how many right answers the player get.

    What I trying to do is: When the game returns to the select stage, the button that called the game stage, receive back the Global variable with the number of right answers.

    How do I pick the correct sprite to set the variable?

    Thanks in advance.

  • Have another global variable for current stage that is set when you go into it. When you return to level select, use a condition to pick the sprite based on current stage (it should match) and use that to set the sprite object's other variables.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Have another global variable for current stage that is set when you go into it. When you return to level select, use a condition to pick the sprite based on current stage (it should match) and use that to set the sprite object's other variables.

    Thank you lions_, it worked.

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