2 using System.Collections.Generic;
5 using Microsoft.Xna.Framework;
6 using Microsoft.Xna.Framework.Graphics;
8 namespace SuperPolarity
12 protected ParticleEngine particleEngine;
15 public Bullet(SuperPolarity newGame)
22 particleEngine = null;
25 public override void Initialize(Texture2D texture, Vector2 position)
27 base.Initialize(texture, position);
34 particleEngine = ParticleEffectFactory.CreateBullet(position);
37 public override void Update(GameTime gameTime)
39 Velocity.X = (float)(MaxVelocity * Math.Cos(Angle));
40 Velocity.Y = (float)(MaxVelocity * Math.Sin(Angle));
47 particleEngine.Update();
48 particleEngine.EmitterLocation = Position;
51 public override void Draw(SpriteBatch spriteBatch)
53 base.Draw(spriteBatch);
54 particleEngine.Draw(spriteBatch);
57 public override void Collide(Actor other, Rectangle collision)
59 if (Dying) { return; }
60 if (other.GetType().IsAssignableFrom(typeof(StandardShip)))
67 protected override void Die()
69 ActorManager.CheckOut(this);
70 Renderer.CheckOut(this);
71 Parent.Children.Remove(this);
74 public override void CleanUp()
77 this.particleEngine = null;