Little help and advice required regarding variable management?

0 favourites
  • 5 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hi everyone,

    My game has lots and lots of global variables because my game is collection of many games.

    So the issue goes like this:- When a game is played,some variables will change value,like "score" which was earlier 0 and later on it will be something else. But if the game is replayed,then definitely I will have to reset the variables to original values,like "score" back to 0

    So the issue is, how to approach this problem. If I use "Reset Global variables",yeah it will run fine but there will be some variables somewhere else which will also get reset.And it should not happen

    So currently my approach is:-

    "On start of layout"->> "put this variable equal to ...."(same thing for other variables too). But problem is,I have many games inside the project and it will be tedious for me to do that

    So friends,what is your opinion regarding this? I wish there was some option like "reset variables which are on this event sheet" something like that.

    Thanks in advance

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There are many data storage options you can use, including instance variables, local variables, arrays, dictionaries, and local storage, among others. They can be manipulated independently of each other. Don't just use global variables for everything.

  • You can put a dictionary in a dictionary. Just saying.

  • There are many data storage options you can use, including instance variables, local variables, arrays, dictionaries, and local storage, among others. They can be manipulated independently of each other. Don't just use global variables for everything.

    Thanks for the answer

  • You can put a dictionary in a dictionary. Just saying.

    Thanks

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