/// <summary> /// Draws the high scores to the screen. /// </summary> public static void DrawHighScores() { const int SCORES_HEADING = 40; const int SCORES_TOP = 80; const int SCORE_GAP = 30; if (_Scores.Count == 0) { LoadScores(); } SwinGame.DrawText(" High Scores ", Color.White, GameResources.GameFont("Courier"), SCORES_LEFT, SCORES_HEADING); // For all of the scores int i; var loopTo = _Scores.Count - 1; for (i = 0; i <= loopTo; i++) { Score s; s = _Scores[i]; // for scores 1 - 9 use 01 - 09 if (i < 9) { SwinGame.DrawText(" " + (i + 1) + ": " + s.Name + " " + s.Value, Color.White, GameResources.GameFont("Courier"), SCORES_LEFT, SCORES_TOP + i * SCORE_GAP); } else { SwinGame.DrawText(i + 1 + ": " + s.Name + " " + s.Value, Color.White, GameResources.GameFont("Courier"), SCORES_LEFT, SCORES_TOP + i * SCORE_GAP); } } }
/// <summary> /// Draws the game during the attack phase. /// </summary>s public static void DrawDiscovery() { const int SCORES_LEFT = 172; const int SHOTS_TOP = 157; const int HITS_TOP = 206; const int SPLASH_TOP = 256; const int TIMER_LEFT = 350; const int TIMER_TOP = 87; if ((SwinGame.KeyDown(KeyCode.LeftShiftKey) | SwinGame.KeyDown(KeyCode.RightShiftKey)) & SwinGame.KeyDown(KeyCode.CKey)) { UtilityFunctions.DrawField(GameController.HumanPlayer.EnemyGrid, GameController.ComputerPlayer, true); } else { UtilityFunctions.DrawField(GameController.HumanPlayer.EnemyGrid, GameController.ComputerPlayer, false); } UtilityFunctions.DrawSmallField(GameController.HumanPlayer.PlayerGrid, GameController.HumanPlayer); UtilityFunctions.DrawMessage(); SwinGame.DrawText(GameController.HumanPlayer.Shots.ToString(), Color.White, GameResources.GameFont("Menu"), SCORES_LEFT, SHOTS_TOP); SwinGame.DrawText(GameController.HumanPlayer.Hits.ToString(), Color.White, GameResources.GameFont("Menu"), SCORES_LEFT, HITS_TOP); SwinGame.DrawText(GameController.HumanPlayer.Missed.ToString(), Color.White, GameResources.GameFont("Menu"), SCORES_LEFT, SPLASH_TOP); SwinGame.DrawText("TIME LEFT: " + GameController.TimeRemaining(), Color.White, GameResources.GameFont("Menu"), TIMER_LEFT, TIMER_TOP); }