I have a small game with a timer, when a new match is started the timer must reset, but actually the new timer and the old overlap alternating. I don't understand why.
When a new game start this method it's called:
private void setGame()
{
game = new Game();
game.gameData.stopWatch = new StopWatch(timerLabel);
game.gameData.scoreLabel = scoreLabel;
}
public StopWatch(Label timerLabel)
{
this.timerLabel = timerLabel;
_timer = new Timer();
_timer.Interval = 1000;
_timer.Tick += new EventHandler(_timer_Tick);
}
And then _timer_Tick
it's called one time with the startData
of actual match and another time with the startData
of the old match. Why?