diff --git a/src/Client/ClientMain.cs b/src/Client/ClientMain.cs index 855f25c..e930fe3 100644 --- a/src/Client/ClientMain.cs +++ b/src/Client/ClientMain.cs @@ -46,10 +46,10 @@ public ClientMain() protected override void Initialize() { // For Graders: You can change the resolution here - m_graphics.PreferredBackBufferWidth = 1920; - m_graphics.PreferredBackBufferHeight = 1080; - // m_graphics.PreferredBackBufferWidth = 1000; - // m_graphics.PreferredBackBufferHeight = 750; + // m_graphics.PreferredBackBufferWidth = 1920; + // m_graphics.PreferredBackBufferHeight = 1080; + m_graphics.PreferredBackBufferWidth = 1920/2; + m_graphics.PreferredBackBufferHeight = 1080/2; m_graphics.ApplyChanges(); // Load the controls diff --git a/src/Client/Menu/HowToPlay.cs b/src/Client/Menu/HowToPlay.cs index fafbd8d..1a8b266 100644 --- a/src/Client/Menu/HowToPlay.cs +++ b/src/Client/Menu/HowToPlay.cs @@ -11,6 +11,7 @@ public class HowToPlayView : GameStateView private SpriteFont font; private string howToPlayMessage = + "How to Play\n\n" + "Control a worm to eat spice and grow.\nUse configured keys for movement." + "\nAvoid walls and other players!\nTry to beat the high score!" + "\n(Custom controls in Main Menu)\n"; @@ -74,25 +75,12 @@ public override void update(GameTime gameTime) public override void render(GameTime gameTime) { m_spriteBatch.Begin(); - // Define text scale Vector2 textScale = new Vector2(0.5f, 0.5f); - - // Background Rectangle - var recPosition = new Vector2(m_graphics.PreferredBackBufferWidth / 5 - 20, - m_graphics.PreferredBackBufferHeight / 4 - 50); - Drawing.DrawBlurredRectangle(m_spriteBatch, recPosition, new Vector2(700, 400), 5, 0.9f); - - - // Title - Vector2 titlePosition = new Vector2(m_graphics.PreferredBackBufferWidth / 2, m_graphics.PreferredBackBufferHeight / 4); - - Vector2 titleOrigin = font.MeasureString(titleMessage) / 2; - Drawing.CustomDrawString(font, titleMessage, titlePosition, Colors.displayColor, m_spriteBatch, true, false, scale: 1.0f); - // m_spriteBatch.DrawString(font, titleMessage, titlePosition - (titleOrigin * textScale), Colors.displayColor, 0f, Vector2.Zero, textScale, SpriteEffects.None, 0f); - // How to Play Instructions - Vector2 instructionsPosition = new Vector2(m_graphics.PreferredBackBufferWidth / 5, m_graphics.PreferredBackBufferHeight / 2.5f); + Vector2 instructionsPosition = new Vector2(m_graphics.PreferredBackBufferWidth / 5, m_graphics.PreferredBackBufferHeight / 6); + Drawing.DrawBlurredRectangle(m_spriteBatch, instructionsPosition, new Vector2(m_graphics.PreferredBackBufferWidth * 2/3, m_graphics.PreferredBackBufferHeight * 4 / 5), 5, 0.9f); + string[] lines = howToPlayMessage.Split('\n'); foreach (string line in lines) { diff --git a/src/Client/Menu/MainMenuView.cs b/src/Client/Menu/MainMenuView.cs index 7fab1e2..a080b85 100644 --- a/src/Client/Menu/MainMenuView.cs +++ b/src/Client/Menu/MainMenuView.cs @@ -65,11 +65,11 @@ public override void render(GameTime gameTime) renderSound = false; // reset the flag } // I split the first one's parameters on separate lines to help you see them better - Drawing.DrawBlurredRectangle(m_spriteBatch, new Vector2(m_graphics.PreferredBackBufferWidth / 4, 150), new Vector2(m_graphics.PreferredBackBufferWidth / 2, 500), 5 ); + Drawing.DrawBlurredRectangle(m_spriteBatch, new Vector2(m_graphics.PreferredBackBufferWidth / 4, 100), new Vector2(m_graphics.PreferredBackBufferWidth / 2, 500), 5 ); float bottom = drawMenuItem( m_currentSelection == MenuState.NewGame ? m_fontMenuSelect : m_fontMenu, "New Game", - 200, + 150, m_currentSelection == MenuState.NewGame ? Colors.selectedColor : Colors.displayColor); bottom = drawMenuItem(m_currentSelection == MenuState.HighScores ? m_fontMenuSelect : m_fontMenu, "High Scores", bottom, m_currentSelection == MenuState.HighScores ? Colors.selectedColor : Colors.displayColor); bottom = drawMenuItem(m_currentSelection == MenuState.Controls ? m_fontMenuSelect : m_fontMenu, "Controls", bottom, m_currentSelection == MenuState.Controls ? Colors.selectedColor : Colors.displayColor); diff --git a/src/Client/Systems/Renderer.cs b/src/Client/Systems/Renderer.cs index 4f2997b..2081e96 100644 --- a/src/Client/Systems/Renderer.cs +++ b/src/Client/Systems/Renderer.cs @@ -192,16 +192,18 @@ private void drawLeaderboard(SpriteBatch spriteBatch, List heads) // Then we sort the scores by the first element of each tuple, the score scoresToDisplay.Sort((a, b) => b.Item1.CompareTo(a.Item1)); - - Drawing.DrawBlurredRectangle(spriteBatch, new Vector2(m_graphics.PreferredBackBufferWidth - 350, 0), new Vector2(350, scoresToDisplay.Count * 50 + 100), 7); - Drawing.CustomDrawString(m_font, "Leaderboard", new Vector2(m_graphics.PreferredBackBufferWidth - 300, 0), Color.White, spriteBatch, centered: false); + var leaderBoardLocation = new Vector2(m_graphics.PreferredBackBufferWidth *3 / 4, 0); + if (m_graphics.PreferredBackBufferWidth < 1000) + leaderBoardLocation = new Vector2(m_graphics.PreferredBackBufferWidth * 3 / 5, 0); + Drawing.DrawBlurredRectangle(spriteBatch, leaderBoardLocation, new Vector2(m_graphics.PreferredBackBufferWidth * 3/ 4, scoresToDisplay.Count * 50 + 100), 7); + Drawing.CustomDrawString(m_font, "Leaderboard", leaderBoardLocation, Color.White, spriteBatch, centered: false); // Then we draw the scores for (int i = 0; i < scoresToDisplay.Count; i++) { Drawing.CustomDrawString( m_font, scoresToDisplay[i].Item2 + ": " + scoresToDisplay[i].Item1.ToString(), - new Vector2(m_graphics.PreferredBackBufferWidth - 300, i * 50 + 75), + new Vector2(leaderBoardLocation.X + 30, i * 50 + 75), Color.White, spriteBatch, centered: false,