From a42938d1553565e3d864fa46c04401bbb6f8d13f Mon Sep 17 00:00:00 2001 From: aldrikboy Date: Thu, 14 Dec 2017 23:35:47 +0100 Subject: New balloons & sounds. Objects can now shoot projectiles. --- Penguloon/Projectiles/SnowballProjectile.cs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Penguloon/Projectiles/SnowballProjectile.cs (limited to 'Penguloon/Projectiles/SnowballProjectile.cs') diff --git a/Penguloon/Projectiles/SnowballProjectile.cs b/Penguloon/Projectiles/SnowballProjectile.cs new file mode 100644 index 0000000..9f72794 --- /dev/null +++ b/Penguloon/Projectiles/SnowballProjectile.cs @@ -0,0 +1,23 @@ +using Microsoft.Xna.Framework; +using Penguloon.Objects; + +namespace Penguloon.Projectiles +{ + public class SnowballProjectile : ProjectileBase + { + public SnowballProjectile(ObjectBase ParentObject, float RotationAngle) : base(ParentObject, RotationAngle) + { + this.Texture = ContentManager.GetTexture("Bullets/penguin-ammo"); + this.Speed = 250f; + this.RotationSpeed = 5f; + this.Size = new Vector2(ParentObject.Map.TileWidth / 2, ParentObject.Map.TileHeight / 2); + this.MaxBalloonPops = 1; + + 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 -- cgit v1.2.3-70-g09d2