2 using System.Collections.Generic;
5 using Microsoft.Xna.Framework;
6 using Microsoft.Xna.Framework.Graphics;
8 namespace SuperPolarity
12 public Texture2D Texture { get; set; }
13 public Vector2 Position { get; set; }
14 public Vector2 Velocity { get; set; }
15 public float Angle { get; set; }
16 public float AngularVelocity { get; set; }
17 public Color Color { get; set; }
18 public float Size { get; set; }
19 public int TTL { get; set; }
21 public Particle(Texture2D texture, Vector2 position, Vector2 velocity,
22 float angle, float angularVelocity, Color color, float size, int ttl)
28 AngularVelocity = angularVelocity;
38 Angle += AngularVelocity;
41 public void Draw(SpriteBatch spriteBatch)
43 Rectangle sourceRectangle = new Rectangle(0, 0, Texture.Width, Texture.Height);
44 Vector2 origin = new Vector2(Texture.Width / 2, Texture.Height / 2);
46 spriteBatch.Draw(Texture, Position, sourceRectangle, Color,
47 Angle, origin, Size, SpriteEffects.None, 0f);