summaryrefslogtreecommitdiff
path: root/Penguloon/Objects
diff options
context:
space:
mode:
authoraldrikboy <aldrikboy@gmail.com>2018-01-16 14:49:40 +0100
committeraldrikboy <aldrikboy@gmail.com>2018-01-16 14:49:40 +0100
commit6996be0fc143085b6aa459f2eb7b288ac1617c0b (patch)
tree55f5ca1e95dc52cf9a1e81a0250fb9436e5ec6a9 /Penguloon/Objects
parent1f5295752f9052c2b7b64660fa36293f18de73d0 (diff)
upgrade sounds
Diffstat (limited to 'Penguloon/Objects')
-rw-r--r--Penguloon/Objects/ObjectBase.cs33
-rw-r--r--Penguloon/Objects/ObjectUpgrade.cs15
-rw-r--r--Penguloon/Objects/PenguinObject.cs4
3 files changed, 48 insertions, 4 deletions
diff --git a/Penguloon/Objects/ObjectBase.cs b/Penguloon/Objects/ObjectBase.cs
index e5d9fe5..ee2b04c 100644
--- a/Penguloon/Objects/ObjectBase.cs
+++ b/Penguloon/Objects/ObjectBase.cs
@@ -11,13 +11,22 @@ namespace Penguloon.Objects
public abstract class ObjectBase
{
public int AttackSpeedMS { get; set; }
+ public int AttackSpeedMSBase { get; set; }
+
public DateTime LastAttack { get; set; }
public float Range { get; set; }
+ public float RangeBase { get; set; }
public Texture2D Texture { get; set; }
public Texture2D TextureBase { get; set; }
public Texture2D RangeCircle { get; set; }
+
+ public Texture2D InfoPanelTexture { get; set; }
+ public Texture2D InfoPanelLineTexture { get; set; }
+ public Vector2 InfoPanelPos { get; set; }
+ public float InfoPanelRotation { get; set; } = -0f;
+
public float Rotation { get; set; } = -0f;
public Vector2 Position { get; set; }
@@ -44,7 +53,31 @@ namespace Penguloon.Objects
this.Map = map;
this.Position = position;
+ this.AttackSpeedMSBase = AttackSpeedMS;
+ this.RangeBase = Range;
+
CreateUpgrades();
+
+ SetInfoPanel();
+ }
+
+ private void SetInfoPanel()
+ {
+ InfoPanelTexture = ContentManager.GetTexture("UI/objectinfo");
+ InfoPanelLineTexture = ContentManager.GetTexture("UI/objectinfo-line");
+
+ InfoPanelPos = new Vector2();
+
+ // alight right
+ if (Position.X < 450)
+ {
+
+ }
+ // alight left
+ else
+ {
+
+ }
}
public ObjectBase(Map map)
diff --git a/Penguloon/Objects/ObjectUpgrade.cs b/Penguloon/Objects/ObjectUpgrade.cs
index 278a1fb..a72edd4 100644
--- a/Penguloon/Objects/ObjectUpgrade.cs
+++ b/Penguloon/Objects/ObjectUpgrade.cs
@@ -21,6 +21,7 @@ namespace Penguloon.Objects
PopCount,
Speed,
Money,
+ Range,
}
public enum UpgradeState
@@ -66,6 +67,7 @@ namespace Penguloon.Objects
case UpgradeType.Money: Icon = ContentManager.GetTexture("UI/money"); break;
case UpgradeType.PopCount: Icon = ContentManager.GetTexture("UI/explosion"); break;
case UpgradeType.Speed: Icon = ContentManager.GetTexture("UI/speed"); break;
+ case UpgradeType.Range: Icon = ContentManager.GetTexture("UI/radar"); break;
}
}
@@ -80,6 +82,10 @@ namespace Penguloon.Objects
SpriteFont font = ContentManager.GetFont(StaticUIValues.IngameFont);
int textHeight = (int)font.MeasureString(Text).Y;
+ int textWidth = (int)font.MeasureString(Text).X;
+
+ int costHeight = (int)font.MeasureString("$" + Cost.ToString() + ",-").Y;
+ int costWidth = (int)font.MeasureString("$" + Cost.ToString() + ",-").X;
if (State == UpgradeState.Idle)
spriteBatch.Draw(Background, destinationRectangle: new Rectangle(
@@ -101,8 +107,13 @@ namespace Penguloon.Objects
(int)StaticUIValues.UpgradePanelSize.Y / 2));
spriteBatch.DrawString(ContentManager.GetFont(StaticUIValues.IngameFont),
- Text, new Vector2(ParentLevel.Map.MapWidth + StaticUIValues.BorderWidth + 90,
- startY + ((int)StaticUIValues.UpgradePanelSize.Y * index) + (int)(StaticUIValues.UpgradePanelSize.Y / 2) - textHeight / 2),
+ Text, new Vector2(StaticUIValues.ScreenViewport.X - 20 - textWidth,
+ startY + ((int)StaticUIValues.UpgradePanelSize.Y * index) + (int)(StaticUIValues.UpgradePanelSize.Y / 3) - textHeight / 2),
+ Color.FromNonPremultiplied(20, 20, 20, 255));
+
+ spriteBatch.DrawString(ContentManager.GetFont(StaticUIValues.IngameFont),
+ "$" + Cost.ToString() + ",-", new Vector2(StaticUIValues.ScreenViewport.X - 20 - costWidth,
+ startY + ((int)StaticUIValues.UpgradePanelSize.Y * index) + (int)(StaticUIValues.UpgradePanelSize.Y / 2) + (int)(StaticUIValues.UpgradePanelSize.Y / 4) - costHeight / 2),
Color.FromNonPremultiplied(20, 20, 20, 255));
spriteBatch.Draw(ContentManager.GetTexture("UI/objectSelectionBorder"),
diff --git a/Penguloon/Objects/PenguinObject.cs b/Penguloon/Objects/PenguinObject.cs
index 7d3f259..5310262 100644
--- a/Penguloon/Objects/PenguinObject.cs
+++ b/Penguloon/Objects/PenguinObject.cs
@@ -29,10 +29,10 @@ namespace Penguloon.Objects
public override void CreateUpgrades()
{
- ObjectUpgrade upg = new ObjectUpgrade(100, UpgradeType.PopCount, "+2 pop", null, Map.Level);
+ ObjectUpgrade upg = new ObjectUpgrade(12341234, UpgradeType.PopCount, "+2 pop", null, Map.Level);
UpgradeList.Add(new ObjectUpgrade(100, UpgradeType.PopCount, "+1 pop", upg, Map.Level));
- UpgradeList.Add(new ObjectUpgrade(100, UpgradeType.Speed, "+15 Speed", null, Map.Level));
+ UpgradeList.Add(new ObjectUpgrade(100, UpgradeType.Range, "+15 Range", null, Map.Level));
}
public override void DrawUnique(float deltaTime)