public static void Load() { StatTracker.Reset(); string data_string = SaveDataHandler.LoadData(Settings.StatTrackerSavePath); if (data_string != null) { StatTracker.FoodEaten = int.Parse(data_string); } }
public override void onGameEvent(GameEvent game_event) { base.onGameEvent(game_event); if (game_event is FoodEatenEvent) { StatTracker.FoodEaten++; } else if (game_event is SnakeDiedEvent) { StatTracker.Save(); StatTracker.PostFoodStatOnly(); } }
public override void onGameEvent(GameEvent game_event) { base.onGameEvent(game_event); if (game_event is SnakePartDestroyedEvent) { this.CurrentScore++; if (this.CurrentScore > this.HighScore) { this.HighScore = this.CurrentScore; this.IsNewHighscore = true; } } else if (game_event is SnakeDestructionDoneEvent) { if (this.IsNewHighscore) { this.SaveHighscore(); StatTracker.PostStats(true); } } }