diff options
Diffstat (limited to 'Penguloon/Scenes/GameScene.cs')
| -rw-r--r-- | Penguloon/Scenes/GameScene.cs | 31 |
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) |
