Пример #1
0
        private static void AddProjectile(Player p, Sound SND, Texture2D p_att)
        {
            p.currentState = p_att;
            Animation rangeAnimation     = new Animation();
            Texture2D player_anim_attack = p_att;

            // initlize the range attack animation
            rangeAnimation.Initialize(p.position, 46, 16, 1, 30, Color.White, 1f, true);
            RangeAttack range             = new RangeAttack();
            var         projectilePostion = p.position; // Gets the starting position of the projectile.

            if (p.isPointedRight == true)
            {
                projectilePostion.Y += 17;
                projectilePostion.X += 25;
            }
            if (p.isPointedRight == false)
            {
                projectilePostion.Y += 17;
                projectilePostion.X -= 25;
            }
            // initlize the projectile

            SND.player_attack.Play();
            range.Initialize(rangeAnimation, projectilePostion, p.isPointedRight, projectileTexture, SND);
            projectileAttack.Add(range);
        }
Пример #2
0
        private void AddProjectile(Boss E, Sound SND)
        {
            Animation rangeAnimation = new Animation();

            // initlize the range attack animation
            rangeAnimation.Initialize(E.bossPosition, 46, 16, 1, 30, Color.White, 1f, true);
            RangeAttack range             = new RangeAttack();
            var         projectilePostion = E.bossPosition; // Gets the starting position of the projectile.

            if (E.isPointedRight == true)
            {
                projectilePostion.Y += 17;
                projectilePostion.X += 25;
            }
            if (E.isPointedRight == false)
            {
                projectilePostion.Y += 17;
                projectilePostion.X -= 25;
            }
            // initlize the projectile
            SND.enemy_attack.Play();
            range.Initialize(rangeAnimation, projectilePostion, E.isPointedRight, projectileTexture, SND);
            projectileAttack.Add(range);
        }