/// <summary> /// Shoots a bullet. /// </summary> /// <param name="gameReference">A reference to the entire game thiny.</param> /// <param name="holder">A reference to the holder character.</param> private void shootABullet(Pantheon gameReference, CharacterEntity holder) { Bullet bullet = new Bullet(holder.Location + new Vector2((float)(41*Math.Cos(holder.AngleFacing)), (float)(41*Math.Sin(holder.AngleFacing))), 41, holder.AngleFacing, range, damage, gameReference); bullet.Load(gameReference.Content); gameReference.currentLevel.addList.Add("bullet_" + Bullet.NextId, bullet); //Drain a bullet from the current ammo currentAmmo--; }
/// <summary> /// Shoots a bullet. /// </summary> /// <param name="gameReference">A reference to the entire game thiny.</param> /// <param name="holder">A reference to the holder character.</param> private void shootABullet(Pantheon gameReference, CharacterEntity holder) { Bullet bullet = new Bullet(new Vector2(holder.DrawingBox.Center.X, holder.DrawingBox.Center.Y) + new Vector2((float)(72*Math.Cos(holder.AngleFacing)), (float)(72*Math.Sin(holder.AngleFacing))), speed, holder.AngleFacing, range, damage, gameReference); bullet.Load(gameReference.Content, bulletType); gameReference.currentLevel.addList.Add("bullet_" + Bullet.NextId, bullet); gameReference.audioManager.playSoundEffect(this.soundCueName); //Drain a bullet from the current ammo currentAmmo--; }