diff options
| author | aldrikboy <aldrikboy@gmail.com> | 2018-01-02 23:36:55 +0100 |
|---|---|---|
| committer | aldrikboy <aldrikboy@gmail.com> | 2018-01-02 23:36:55 +0100 |
| commit | a05ae287aa87259817e6ca7627986e14eeab6098 (patch) | |
| tree | 18578b24ab1c35aec05c465fbdc0af517b716fed /Penguloon/Objects | |
| parent | 0c58f5048e37ad40c68f56f3dc7756d60816cc0e (diff) | |
dank
Diffstat (limited to 'Penguloon/Objects')
| -rw-r--r-- | Penguloon/Objects/MortarObject.cs | 47 | ||||
| -rw-r--r-- | Penguloon/Objects/ObjectBase.cs | 7 |
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); |
