summaryrefslogtreecommitdiff
path: root/Penguloon/Scenes/GameScene.cs
diff options
context:
space:
mode:
authoraldrikboy <aldrikboy@gmail.com>2017-12-11 22:57:04 +0100
committeraldrikboy <aldrikboy@gmail.com>2017-12-11 22:57:04 +0100
commitb0a3f57a68a39c2b027158cdfc9384ddb84dfa38 (patch)
treef3c3be7a2a826f4c3836be2a52573f8aa5000951 /Penguloon/Scenes/GameScene.cs
parentfd6fa4e5cebbe3edb65d50c78dcc8a97ce98ce64 (diff)
haHA
Diffstat (limited to 'Penguloon/Scenes/GameScene.cs')
-rw-r--r--Penguloon/Scenes/GameScene.cs31
1 files changed, 29 insertions, 2 deletions
diff --git a/Penguloon/Scenes/GameScene.cs b/Penguloon/Scenes/GameScene.cs
index 2928b4b..406e784 100644
--- a/Penguloon/Scenes/GameScene.cs
+++ b/Penguloon/Scenes/GameScene.cs
@@ -1,4 +1,6 @@
-using Microsoft.Xna.Framework.Input.Touch;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Input.Touch;
+using Penguloon.Controls;
using Penguloon.Levels;
using Penguloon.Scenes;
@@ -8,22 +10,47 @@ namespace Penguloon.Scenes
{
public LevelBase Level { get; set; }
+ public bool RoundActive { get; set; } = false;
+
public GameScene(Main main, LevelBase level) : base(main)
{
this.Level = level;
this.Level.Initialize(this);
+
+ Button StartRoundBtn = new Button(this,
+ new Vector2(Level.Map.MapWidth + StaticUIValues.BorderWidth, StaticUIValues.ScreenViewport.Y - 120),
+ new Vector2(StaticUIValues.ScreenViewport.X - (Level.Map.MapWidth + StaticUIValues.BorderWidth), 120), "Start");
+
+ StartRoundBtn.OnClick += StartRoundBtn_OnClick;
+
+ Controls.Add(StartRoundBtn);
+ }
+
+ private void StartRoundBtn_OnClick(object sender, ClickArgs e)
+ {
+ RoundActive = true;
+ Button btn = (Button)sender;
+ btn.ControlState = ControlState.Disabled;
}
public override void CreateControls()
{
-
+
}
public override void Draw(float deltaTime)
{
+ // background
+ Main.SpriteBatch.Draw(ContentManager.GetTexture("UI/background"),
+ destinationRectangle: new Rectangle(0, 0, (int)StaticUIValues.ScreenViewport.X, (int)StaticUIValues.ScreenViewport.Y));
+
base.Draw(deltaTime);
this.Level.Draw(deltaTime);
+
+ Main.SpriteBatch.Draw(ContentManager.GetTexture("UI/border"),
+ destinationRectangle: new Rectangle(Level.Map.MapWidth,
+ 0, StaticUIValues.BorderWidth, (int)StaticUIValues.ScreenViewport.Y));
}
public override void Update(float deltaTime, TouchLocation[] touchLocations)