예제 #1
0
 public void createJumpParticle(float xPos, float yPos, Direction direction)
 {
     if (direction == Direction.Right)
     {
         particles.Add(jumpEffect.NewInstance((int)xPos - jumpEffect.FrameWidth, (int)yPos - jumpEffect.FrameHeight, false, direction));
     }
     else
     {
         particles.Add(jumpEffect.NewInstance((int)xPos, (int)yPos - jumpEffect.FrameHeight, false, direction));
     }
 }
예제 #2
0
        public void createHitparticle(Rectangle hitSection, HitType hitType)
        {
            Vector2 center = new Vector2(hitSection.X + (hitSection.Width / 2), hitSection.Y + (hitSection.Height / 2));

            if (hitType == HitType.IMPACT)
            {
                int xPos = ((int)center.X - punchEffect.FrameHeight / 2);
                int yPos = (int)center.Y - punchEffect.FrameWidth / 2;
                particles.Add(punchEffect.NewInstance(xPos, yPos, true));
            }
            else if (hitType == HitType.BLOCK)
            {
                int xPos = ((int)center.X - blockEffect.FrameHeight / 2);
                int yPos = (int)center.Y - blockEffect.FrameWidth / 2;
                particles.Add(blockEffect.NewInstance(xPos, yPos, true));
            }
            else if (hitType == HitType.HORN_HIT)
            {
                int xPos = ((int)center.X - spikySlashEffect.FrameHeight / 2);
                int yPos = (int)center.Y - spikySlashEffect.FrameWidth / 2;
                particles.Add(spikySlashEffect.NewInstance(xPos, yPos, true));
            }
            else if (hitType == HitType.HORN_IMPACT)
            {
                int xPos = ((int)center.X - spikyImpactEffect.FrameWidth);
                int yPos = (int)center.Y - spikyImpactEffect.FrameHeight / 2;
                particles.Add(spikyImpactEffect.NewInstance(xPos, yPos, false));
            }
            else if (hitType == HitType.SWORD_STRONG)
            {
                int xPos = ((int)center.X - impactSlashEffect.FrameHeight / 2);
                int yPos = (int)center.Y - impactSlashEffect.FrameWidth / 2;
                particles.Add(impactSlashEffect.NewInstance(xPos, yPos, true));
            }
            else
            {
                int xPos = ((int)center.X - slashEffect.FrameHeight / 2);
                int yPos = (int)center.Y - slashEffect.FrameWidth / 2;
                particles.Add(slashEffect.NewInstance(xPos, yPos, true));
            }
        }
예제 #3
0
 public void createDashParticle(float xPos, float yPos, Direction direction)
 {
     particles.Add(dashEffect.NewInstance((int)xPos, (int)yPos - dashEffect.FrameHeight, false, direction));
 }