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; }
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); }
/// <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); } }
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); }
/// <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); }
public abstract void Update(DmlBullet bullet, DmlSystem system);