summaryrefslogtreecommitdiff
path: root/Penguloon/Objects
diff options
context:
space:
mode:
Diffstat (limited to 'Penguloon/Objects')
-rw-r--r--Penguloon/Objects/MortarObject.cs47
-rw-r--r--Penguloon/Objects/ObjectBase.cs7
2 files changed, 54 insertions, 0 deletions
diff --git a/Penguloon/Objects/MortarObject.cs b/Penguloon/Objects/MortarObject.cs
new file mode 100644
index 0000000..a2687d5
--- /dev/null
+++ b/Penguloon/Objects/MortarObject.cs
@@ -0,0 +1,47 @@
+using Microsoft.Xna.Framework;
+using Penguloon.Levels;
+using Penguloon.Projectiles;
+using System.Collections.Generic;
+
+namespace Penguloon.Objects
+{
+ class MortarObject : ObjectBase
+ {
+ public MortarObject(Vector2 position, Map map) : base(position, map)
+ {
+ this.Texture = ContentManager.GetTexture("Objects/mortar");
+ this.TextureBase = ContentManager.GetTexture("Objects/mortarBase");
+ this.TileSpanX = 2;
+ this.TileSpanY = 2;
+ this.Range = Map.TileWidth * 7f;
+ this.AttackSpeedMS = 4500;
+ this.infoText = map.Level.ParentScene.Main.Resources.GetString(Resource.String.ObjectCannon);
+ }
+
+ public MortarObject(Map map) : base(map)
+ {
+ this.Texture = ContentManager.GetTexture("Objects/mortar");
+ this.TextureBase = ContentManager.GetTexture("Objects/mortarBase");
+ this.TileSpanX = 2;
+ this.TileSpanY = 2;
+ this.Range = Map.TileWidth * 7f;
+ this.AttackSpeedMS = 4500;
+ this.infoText = map.Level.ParentScene.Main.Resources.GetString(Resource.String.ObjectCannon);
+ }
+
+ public override void DrawUnique(float deltaTime)
+ {
+
+ }
+
+ public override void UpdateUnique(float deltaTime)
+ {
+
+ }
+
+ public override void SpawnUnique()
+ {
+ Projectiles.Add(new CannonballProjectile(this, this.Rotation));
+ }
+ }
+} \ No newline at end of file
diff --git a/Penguloon/Objects/ObjectBase.cs b/Penguloon/Objects/ObjectBase.cs
index 9d00702..5bfdcb9 100644
--- a/Penguloon/Objects/ObjectBase.cs
+++ b/Penguloon/Objects/ObjectBase.cs
@@ -16,6 +16,7 @@ namespace Penguloon.Objects
public float Range { get; set; }
public Texture2D Texture { get; set; }
+ public Texture2D TextureBase { get; set; }
public Texture2D RangeCircle { get; set; }
public float Rotation { get; set; } = -0f;
@@ -144,6 +145,12 @@ namespace Penguloon.Objects
Map.TileWidth * TileSpanX,
Map.TileHeight * TileSpanY);
+ // Draw object base
+ if (TextureBase != null)
+ Map.ParentScene.Main.SpriteBatch.Draw(TextureBase,
+ destinationRectangle: rec,
+ origin: new Vector2(Texture.Width / 2, Texture.Height / 2));
+
// Draw projectiles before drawing the object
for (int i = 0; i < Projectiles.Count; i++)
Projectiles[i].Draw(deltaTime);