From ad0d29bf5d881ab619a90ffb8a1f3352eba21615 Mon Sep 17 00:00:00 2001 From: aldrikboy Date: Sat, 23 Dec 2017 19:14:34 +0100 Subject: Communism --- Penguloon/Content/Content.mgcb | 48 +++++++++++ Penguloon/Content/Enemies/pop.png | Bin 0 -> 37329 bytes Penguloon/Content/UI/lightred.png | Bin 0 -> 146 bytes Penguloon/Content/UI/msgBoxBackground.png | Bin 0 -> 5079 bytes Penguloon/Content/UI/optionsMenuBackground.png | Bin 0 -> 12347 bytes Penguloon/ContentPathManager.cs | 4 + Penguloon/Controls/ControlBase.cs | 13 ++- Penguloon/Controls/IngameOptions.cs | 110 +++++++++++++++++++++++++ Penguloon/Controls/LevelSelector.cs | 1 + Penguloon/Controls/MessageBox.cs | 78 ++++++++++++++++++ Penguloon/Controls/ObjectSelector.cs | 2 +- Penguloon/Enemies/EnemyBase.cs | 17 +++- Penguloon/Levels/Map.cs | 2 +- Penguloon/Penguloon.csproj | 2 + Penguloon/Projectiles/ProjectileBase.cs | 2 + Penguloon/Resources/Resource.Designer.cs | 21 +++++ Penguloon/Resources/Values/Strings.xml | 12 +++ Penguloon/Scenes/GameScene.cs | 32 +++++-- Penguloon/StaticUIValues.cs | 18 +++- 19 files changed, 349 insertions(+), 13 deletions(-) create mode 100644 Penguloon/Content/Enemies/pop.png create mode 100644 Penguloon/Content/UI/lightred.png create mode 100644 Penguloon/Content/UI/msgBoxBackground.png create mode 100644 Penguloon/Content/UI/optionsMenuBackground.png create mode 100644 Penguloon/Controls/IngameOptions.cs create mode 100644 Penguloon/Controls/MessageBox.cs (limited to 'Penguloon') diff --git a/Penguloon/Content/Content.mgcb b/Penguloon/Content/Content.mgcb index 11c9cde..4ea14fe 100644 --- a/Penguloon/Content/Content.mgcb +++ b/Penguloon/Content/Content.mgcb @@ -503,3 +503,51 @@ /processorParam:TextureFormat=Color /build:UI/btnPressedIngame.png +#begin Enemies/pop.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Enemies/pop.png + +#begin UI/lightred.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:UI/lightred.png + +#begin UI/optionsMenuBackground.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:UI/optionsMenuBackground.png + +#begin UI/msgBoxBackground.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:UI/msgBoxBackground.png + diff --git a/Penguloon/Content/Enemies/pop.png b/Penguloon/Content/Enemies/pop.png new file mode 100644 index 0000000..2eb3a38 Binary files /dev/null and b/Penguloon/Content/Enemies/pop.png differ diff --git a/Penguloon/Content/UI/lightred.png b/Penguloon/Content/UI/lightred.png new file mode 100644 index 0000000..c0d548d Binary files /dev/null and b/Penguloon/Content/UI/lightred.png differ diff --git a/Penguloon/Content/UI/msgBoxBackground.png b/Penguloon/Content/UI/msgBoxBackground.png new file mode 100644 index 0000000..3516ae8 Binary files /dev/null and b/Penguloon/Content/UI/msgBoxBackground.png differ diff --git a/Penguloon/Content/UI/optionsMenuBackground.png b/Penguloon/Content/UI/optionsMenuBackground.png new file mode 100644 index 0000000..2eb62bd Binary files /dev/null and b/Penguloon/Content/UI/optionsMenuBackground.png differ diff --git a/Penguloon/ContentPathManager.cs b/Penguloon/ContentPathManager.cs index 3db46b5..cd305c0 100644 --- a/Penguloon/ContentPathManager.cs +++ b/Penguloon/ContentPathManager.cs @@ -41,9 +41,13 @@ namespace Penguloon "UI/border-horizontal", "UI/objectSelectionBackground", "UI/objectSelectionBorder", + "UI/lightred", + "UI/optionsMenuBackground", + "UI/msgBoxBackground", "SplashArt/1", + "Enemies/pop", "Enemies/red", "Enemies/blue", "Enemies/yellow", diff --git a/Penguloon/Controls/ControlBase.cs b/Penguloon/Controls/ControlBase.cs index dea0bd7..42c729e 100644 --- a/Penguloon/Controls/ControlBase.cs +++ b/Penguloon/Controls/ControlBase.cs @@ -24,9 +24,13 @@ namespace Penguloon.Controls public Texture2D BackgroundPressed { get; set; } public Texture2D BackgroundDisabled { get; set; } + public event EventHandler OnMissClick; public event EventHandler OnClick; public event EventHandler OnMove; + public TextAllignment TextAllignment { get; set; } = TextAllignment.CenterMiddle; + public int PaddingTop { get; set; } = 0; + /// /// Base constructor. /// @@ -65,7 +69,7 @@ namespace Penguloon.Controls if (Font == null) return; if (string.IsNullOrWhiteSpace(Text)) return; - ParentScene.DrawText(Font, Text, Position, Size, TextAllignment.CenterMiddle, ForeColor, BorderColor, BorderWidth); + ParentScene.DrawText(Font, Text, new Vector2(Position.X, Position.Y + PaddingTop), Size, TextAllignment, ForeColor, BorderColor, BorderWidth); } /// @@ -105,7 +109,12 @@ namespace Penguloon.Controls return; } else - this.ControlState = ControlState.Idle; + { + this.ControlState = ControlState.Idle; + + if (touchLocations[i].State == TouchLocationState.Released) + OnMissClick?.Invoke(this, EventArgs.Empty); + } } } } diff --git a/Penguloon/Controls/IngameOptions.cs b/Penguloon/Controls/IngameOptions.cs new file mode 100644 index 0000000..a7f1f00 --- /dev/null +++ b/Penguloon/Controls/IngameOptions.cs @@ -0,0 +1,110 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Input.Touch; +using Penguloon.Scenes; +using System; + +namespace Penguloon.Controls +{ + public enum IngameOptionsState + { + Show, + Hide + } + + public class IngameOptions : ControlBase + { + public IngameOptionsState State { get; set; } = IngameOptionsState.Hide; + + public DateTime ShowTime { get; set; } + + public Button BtnContinue { get; set; } + public Button BtnQuit { get; set; } + + public MessageBox QuitConfirmationBox { get; set; } + public DateTime ShowTimeMsgBox { get; set; } + + public IngameOptions(SceneBase parentScene, Vector2 position, Vector2 size) : base(parentScene, position, size) + { + this.BackgroundIdle = ContentManager.GetTexture("UI/optionsMenuBackground"); + this.BackgroundPressed = ContentManager.GetTexture("UI/optionsMenuBackground"); + this.BackgroundDisabled = ContentManager.GetTexture("UI/optionsMenuBackground"); + + Vector2 BtnSize = new Vector2(Size.X - 90, StaticUIValues.IngameUIPlayButtonHeight); + Vector2 MsgBoxSize = new Vector2(900, 300); + + BtnContinue = new Button(parentScene, + new Vector2(position.X + (Size.X / 2) - (BtnSize.X / 2), Position.Y + 50), + BtnSize, parentScene.Main.Resources.GetString(Resource.String.IngameOptionsContinue)); + + BtnQuit = new Button(parentScene, + new Vector2(position.X + (Size.X / 2) - (BtnSize.X / 2), Position.Y + Size.Y - 50 - BtnSize.Y), + BtnSize, parentScene.Main.Resources.GetString(Resource.String.IngameOptionsQuit)); + + QuitConfirmationBox = new MessageBox(parentScene, + new Vector2((StaticUIValues.ScreenViewport.X / 2) - (MsgBoxSize.X / 2), (StaticUIValues.ScreenViewport.Y / 2) - (MsgBoxSize.Y / 2)), + MsgBoxSize, parentScene.Main.Resources.GetString(Resource.String.IngameOptionsQuitConfirmation)); + + BtnContinue.OnClick += BtnContinue_OnClick; + BtnQuit.OnClick += BtnQuit_OnClick; + + OnMissClick += IngameOptions_OnMissClick; + QuitConfirmationBox.OnMissClick += QuitConfirmationBox_OnMissClick; + QuitConfirmationBox.OnYes += QuitConfirmationBox_OnYes; + } + + private void QuitConfirmationBox_OnYes(object sender, EventArgs e) + { + SceneManager.SelectedScene = SelectedScene.Menu; + } + + private void QuitConfirmationBox_OnMissClick(object sender, EventArgs e) + { + ShowTimeMsgBox = DateTime.Now; + } + + private void BtnQuit_OnClick(object sender, ClickArgs e) + { + QuitConfirmationBox.State = IngameOptionsState.Show; + } + + private void BtnContinue_OnClick(object sender, ClickArgs e) + { + this.State = IngameOptionsState.Hide; + } + + private void IngameOptions_OnMissClick(object sender, System.EventArgs e) + { + if((DateTime.Now - ShowTime).TotalMilliseconds > 200) + { + State = IngameOptionsState.Hide; + } + } + + public override void Draw(float deltaTime) + { + if (State == IngameOptionsState.Hide) return; + + base.Draw(deltaTime); + + BtnContinue.Draw(deltaTime); + BtnQuit.Draw(deltaTime); + QuitConfirmationBox.Draw(deltaTime); + } + + public override void Update(float deltaTime, TouchLocation[] touchLocations) + { + if (State == IngameOptionsState.Hide) return; + + QuitConfirmationBox.Update(deltaTime, touchLocations); + + if (QuitConfirmationBox.State == IngameOptionsState.Show) return; + + if ((DateTime.Now - ShowTimeMsgBox).TotalMilliseconds <= 200) return; + + base.Update(deltaTime, touchLocations); + + BtnContinue.Update(deltaTime, touchLocations); + BtnQuit.Update(deltaTime, touchLocations); + } + } +} \ No newline at end of file diff --git a/Penguloon/Controls/LevelSelector.cs b/Penguloon/Controls/LevelSelector.cs index 1e26fcc..6437773 100644 --- a/Penguloon/Controls/LevelSelector.cs +++ b/Penguloon/Controls/LevelSelector.cs @@ -55,6 +55,7 @@ namespace Penguloon.Controls if (Panel2.Intersects(fingerRec)) { + SoundManager.PlayClickSound(); SceneManager.GameScene = new GameScene(ParentScene.Main, Levels[selectedMap]); SceneManager.SelectedScene = SelectedScene.Ingame; } diff --git a/Penguloon/Controls/MessageBox.cs b/Penguloon/Controls/MessageBox.cs new file mode 100644 index 0000000..48ba992 --- /dev/null +++ b/Penguloon/Controls/MessageBox.cs @@ -0,0 +1,78 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Input.Touch; +using Penguloon.Scenes; +using System; + +namespace Penguloon.Controls +{ + public class MessageBox : ControlBase + { + public IngameOptionsState State { get; set; } = IngameOptionsState.Hide; + + public DateTime ShowTime { get; set; } + + public Button BtnYes { get; set; } + public Button BtnNo { get; set; } + + public event EventHandler OnYes; + public event EventHandler OnNo; + + public MessageBox(SceneBase parentScene, Vector2 position, Vector2 size, string text) : base(parentScene, position, size) + { + this.BackgroundIdle = ContentManager.GetTexture("UI/msgBoxBackground"); + this.BackgroundPressed = ContentManager.GetTexture("UI/msgBoxBackground"); + this.BackgroundDisabled = ContentManager.GetTexture("UI/msgBoxBackground"); + + this.Text = text; + this.Font = ContentManager.GetFont("Fonts/GWENT/36"); + this.ForeColor = Color.White; + this.BorderColor = Color.Black; + this.BorderWidth = 2; + this.TextAllignment = TextAllignment.CenterTop; + this.PaddingTop = 35; + + Vector2 BtnSize = new Vector2((Size.X - 135) / 2, StaticUIValues.IngameUIPlayButtonHeight); + + BtnYes = new Button(parentScene, + new Vector2(position.X + 45, Position.Y + Size.Y - BtnSize.Y - 45), + BtnSize, parentScene.Main.Resources.GetString(Resource.String.IngameYes)); + + BtnNo = new Button(parentScene, + new Vector2(position.X + Size.X - BtnSize.X - 45, Position.Y + Size.Y - BtnSize.Y - 45), + BtnSize, parentScene.Main.Resources.GetString(Resource.String.IngameNo)); + + OnMissClick += IngameOptions_OnMissClick; + + BtnYes.OnClick += delegate { OnYes?.Invoke(this, EventArgs.Empty); this.State = IngameOptionsState.Hide; }; + BtnNo.OnClick += delegate { OnNo?.Invoke(this, EventArgs.Empty); this.State = IngameOptionsState.Hide; }; + } + + private void IngameOptions_OnMissClick(object sender, System.EventArgs e) + { + if ((DateTime.Now - ShowTime).TotalMilliseconds > 200) + { + State = IngameOptionsState.Hide; + } + } + + public override void Draw(float deltaTime) + { + if (State == IngameOptionsState.Hide) return; + + base.Draw(deltaTime); + + BtnYes.Draw(deltaTime); + BtnNo.Draw(deltaTime); + } + + public override void Update(float deltaTime, TouchLocation[] touchLocations) + { + if (State == IngameOptionsState.Hide) return; + + base.Update(deltaTime, touchLocations); + + BtnYes.Update(deltaTime, touchLocations); + BtnNo.Update(deltaTime, touchLocations); + } + } +} \ No newline at end of file diff --git a/Penguloon/Controls/ObjectSelector.cs b/Penguloon/Controls/ObjectSelector.cs index 44b68c3..a155601 100644 --- a/Penguloon/Controls/ObjectSelector.cs +++ b/Penguloon/Controls/ObjectSelector.cs @@ -117,7 +117,7 @@ namespace Penguloon.Controls if(State == State.Selected && i == SelectedObjectIndex) { - ParentScene.Main.SpriteBatch.Draw(ContentManager.GetTexture("UI/red"), + ParentScene.Main.SpriteBatch.Draw(ContentManager.GetTexture("UI/lightred"), destinationRectangle: new Rectangle(posX, (int)Position.Y + posY, width, height)); } diff --git a/Penguloon/Enemies/EnemyBase.cs b/Penguloon/Enemies/EnemyBase.cs index c67e3bc..9bb6230 100644 --- a/Penguloon/Enemies/EnemyBase.cs +++ b/Penguloon/Enemies/EnemyBase.cs @@ -26,6 +26,9 @@ namespace Penguloon.Enemies public int HealthToTake { get; set; } + public bool Dead { get; set; } = false; + public DateTime PopDate { get; set; } + public EnemyBase(Map map) { this.Map = map; @@ -36,6 +39,14 @@ namespace Penguloon.Enemies public void Update(float deltaTime) { + if (Dead) + { + if((DateTime.Now - PopDate).TotalMilliseconds > (100 / Map.Level.ParentScene.Speed)) + Map.Enemies.Remove(this); + return; + + } + int margin = 5; Box = new Rectangle(new Point((int)Position.X + margin, (int)Position.Y + margin), new Point(Map.TileWidth - (margin * 2), Map.TileHeight - (margin * 2))); @@ -90,7 +101,11 @@ namespace Penguloon.Enemies SpawnChild(); if (Health <= 0) - Map.Enemies.Remove(this); + { + Dead = true; + PopDate = DateTime.Now; + Texture = ContentManager.GetTexture("Enemies/pop"); + } SoundManager.PlayBalloonPopSound(); } diff --git a/Penguloon/Levels/Map.cs b/Penguloon/Levels/Map.cs index 2e90874..bb574d5 100644 --- a/Penguloon/Levels/Map.cs +++ b/Penguloon/Levels/Map.cs @@ -190,7 +190,7 @@ namespace Penguloon.Levels } } - public class Tile + public struct Tile { public int Type { get; set; } diff --git a/Penguloon/Penguloon.csproj b/Penguloon/Penguloon.csproj index 4e8ed6c..5afafc0 100644 --- a/Penguloon/Penguloon.csproj +++ b/Penguloon/Penguloon.csproj @@ -67,6 +67,8 @@ + + diff --git a/Penguloon/Projectiles/ProjectileBase.cs b/Penguloon/Projectiles/ProjectileBase.cs index 4221569..4a4f1a2 100644 --- a/Penguloon/Projectiles/ProjectileBase.cs +++ b/Penguloon/Projectiles/ProjectileBase.cs @@ -61,6 +61,8 @@ namespace Penguloon.Projectiles for(int i = 0; i < ParentObject.Map.Enemies.Count; i++) { + if (ParentObject.Map.Enemies[i].Dead) continue; + if (projectileRec.Intersects(ParentObject.Map.Enemies[i].Box)) { ParentObject.Map.Enemies[i].GetHit(); diff --git a/Penguloon/Resources/Resource.Designer.cs b/Penguloon/Resources/Resource.Designer.cs index 7de55ec..1a0115e 100644 --- a/Penguloon/Resources/Resource.Designer.cs +++ b/Penguloon/Resources/Resource.Designer.cs @@ -66,6 +66,27 @@ namespace Penguloon // aapt resource value: 0x7f030000 public const int ApplicationName = 2130903040; + // aapt resource value: 0x7f030009 + public const int IngameNo = 2130903049; + + // aapt resource value: 0x7f030003 + public const int IngameOptions = 2130903043; + + // aapt resource value: 0x7f030005 + public const int IngameOptionsContinue = 2130903045; + + // aapt resource value: 0x7f030006 + public const int IngameOptionsQuit = 2130903046; + + // aapt resource value: 0x7f030007 + public const int IngameOptionsQuitConfirmation = 2130903047; + + // aapt resource value: 0x7f030004 + public const int IngameStart = 2130903044; + + // aapt resource value: 0x7f030008 + public const int IngameYes = 2130903048; + // aapt resource value: 0x7f030002 public const int LevelSelectionBack = 2130903042; diff --git a/Penguloon/Resources/Values/Strings.xml b/Penguloon/Resources/Values/Strings.xml index 3e77381..0af942b 100644 --- a/Penguloon/Resources/Values/Strings.xml +++ b/Penguloon/Resources/Values/Strings.xml @@ -7,4 +7,16 @@ Back + + + Options + Start + + + Continue + Quit + + Are you sure you want to quit? + Yes + No diff --git a/Penguloon/Scenes/GameScene.cs b/Penguloon/Scenes/GameScene.cs index 0647539..7248730 100644 --- a/Penguloon/Scenes/GameScene.cs +++ b/Penguloon/Scenes/GameScene.cs @@ -16,6 +16,7 @@ namespace Penguloon.Scenes public ButtonIngame StartRoundBtn { get; set; } public SpeedButton ChangeSpeedBtn { get; set; } public ButtonIngame OptionsBtn { get; set; } + public IngameOptions OptionsMenu { get; set; } public ObjectSelector ObjectSeletor { get; set; } @@ -26,18 +27,24 @@ namespace Penguloon.Scenes StartRoundBtn = new ButtonIngame(this, new Vector2(Level.Map.MapWidth + StaticUIValues.BorderWidth, StaticUIValues.ScreenViewport.Y - StaticUIValues.IngameUIPlayButtonHeight), - new Vector2(StaticUIValues.ScreenViewport.X - (Level.Map.MapWidth + StaticUIValues.BorderWidth), StaticUIValues.IngameUIPlayButtonHeight), "Start"); + new Vector2(StaticUIValues.ScreenViewport.X - (Level.Map.MapWidth + StaticUIValues.BorderWidth), StaticUIValues.IngameUIPlayButtonHeight), Main.Resources.GetString(Resource.String.IngameStart)); OptionsBtn = new ButtonIngame(this, new Vector2(Level.Map.MapWidth + StaticUIValues.BorderWidth, StaticUIValues.ScreenViewport.Y - StaticUIValues.IngameUIPlayButtonHeight - StaticUIValues.IngameUIPlayButtonHeight - StaticUIValues.BorderWidth), - new Vector2(StaticUIValues.ScreenViewport.X - (Level.Map.MapWidth + StaticUIValues.BorderWidth), StaticUIValues.IngameUIPlayButtonHeight), "Options"); + new Vector2(StaticUIValues.ScreenViewport.X - (Level.Map.MapWidth + StaticUIValues.BorderWidth), StaticUIValues.IngameUIPlayButtonHeight), Main.Resources.GetString(Resource.String.IngameOptions)); ChangeSpeedBtn = new SpeedButton(this, - new Vector2(Level.Map.MapWidth - 200, StaticUIValues.ScreenViewport.Y - StaticUIValues.IngameUIPlayButtonHeight), - new Vector2(200, StaticUIValues.IngameUIPlayButtonHeight), "X1"); + new Vector2(Level.Map.MapWidth - StaticUIValues.ChangeSpeedButtonWidth, StaticUIValues.ScreenViewport.Y - StaticUIValues.IngameUIPlayButtonHeight), + new Vector2(StaticUIValues.ChangeSpeedButtonWidth, StaticUIValues.IngameUIPlayButtonHeight), "X1"); + + OptionsMenu = new IngameOptions(this, + new Vector2((StaticUIValues.ScreenViewport.X / 2) - (StaticUIValues.IngameOptionsSize.X / 2), + (StaticUIValues.ScreenViewport.Y / 2) - (StaticUIValues.IngameOptionsSize.Y / 2)), + StaticUIValues.IngameOptionsSize); ChangeSpeedBtn.OnClick += ChangeSpeedBtn_OnClick; StartRoundBtn.OnClick += StartRoundBtn_OnClick; + OptionsBtn.OnClick += OptionsBtn_OnClick; ObjectSeletor = new ObjectSelector(level.Map, this, new Vector2(Level.Map.MapWidth + StaticUIValues.BorderWidth, StaticUIValues.IngameUITextAreaHeight + StaticUIValues.BorderWidth), @@ -46,6 +53,15 @@ namespace Penguloon.Scenes } + private void OptionsBtn_OnClick(object sender, ClickArgs e) + { + if (OptionsMenu.State == IngameOptionsState.Hide) + { + OptionsMenu.ShowTime = DateTime.Now; + OptionsMenu.State = IngameOptionsState.Show; + } + } + private void ChangeSpeedBtn_OnClick(object sender, ClickArgs e) { switch (Speed) @@ -88,6 +104,7 @@ namespace Penguloon.Scenes ObjectSeletor.Draw(deltaTime); ChangeSpeedBtn.Draw(deltaTime); OptionsBtn.Draw(deltaTime); + OptionsMenu.Draw(deltaTime); } private void DrawUI(float deltaTime) @@ -122,17 +139,17 @@ namespace Penguloon.Scenes DrawText(ContentManager.GetFont(StaticUIValues.IngameFont), "Gold: " + Level.Money, new Vector2(Level.Map.MapWidth + StaticUIValues.BorderWidth, 10), new Vector2(StaticUIValues.ScreenViewport.X - Level.Map.MapWidth - StaticUIValues.BorderWidth, StaticUIValues.IngameUITextAreaHeight), - TextAllignment.CenterTop, Color.White, Color.Black, 2); + TextAllignment.LeftTop, Color.White, Color.Black, 2); DrawText(ContentManager.GetFont(StaticUIValues.IngameFont), "Wave: " + Level.Map.WaveManager.CurrentWave.ToString(), new Vector2(Level.Map.MapWidth + StaticUIValues.BorderWidth, 0), new Vector2(StaticUIValues.ScreenViewport.X - Level.Map.MapWidth - StaticUIValues.BorderWidth, StaticUIValues.IngameUITextAreaHeight), - TextAllignment.CenterMiddle, Color.White, Color.Black, 2); + TextAllignment.LeftMiddle, Color.White, Color.Black, 2); DrawText(ContentManager.GetFont(StaticUIValues.IngameFont), "Health: " + Level.Health, new Vector2(Level.Map.MapWidth + StaticUIValues.BorderWidth, 0), new Vector2(StaticUIValues.ScreenViewport.X - Level.Map.MapWidth - StaticUIValues.BorderWidth, StaticUIValues.IngameUITextAreaHeight), - TextAllignment.CenterBottom, Color.White, Color.Black, 2); + TextAllignment.LeftBottom, Color.White, Color.Black, 2); } public override void Update(float deltaTime, TouchLocation[] touchLocations) @@ -145,6 +162,7 @@ namespace Penguloon.Scenes ObjectSeletor.Update(deltaTime, touchLocations); ChangeSpeedBtn.Update(deltaTime, touchLocations); OptionsBtn.Update(deltaTime, touchLocations); + OptionsMenu.Update(deltaTime, touchLocations); } if (StartRoundBtn.ControlState == ControlState.Disabled && !Level.Map.WaveManager.RoundActive && !Level.Finished) diff --git a/Penguloon/StaticUIValues.cs b/Penguloon/StaticUIValues.cs index e675ea5..9068461 100644 --- a/Penguloon/StaticUIValues.cs +++ b/Penguloon/StaticUIValues.cs @@ -30,6 +30,10 @@ namespace Penguloon public static int IngameUIPlayButtonHeight { get; set; } + public static int ChangeSpeedButtonWidth { get; set; } + + public static Vector2 IngameOptionsSize { get; set; } + public static void Initialize(Main main) { ScreenViewport = main.GraphicsDevice.Viewport.Bounds.Size.ToVector2(); @@ -43,6 +47,9 @@ namespace Penguloon MenuButtonSize = new Vector2(800, 150); MenuFont = "Fonts/GWENT/72"; IngameUIWidth = 350; + IngameUIPlayButtonHeight = 120; + ChangeSpeedButtonWidth = 200; + IngameOptionsSize = new Vector2(800, 1000); } else if (ScreenViewport.X >= 1920) { @@ -51,6 +58,9 @@ namespace Penguloon LoadingProgressbarSize = new Vector2((int)(800 * 1.3), (int)(150 * 1.3)); MenuFont = "Fonts/GWENT/72"; IngameUIWidth = 350; + IngameUIPlayButtonHeight = 120; + ChangeSpeedButtonWidth = 200; + IngameOptionsSize = new Vector2((int)(800 * 0.85), (int)(1000 * 0.85)); } else if (ScreenViewport.X >= 1280) { @@ -58,6 +68,9 @@ namespace Penguloon MenuButtonSize = new Vector2((int)(800 * 0.7), (int)(150 * 0.7)); LoadingProgressbarSize = new Vector2((int)(800 * 1), (int)(150 * 1)); MenuFont = "Fonts/GWENT/48"; + IngameUIPlayButtonHeight = 80; + ChangeSpeedButtonWidth = 130; + IngameOptionsSize = new Vector2((int)(800 * 0.7), (int)(1000 * 0.7)); } else { @@ -65,6 +78,9 @@ namespace Penguloon MenuButtonSize = new Vector2((int)(800 * 0.7), (int)(150 * 0.7)); LoadingProgressbarSize = new Vector2((int)(800 * 0.7), (int)(150 * 0.7)); MenuFont = "Fonts/GWENT/48"; + IngameUIPlayButtonHeight = 80; + ChangeSpeedButtonWidth = 130; + IngameOptionsSize = new Vector2((int)(800 * 0.7), (int)(1000 * 0.7)); } IngameFont = "Fonts/GWENT/24"; @@ -75,7 +91,7 @@ namespace Penguloon SnowflakeSize = 100; IngameUITextAreaHeight = 120; - IngameUIPlayButtonHeight = 120; + } } } \ No newline at end of file -- cgit v1.2.3-70-g09d2