public static void failLevel() { LevelStats levelStats = stats.getLevelStates(levelName); levelStats.timesFailed++; resetLevel(); }
public LevelStats getLevelStates(string levelName) { if (!allLevelStats.ContainsKey(levelName)) { allLevelStats[levelName] = new LevelStats(); } return(allLevelStats[levelName]); }
public static void finishLevel() { LevelStats levelStats = stats.getLevelStates(levelName); levelStats.timesCompleted++; levelStats.bestTime = Math.Min(attemptTime, levelStats.bestTime); // TODO: UI nextLevel(); }
public override void render(SpriteBatch spriteBatch) { base.render(spriteBatch); LevelStats levelStats = Runner.stats.getLevelStates(Runner.levelName); Vector2 tl = pos - dimen / 2; spriteBatch.DrawString(font, "High Score: " + levelStats.bestTimeStr(), tl + new Vector2(20, 20), textColor); spriteBatch.DrawString(font, "Times Completed: " + levelStats.timesCompleted, tl + new Vector2(20, 70), textColor); spriteBatch.DrawString(font, "Times Failed: " + levelStats.timesFailed, tl + new Vector2(20, 120), textColor); }