示例#1
0
 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;
 }
示例#2
0
 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;
 }
示例#3
0
        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--;
            }
        }
示例#4
0
 public SprayBullet(Vector2 position, Vector2 velocity,uint spawnCount,Bullet parent)
     : base()
 {
     constructor(position, velocity, spawnCount,parent);
 }
示例#5
0
 public static void RemoveBullet(Bullet bu1)
 {
     if (Bullets.Contains(bu1))
         Bullets.Remove(bu1);
 }
示例#6
0
 public static void AddBullet(Bullet bu1,bool team)
 {
     bu1.team = team;
     if (!Bullets.Contains(bu1))
         Bullets.Add(bu1);
 }