public SinBullet(Vector2 position, Vector2 velocity, float angle, Bullet parent) : base() { sprite = new Sprite(Utility.ContentStorageManager.Get<Texture2D>("Shape01"), position); //Temp sprite.CenterOriginOnTexture(); this.angle = angle; sprite.Scale = .5f; sprite.Color = Color.Chartreuse; this.Position = position; this.velocity = velocity; }
public OrbitBullet(Vector2 position, Vector2 velocity, float angle, Bullet parent) : base() { this.parent = parent; this.angle = angle; sprite = new Sprite(Utility.ContentStorageManager.Get<Texture2D>("Shape01"), parent.Position); //Temp sprite.CenterOriginOnTexture(); sprite.Scale = .5f; this.Position = parent.Position; this.velocity = parent.velocity; }
private void constructor(Vector2 position, Vector2 velocity, uint spawnCount,Bullet parent) { sprite = new Sprite(Utility.ContentStorageManager.Get<Texture2D>("Shape01"), position); //Temp sprite.CenterOriginOnTexture(); sprite.Scale = .50f; sprite.Color = Color.Aquamarine; this.spawnCount = spawnCount - 1; this.Position = position; this.velocity = velocity; this.parent = parent; while (spawnCount > 0 && this.spawnCount>0) { Vector2 newVelocity = new Vector2(velocity.Y / (float)spawnCount / 3f, velocity.Y); //new Vector2( (float)Math.Cos(angle),-1* (float)Math.Sin(angle)); ObjectManager.AddBullet(new SprayBullet(position + newVelocity, newVelocity, 1, this),true); newVelocity.X *= -1; //new Vector2( (float)Math.Cos(angle),-1* (float)Math.Sin(angle)); ObjectManager.AddBullet(new SprayBullet(position + newVelocity, newVelocity, 1, this),true); spawnCount--; } }
public SprayBullet(Vector2 position, Vector2 velocity,uint spawnCount,Bullet parent) : base() { constructor(position, velocity, spawnCount,parent); }
public static void RemoveBullet(Bullet bu1) { if (Bullets.Contains(bu1)) Bullets.Remove(bu1); }
public static void AddBullet(Bullet bu1,bool team) { bu1.team = team; if (!Bullets.Contains(bu1)) Bullets.Add(bu1); }