summaryrefslogtreecommitdiff
path: root/Penguloon/Scenes/MenuScene.cs
diff options
context:
space:
mode:
authoraldrikboy <aldrikboy@gmail.com>2017-12-11 22:02:13 +0100
committeraldrikboy <aldrikboy@gmail.com>2017-12-11 22:02:13 +0100
commitfd6fa4e5cebbe3edb65d50c78dcc8a97ce98ce64 (patch)
tree8950f6b9023e0b47e22e1cd4869ab76de0803f4c /Penguloon/Scenes/MenuScene.cs
parentc4c0f3c887d627b6432551e96009c7aeecd4cdd8 (diff)
First commit
Diffstat (limited to 'Penguloon/Scenes/MenuScene.cs')
-rw-r--r--Penguloon/Scenes/MenuScene.cs50
1 files changed, 50 insertions, 0 deletions
diff --git a/Penguloon/Scenes/MenuScene.cs b/Penguloon/Scenes/MenuScene.cs
new file mode 100644
index 0000000..24a260c
--- /dev/null
+++ b/Penguloon/Scenes/MenuScene.cs
@@ -0,0 +1,50 @@
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Input.Touch;
+using Penguloon.Controls;
+
+namespace Penguloon.Scenes
+{
+ internal class MenuScene : SceneBase
+ {
+ public MenuScene(Main main) : base(main)
+ {
+ if (SoundManager.Baseline == null)
+ SoundManager.StartBaseline();
+ }
+
+ public override void CreateControls()
+ {
+ Button btnStart = new Button(this,
+ new Vector2((StaticUIValues.ScreenViewport.X - StaticUIValues.MenuButtonSize.X) / 2, 100),
+ StaticUIValues.MenuButtonSize, Main.Resources.GetString(Resource.String.MenuBtnPlay));
+
+ btnStart.OnClick += BtnStart_OnClick;
+
+ Controls.Add(btnStart);
+ }
+
+ private void BtnStart_OnClick(object sender, ClickArgs e)
+ {
+ if(SceneManager.LevelSelectionScene == null)
+ SceneManager.LevelSelectionScene = new LevelSelectionScene(Main);
+
+ SceneManager.SelectedScene = SelectedScene.LevelSelection;
+ }
+
+ 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));
+
+ DrawSnowflakes();
+
+ base.Draw(deltaTime);
+ }
+
+ public override void Update(float deltaTime, TouchLocation[] touchLocations)
+ {
+ base.Update(deltaTime, touchLocations);
+ }
+ }
+} \ No newline at end of file