summaryrefslogtreecommitdiff
path: root/Penguloon/Projectiles
diff options
context:
space:
mode:
authoraldrikboy <aldrikboy@gmail.com>2017-12-19 10:38:30 +0100
committeraldrikboy <aldrikboy@gmail.com>2017-12-19 10:38:30 +0100
commit42671ab55f65af3ace94c50263b16898d32ac692 (patch)
treec729f98c208be07836a715d065162de7b2509289 /Penguloon/Projectiles
parenta42938d1553565e3d864fa46c04401bbb6f8d13f (diff)
yos
Diffstat (limited to 'Penguloon/Projectiles')
-rw-r--r--Penguloon/Projectiles/CannonballProjectile.cs23
1 files changed, 23 insertions, 0 deletions
diff --git a/Penguloon/Projectiles/CannonballProjectile.cs b/Penguloon/Projectiles/CannonballProjectile.cs
new file mode 100644
index 0000000..bfe04e0
--- /dev/null
+++ b/Penguloon/Projectiles/CannonballProjectile.cs
@@ -0,0 +1,23 @@
+using Microsoft.Xna.Framework;
+using Penguloon.Objects;
+
+namespace Penguloon.Projectiles
+{
+ class CannonballProjectile : ProjectileBase
+ {
+ public CannonballProjectile(ObjectBase ParentObject, float RotationAngle) : base(ParentObject, RotationAngle)
+ {
+ this.Texture = ContentManager.GetTexture("Bullets/cannon-ammo");
+ this.Speed = 450f;
+ this.RotationSpeed = 5f;
+ this.Size = new Vector2(ParentObject.Map.TileWidth / 2, ParentObject.Map.TileHeight / 2);
+ this.MaxBalloonPops = 5;
+
+ Rectangle parentRec = new Rectangle(ParentObject.Position.ToPoint(),
+ new Point(ParentObject.TileSpanX * ParentObject.Map.TileWidth, ParentObject.TileSpanY * ParentObject.Map.TileHeight));
+
+ this.Position = new Vector2(ParentObject.Position.X + (parentRec.Width / 2) - (Size.X / 2),
+ ParentObject.Position.Y + (parentRec.Height / 2) - (Size.Y / 2));
+ }
+ }
+} \ No newline at end of file