Exemplo n.º 1
0
 public Dragon(Texture2D effect, Vector2 pos, Vector2 dimension, Texture2D fireBreath) :
     base(effect, pos, new Vector2((dimension.X / (NUM_FRAMES * 2)), dimension.Y))
 {
     BodyType     = BodyType.Dynamic;
     flapEffect   = effect;
     flameTexture = fireBreath;
     breath       = null;
     isBreathing  = false;
     Density      = DEFAULT_DENSITY;
     Friction     = DEFAULT_FRICTION;
     Restitution  = DEFAULT_RESTITUTION;
     isOnFire     = false;
     id           = ID;
     ID++;
     currCooldown     = 0;
     delayTime        = 0;
     currentFireLevel = FULL_FIRE_LEVEL;
 }
Exemplo n.º 2
0
 public void breathFire()
 {
     if (currentFireLevel > 0 && !fireReset)
     {
         isBreathing = true;
         bool fliped = false;
         if (force.X < 0)
         {
             fliped = true;
             if (id == 0)
             {
                 breath = new FireBreath(flameTexture, new Vector2(Position.X - 6.5f, Position.Y + 2.1f), fliped, false, Position);//breath = new FireBreath(flameTexture, new Vector2(Position.X - 6.5f, Position.Y + 2.1f), new Vector2(10.0f, 10.0f), fliped, false, Position);
             }
             else
             {
                 breath = new FireBreath(flameTexture, new Vector2(Position.X - 6.5f, Position.Y + 2.1f), fliped, true, Position);  //new FireBreath(flameTexture, new Vector2(Position.X - 6.5f, Position.Y + 2.1f), new Vector2(10.0f, 10.0f), fliped, true, Position);
             }
         }
         else
         {
             fliped = false;
             if (id == 0)
             {
                 breath = new FireBreath(flameTexture, new Vector2(Position.X + 6.5f, Position.Y + 2.1f), fliped, false, Position);//breath = new FireBreath(flameTexture, new Vector2(Position.X + 6.5f, Position.Y + 2.1f), new Vector2(10.0f, 10.0f), fliped, false, Position);
             }
             else
             {
                 breath = new FireBreath(flameTexture, new Vector2(Position.X + 6.5f, Position.Y + 2.1f), fliped, true, Position); //breath = new FireBreath(flameTexture, new Vector2(Position.X + 6.5f, Position.Y + 2.1f), new Vector2(10.0f, 10.0f), fliped, true, Position);
             }
         }
         currentFireLevel--;
         currentFireLevel--;
         currentFireLevel--;
         if (currentFireLevel <= 0)
         {
             fireReset = true;
         }
     }
     else
     {
         breath      = null;
         isBreathing = false;
     }
 }
Exemplo n.º 3
0
 public void stopBreathing()
 {
     breath      = null;
     isBreathing = false;
 }