Problem with global variables?!

  • Hi everyone,

    So I'm having a frustrating time making a working 'mute music' button.

    At the moment the user presses a button and a global variable gets changed, which then mutes the music on the start-up of other layouts.

    Unfortunately because I am also loading the game on other layouts, the load over-writes the global variable for the muted music and hey presto, the music is back playing.

    a) Am I using the load feature wrong?

    b) Can I exclude the mute music global variable from being overwritten on load?

    c) Anyone got any other suggestions?

    Thanks in advance

  • You can save the global variable via the WebStorage component and reload it when you reload the game

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can save the global variable via the WebStorage component and reload it when you reload the game

    Hi Roberto,

    Can I still use web storage even though my game will be deployed to mobiles?

    I just made a quick test and it works perfectly in the browser but not on the mobile device.

    Thanks!

  • It should work on mobile as well: I never had any issue with saving data, like scores for example, on a mobile device by using the webstorage component...

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