From b0a3f57a68a39c2b027158cdfc9384ddb84dfa38 Mon Sep 17 00:00:00 2001 From: aldrikboy Date: Mon, 11 Dec 2017 22:57:04 +0100 Subject: haHA --- Penguloon/Scenes/GameScene.cs | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'Penguloon/Scenes/GameScene.cs') 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) -- cgit v1.2.3-70-g09d2