diff options
| author | aldrikboy <aldrikboy@gmail.com> | 2018-01-14 13:42:38 +0100 |
|---|---|---|
| committer | aldrikboy <aldrikboy@gmail.com> | 2018-01-14 13:42:38 +0100 |
| commit | 8d30b5ac461e95cabfc74e46b610beabd81cb460 (patch) | |
| tree | ffe44142cf340670a824111728fb1f2e51653c4d /Penguloon/Scenes/GameScene.cs | |
| parent | 9c9aba58a63315d7b02bd8bf50fc98c18be93ede (diff) | |
upgrade menu
Diffstat (limited to 'Penguloon/Scenes/GameScene.cs')
| -rw-r--r-- | Penguloon/Scenes/GameScene.cs | 48 |
1 files changed, 37 insertions, 11 deletions
diff --git a/Penguloon/Scenes/GameScene.cs b/Penguloon/Scenes/GameScene.cs index 40a7650..06c171c 100644 --- a/Penguloon/Scenes/GameScene.cs +++ b/Penguloon/Scenes/GameScene.cs @@ -104,13 +104,34 @@ namespace Penguloon.Scenes this.Level.Draw(deltaTime); - DrawUI(deltaTime); + if (Level.SelectedObject == null) + { + DrawUI(deltaTime); + + StartRoundBtn.Draw(deltaTime); + ObjectSeletor.Draw(deltaTime); + ChangeSpeedBtn.Draw(deltaTime); + OptionsBtn.Draw(deltaTime); + OptionsMenu.Draw(deltaTime); + } + // show upgrade menu of object is selected + else + { + DrawUpgradeUI(); + } + } + + private void DrawUpgradeUI() + { + //background + Main.SpriteBatch.Draw(ContentManager.GetTexture("UI/objectSelectionBackground"), + destinationRectangle: new Rectangle(Level.Map.MapWidth + StaticUIValues.BorderWidth, + 0, (int)StaticUIValues.ScreenViewport.X - (Level.Map.MapWidth + StaticUIValues.BorderWidth), (int)StaticUIValues.ScreenViewport.Y)); - StartRoundBtn.Draw(deltaTime); - ObjectSeletor.Draw(deltaTime); - ChangeSpeedBtn.Draw(deltaTime); - OptionsBtn.Draw(deltaTime); - OptionsMenu.Draw(deltaTime); + //border + Main.SpriteBatch.Draw(ContentManager.GetTexture("UI/border"), + destinationRectangle: new Rectangle(Level.Map.MapWidth, + 0, StaticUIValues.BorderWidth, (int)StaticUIValues.ScreenViewport.Y)); } private void DrawUI(float deltaTime) @@ -143,17 +164,17 @@ namespace Penguloon.Scenes (int)StaticUIValues.ScreenViewport.X - (Level.Map.MapWidth + StaticUIValues.BorderWidth - 5), StaticUIValues.BorderWidth)); DrawText(ContentManager.GetFont(StaticUIValues.IngameFont), Main.Resources.GetString(Resource.String.IngameGold) + ": " + Level.Money, - new Vector2(Level.Map.MapWidth + StaticUIValues.BorderWidth, 10), + new Vector2(Level.Map.MapWidth + StaticUIValues.BorderWidth + 5, 10), new Vector2(StaticUIValues.ScreenViewport.X - Level.Map.MapWidth - StaticUIValues.BorderWidth, StaticUIValues.IngameUITextAreaHeight), TextAllignment.LeftTop, Color.White, Color.Black, 2); DrawText(ContentManager.GetFont(StaticUIValues.IngameFont), Main.Resources.GetString(Resource.String.IngameWave) + ": " + Level.Map.WaveManager.CurrentWave.ToString(), - new Vector2(Level.Map.MapWidth + StaticUIValues.BorderWidth, 0), + new Vector2(Level.Map.MapWidth + StaticUIValues.BorderWidth + 5, 0), new Vector2(StaticUIValues.ScreenViewport.X - Level.Map.MapWidth - StaticUIValues.BorderWidth, StaticUIValues.IngameUITextAreaHeight), TextAllignment.LeftMiddle, Color.White, Color.Black, 2); DrawText(ContentManager.GetFont(StaticUIValues.IngameFont), Main.Resources.GetString(Resource.String.IngameHealth) + ": " + Level.Health, - new Vector2(Level.Map.MapWidth + StaticUIValues.BorderWidth, 0), + new Vector2(Level.Map.MapWidth + StaticUIValues.BorderWidth + 5, 0), new Vector2(StaticUIValues.ScreenViewport.X - Level.Map.MapWidth - StaticUIValues.BorderWidth, StaticUIValues.IngameUITextAreaHeight), TextAllignment.LeftBottom, Color.White, Color.Black, 2); @@ -164,7 +185,7 @@ namespace Penguloon.Scenes public override void Update(float deltaTime, TouchLocation[] touchLocations) { // We shouldn't update controls when the game is finished to prevent the user from placing any more objects - if (!Level.Finished) + if (!Level.Finished && Level.SelectedObject == null) { base.Update(deltaTime, touchLocations); StartRoundBtn.Update(deltaTime, touchLocations); @@ -174,10 +195,15 @@ namespace Penguloon.Scenes OptionsMenu.Update(deltaTime, touchLocations); } // update finished controls here - else + else if (Level.Finished) { IngameEndStats.Update(deltaTime, touchLocations); } + // update upgrade menu here + else + { + + } if (StartRoundBtn.ControlState == ControlState.Disabled && !Level.Map.WaveManager.RoundActive && !Level.Finished) { |
