hey guys, the Global Counter works however I have an issue, coins collected on gameplay go back to zero after each game over. how do I get Global Counter to also reset? because it currently continues from the last session despite the point score label showing zero at start of game. thanks in advance
this is the Global Counter Node, what to change here to get this counter to reset on game over? function init(){ this.emitSignal('Trigger', false); } function update(dt){ } function signal(name, value){ if(value){ let id = this.attribute('Identification'); if(Settings[id] === undefined){ Settings[id] = 0; } log(Settings[id]); Settings[id] += 1; if(Settings[id] >= this.attribute('Target')){ Settings[id] = 0; this.emitSignal('Trigger', true); } } }
Hey! I looked at the link but all of your responses on the forum post were shown as a "." (full stop/period). Would you be able to help me reset my global counter? Many thanks!