summaryrefslogtreecommitdiff
path: root/Penguloon/Objects/HealthGeneratorObject.cs
diff options
context:
space:
mode:
authoraldrikboy <aldrikboy@gmail.com>2018-01-01 23:49:59 +0100
committeraldrikboy <aldrikboy@gmail.com>2018-01-01 23:49:59 +0100
commitc3c4f2c7617c393ad6e8c7f1d87abf4a9a8cf602 (patch)
treeaff9fde951a0ecbd18aac6b32f6ccbbe82709610 /Penguloon/Objects/HealthGeneratorObject.cs
parentda38e93e55b6ff46a53dcd9d2be393149089d329 (diff)
bobba
Diffstat (limited to 'Penguloon/Objects/HealthGeneratorObject.cs')
-rw-r--r--Penguloon/Objects/HealthGeneratorObject.cs27
1 files changed, 25 insertions, 2 deletions
diff --git a/Penguloon/Objects/HealthGeneratorObject.cs b/Penguloon/Objects/HealthGeneratorObject.cs
index 460387c..bce4d78 100644
--- a/Penguloon/Objects/HealthGeneratorObject.cs
+++ b/Penguloon/Objects/HealthGeneratorObject.cs
@@ -1,4 +1,5 @@
using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
using Penguloon.Levels;
using Penguloon.Projectiles;
using System.Collections.Generic;
@@ -7,6 +8,13 @@ namespace Penguloon.Objects
{
public class HealthGeneratorObject : ObjectBase
{
+ public int HealthToRegenerate { get; set; } = 15;
+ public bool DrawText { get; set; } = false;
+ public SpriteFont Font { get; set; }
+ public string TextToDraw { get; set; }
+ public float PosY { get; set; }
+ public float PosX { get; set; }
+
public HealthGeneratorObject(Vector2 position, Map map) : base(position, map)
{
this.Texture = ContentManager.GetTexture("Objects/healthRegenerator");
@@ -16,6 +24,8 @@ namespace Penguloon.Objects
this.AttackSpeedMS = 9999999;
this.ShouldRotate = false;
this.infoText = map.Level.ParentScene.Main.Resources.GetString(Resource.String.ObjectHospital);
+
+ Font = ContentManager.GetFont(StaticUIValues.IngameFont);
}
public HealthGeneratorObject(Map map) : base(map)
@@ -27,23 +37,36 @@ namespace Penguloon.Objects
this.AttackSpeedMS = 9999999;
this.ShouldRotate = false;
this.infoText = map.Level.ParentScene.Main.Resources.GetString(Resource.String.ObjectHospital);
+
+ Font = ContentManager.GetFont(StaticUIValues.IngameFont);
}
public override void DrawUnique(float deltaTime)
{
-
+ if (DrawText)
+ Map.Level.ParentScene.DrawText(Font, TextToDraw, new Vector2(PosX, PosY), new Vector2(),
+ TextAllignment.CenterTop, Color.White,
+ Color.Black, 2);
}
public override void UpdateUnique(float deltaTime)
{
+ if (DrawText)
+ PosY -= (25 * deltaTime);
+ if (Position.Y - PosY > 75)
+ DrawText = false;
}
public override void RoundIsFinished()
{
base.RoundIsFinished();
- Map.Level.Health += 25;
+ DrawText = true;
+ TextToDraw = "+ " + HealthToRegenerate.ToString();
+ PosY = Position.Y;
+ PosX = Position.X + ((Map.TileWidth * TileSpanX) / 2);
+ Map.Level.Health += HealthToRegenerate;
}
public override void SpawnUnique()