A bullet object meant to hurt people, porcupines, or pinapple. Bullets inherit from projectile and add the capacity to deal damage. In this initial implementation, they will be a leaf class with its own image etc...
Inheritance: Projectile
Exemplo n.º 1
0
        /// <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--;
        }
Exemplo n.º 2
0
        /// <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--;
        }