I am making a solitaire game and the problem is that when the user undo, the timer will also go back to last save value & the value of the timer is global variable.
Please Help..
Develop games in your browser. Powerful, performant & highly capable.
I know someone suggested to use save and load but probably that isn't the way to do it if you have a timer. You should store your values or moves whatever somewhere and then when you undo it reverts to these values, not using save/load.
Not sure, but adding the "no save" behaviour to the object the timer belongs to might work.
construct.net/en/make-games/manuals/construct-3/behavior-reference/no-save
Otherwise, store everything in global variable, or, if you need data to persist between restarts, you'll need to write each value out to local storage individually. If you have many parameters, storing them in a dictionary first then writing that out to local storage simplifies things.