/// <summary> /// Allow player to shoot projectile /// </summary> /// <param name="MouseLocation">Pass in the Mouselocation point to aim projectile in that direction</param> /// <param name="battlefield">pass in battlefield in order to create the object in the map</param> public void Shoot(PointF MouseLocation, BattleField battlefield) { if (IsDead == false) { battlefield.AddProjectile(new Projectile(this.Location, MouseLocation, PROJECTILE_SPEED)); } }
public override bool Shoot(PointF playerLocation, BattleField form) { if (IsDead == false) { form.AddProjectile(new Projectile(Location, playerLocation, _projectileSpeed)); //return true after creating return(true); } //ai lost, cannot shoot projectile else { //return false return(false); } }