summaryrefslogtreecommitdiff
path: root/Penguloon
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
parentfd6fa4e5cebbe3edb65d50c78dcc8a97ce98ce64 (diff)
haHA
Diffstat (limited to 'Penguloon')
-rw-r--r--Penguloon/Content/Content.mgcb12
-rw-r--r--Penguloon/Content/UI/border.pngbin0 -> 973 bytes
-rw-r--r--Penguloon/ContentPathManager.cs1
-rw-r--r--Penguloon/Levels/IceLevel.cs30
-rw-r--r--Penguloon/Levels/Map.cs8
-rw-r--r--Penguloon/Scenes/GameScene.cs31
-rw-r--r--Penguloon/StaticUIValues.cs2
7 files changed, 70 insertions, 14 deletions
diff --git a/Penguloon/Content/Content.mgcb b/Penguloon/Content/Content.mgcb
index a47b8e8..bf5a08e 100644
--- a/Penguloon/Content/Content.mgcb
+++ b/Penguloon/Content/Content.mgcb
@@ -406,3 +406,15 @@
/processorParam:TextureFormat=Color
/build:SplashArt/1.png
+#begin UI/border.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/border.png
+
diff --git a/Penguloon/Content/UI/border.png b/Penguloon/Content/UI/border.png
new file mode 100644
index 0000000..4208fff
--- /dev/null
+++ b/Penguloon/Content/UI/border.png
Binary files differ
diff --git a/Penguloon/ContentPathManager.cs b/Penguloon/ContentPathManager.cs
index abe5bc3..4040e50 100644
--- a/Penguloon/ContentPathManager.cs
+++ b/Penguloon/ContentPathManager.cs
@@ -34,6 +34,7 @@ namespace Penguloon
"UI/btnDisabled",
"UI/btnIdle",
"UI/btnPressed",
+ "UI/border",
"SplashArt/1",
diff --git a/Penguloon/Levels/IceLevel.cs b/Penguloon/Levels/IceLevel.cs
index 984a07f..5f8b4c7 100644
--- a/Penguloon/Levels/IceLevel.cs
+++ b/Penguloon/Levels/IceLevel.cs
@@ -25,20 +25,32 @@ namespace Penguloon.Levels
Map = new Map(ParentScene);
Tile OO = new Tile(0, Direction.None);
+
Tile DN = new Tile(6, Direction.Down);
+ Tile RT = new Tile(5, Direction.Right);
+ Tile UP = new Tile(6, Direction.Up);
+
+ Tile TR = new Tile(4, Direction.Right);
+ Tile DR = new Tile(3, Direction.Right);
+
+ Tile DL = new Tile(1, Direction.Down);
+ Tile TL = new Tile(2, Direction.Up);
- Map.TileMap = new Tile[12, 18]
+ Tile FN = new Tile(5, Direction.Finish);
+
+ Map.TileMap = new Tile[13, 18]
{
{ OO,DN,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO },
{ OO,DN,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO },
- { OO,DN,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO },
- { OO,DN,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO },
- { OO,DN,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO },
- { OO,DN,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO },
- { OO,DN,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO },
- { OO,DN,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO },
- { OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO },
- { OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO },
+ { OO,DN,OO,OO,OO,DR,RT,RT,RT,DL,OO,OO,OO,DR,RT,RT,RT,FN },
+ { OO,DN,OO,OO,OO,UP,OO,OO,OO,DN,OO,OO,OO,UP,OO,OO,OO,OO },
+ { OO,DN,OO,OO,OO,UP,OO,OO,OO,DN,OO,OO,OO,UP,OO,OO,OO,OO },
+ { OO,DN,OO,OO,OO,UP,OO,OO,OO,DN,OO,OO,OO,UP,OO,OO,OO,OO },
+ { OO,DN,OO,OO,OO,UP,OO,OO,OO,DN,OO,OO,OO,UP,OO,OO,OO,OO },
+ { OO,TR,RT,DL,OO,UP,OO,OO,OO,DN,OO,OO,OO,UP,OO,OO,OO,OO },
+ { OO,OO,OO,DN,OO,UP,OO,OO,OO,DN,OO,OO,OO,UP,OO,OO,OO,OO },
+ { OO,OO,OO,DN,OO,UP,OO,OO,OO,DN,OO,OO,OO,UP,OO,OO,OO,OO },
+ { OO,OO,OO,TR,RT,TL,OO,OO,OO,TR,RT,RT,RT,TL,OO,OO,OO,OO },
{ OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO },
{ OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO },
};
diff --git a/Penguloon/Levels/Map.cs b/Penguloon/Levels/Map.cs
index 384d011..699d9eb 100644
--- a/Penguloon/Levels/Map.cs
+++ b/Penguloon/Levels/Map.cs
@@ -21,11 +21,13 @@ namespace Penguloon.Levels
{
this.ParentScene = parentScene;
- MapWidth = (int)StaticUIValues.ScreenViewport.X - StaticUIValues.IngameUIWidth;
- MapHeight = (int)StaticUIValues.ScreenViewport.Y;
+ MapWidth = (int)(StaticUIValues.ScreenViewport.X - StaticUIValues.IngameUIWidth);
+ MapHeight = (int)(StaticUIValues.ScreenViewport.Y);
TileWidth = MapWidth / 18;
- TileHeight = MapHeight / 12;
+ TileHeight = MapHeight / 13;
+
+ MapWidth = TileWidth * 18;
}
public void Draw(float deltaTime)
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)
diff --git a/Penguloon/StaticUIValues.cs b/Penguloon/StaticUIValues.cs
index 48ae696..5407e6c 100644
--- a/Penguloon/StaticUIValues.cs
+++ b/Penguloon/StaticUIValues.cs
@@ -21,6 +21,8 @@ namespace Penguloon
public static int IngameUIWidth { get; set; }
+ public static int BorderWidth { get; set; } = 20;
+
public static void Initialize(Main main)
{
ScreenViewport = main.GraphicsDevice.Viewport.Bounds.Size.ToVector2();