Пример #1
0
        public DmlObject Instantiate(Vector2 Position, DmlSystem system)
        {
            DmlBullet bullet = new DmlBullet(Position, this);
            DmlObject bulletObject = new DmlObject(DmlType.Bullet, bullet);
            bullet.SetObject(bulletObject);

            // Execute the initialziation code.
            Init.Execute(bulletObject, system);

            return bulletObject;
        }
Пример #2
0
        public DmlObject Instantiate(Vector2 Position, DmlSystem system)
        {
            DmlBullet bullet       = new DmlBullet(Position, this);
            DmlObject bulletObject = new DmlObject(DmlType.Bullet, bullet);

            bullet.SetObject(bulletObject);

            // Execute the initialziation code.
            Init.Execute(bulletObject, system);

            return(bulletObject);
        }
Пример #3
0
 /// <summary>
 /// Add a bullet to the system.
 /// </summary>
 /// <param name="bullet"></param>
 public void AddBullet(DmlBullet bullet)
 {
     if (Bullets.Count >= DmlSystem.BULLET_CAP)
     {
         return;
     }
     if (Begun)
     {
         ToAdd.Add(bullet);
     }
     else
     {
         Bullets.Add(bullet);
     }
 }
Пример #4
0
 public bool BulletCollide(DmlBullet bullet)
 {
     Vector2 bpos=bullet.Position;
     return Math.Pow(bpos.X - position.X, 2) + Math.Pow(bpos.Y - position.Y, 2) < Math.Pow(bullet.bulletRadius + radius, 2);
 }
Пример #5
0
 /// <summary>
 /// Add a bullet to the system.
 /// </summary>
 /// <param name="bullet"></param>
 public void AddBullet(DmlBullet bullet)
 {
     if (Bullets.Count >= DmlSystem.BULLET_CAP)
         return;
     if (Begun)
         ToAdd.Add(bullet);
     else
         Bullets.Add(bullet);
 }
Пример #6
0
 public abstract void Update(DmlBullet bullet, DmlSystem system);