summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Penguloon/Content/Content.mgcb48
-rw-r--r--Penguloon/Content/Enemies/pop.pngbin0 -> 37329 bytes
-rw-r--r--Penguloon/Content/UI/lightred.pngbin0 -> 146 bytes
-rw-r--r--Penguloon/Content/UI/msgBoxBackground.pngbin0 -> 5079 bytes
-rw-r--r--Penguloon/Content/UI/optionsMenuBackground.pngbin0 -> 12347 bytes
-rw-r--r--Penguloon/ContentPathManager.cs4
-rw-r--r--Penguloon/Controls/ControlBase.cs13
-rw-r--r--Penguloon/Controls/IngameOptions.cs110
-rw-r--r--Penguloon/Controls/LevelSelector.cs1
-rw-r--r--Penguloon/Controls/MessageBox.cs78
-rw-r--r--Penguloon/Controls/ObjectSelector.cs2
-rw-r--r--Penguloon/Enemies/EnemyBase.cs17
-rw-r--r--Penguloon/Levels/Map.cs2
-rw-r--r--Penguloon/Penguloon.csproj2
-rw-r--r--Penguloon/Projectiles/ProjectileBase.cs2
-rw-r--r--Penguloon/Resources/Resource.Designer.cs21
-rw-r--r--Penguloon/Resources/Values/Strings.xml12
-rw-r--r--Penguloon/Scenes/GameScene.cs32
-rw-r--r--Penguloon/StaticUIValues.cs18
19 files changed, 349 insertions, 13 deletions
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
--- /dev/null
+++ b/Penguloon/Content/Enemies/pop.png
Binary files differ
diff --git a/Penguloon/Content/UI/lightred.png b/Penguloon/Content/UI/lightred.png
new file mode 100644
index 0000000..c0d548d
--- /dev/null
+++ b/Penguloon/Content/UI/lightred.png
Binary files differ
diff --git a/Penguloon/Content/UI/msgBoxBackground.png b/Penguloon/Content/UI/msgBoxBackground.png
new file mode 100644
index 0000000..3516ae8
--- /dev/null
+++ b/Penguloon/Content/UI/msgBoxBackground.png
Binary files differ
diff --git a/Penguloon/Content/UI/optionsMenuBackground.png b/Penguloon/Content/UI/optionsMenuBackground.png
new file mode 100644
index 0000000..2eb62bd
--- /dev/null
+++ b/Penguloon/Content/UI/optionsMenuBackground.png
Binary files 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<ClickArgs> OnClick;
public event EventHandler<MoveArgs> OnMove;
+ public TextAllignment TextAllignment { get; set; } = TextAllignment.CenterMiddle;
+ public int PaddingTop { get; set; } = 0;
+
/// <summary>
/// Base constructor.
/// </summary>
@@ -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);
}
/// <summary>
@@ -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 @@
<Compile Include="Controls\Button.cs" />
<Compile Include="Controls\ButtonIngame.cs" />
<Compile Include="Controls\ControlBase.cs" />
+ <Compile Include="Controls\IngameOptions.cs" />
+ <Compile Include="Controls\MessageBox.cs" />
<Compile Include="Controls\ObjectSelector.cs" />
<Compile Include="Controls\SpeedButton.cs" />
<Compile Include="Enemies\BlueBalloon.cs" />
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 @@
<!-- level selection -->
<string name="LevelSelectionBack">Back</string>
+
+ <!-- ingame -->
+ <string name="IngameOptions">Options</string>
+ <string name="IngameStart">Start</string>
+
+ <!-- ingame options menu -->
+ <string name="IngameOptionsContinue">Continue</string>
+ <string name="IngameOptionsQuit">Quit</string>
+
+ <string name="IngameOptionsQuitConfirmation">Are you sure you want to quit?</string>
+ <string name="IngameYes">Yes</string>
+ <string name="IngameNo">No</string>
</resources>
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