Esempio n. 1
0
 public void Dagger()
 {
     if (dagTimer < 0)
     {
         float dagSpeed = -30f;
         if (faceRight)
         {
             dagSpeed = 30f;
         }
         if (daggerLevel == 1)
         {
             Dagger myDagger = new Dagger(daggerImage, myPosition + new Vector2(myTexture.Width / 2, myTexture.Height / 2), new Vector2(dagSpeed, 0));
             myGame.AddDagger(myDagger);
         }
         if (daggerLevel == 2)
         {
             Dagger myDagger = new Dagger(daggerImage, myPosition + new Vector2(myTexture.Width / 2, myTexture.Height / 2 + 50), new Vector2(dagSpeed, 0));
             myGame.AddDagger(myDagger);
             myDagger = new Dagger(daggerImage, myPosition + new Vector2(myTexture.Width / 2, myTexture.Height / 2 - 50), new Vector2(dagSpeed, 0));
             myGame.AddDagger(myDagger);
         }
         if (daggerLevel == 3)
         {
             Dagger myDagger = new Dagger(daggerImage, myPosition + new Vector2(myTexture.Width / 2, myTexture.Height / 2 + 90), new Vector2(dagSpeed, 0));
             myGame.AddDagger(myDagger);
             myDagger = new Dagger(daggerImage, myPosition + new Vector2(myTexture.Width / 2, myTexture.Height / 2 + 30), new Vector2(dagSpeed, 0));
             myGame.AddDagger(myDagger);
             myDagger = new Dagger(daggerImage, myPosition + new Vector2(myTexture.Width / 2, myTexture.Height / 2 - 90), new Vector2(dagSpeed, 0));
             myGame.AddDagger(myDagger);
             myDagger = new Dagger(daggerImage, myPosition + new Vector2(myTexture.Width / 2, myTexture.Height / 2 - 30), new Vector2(dagSpeed, 0));
             myGame.AddDagger(myDagger);
         }
         dagTimer = 50;
     }
 }
Esempio n. 2
0
 public void RemoveDagger(Dagger s)
 {
     myDaggers.Remove(s);
 }
Esempio n. 3
0
 public Boolean CollisionDaggerAndEnemy(Dagger M, Enemy E)
 {
     Vector2 MPos = M.getPosition();
     Vector2 EPos = E.getPosition();
     if (MPos.X + (M.getTex().Width) > EPos.X && MPos.Y + (M.getTex().Height) > EPos.Y && MPos.X + (M.getTex().Width) < EPos.X + E.getTex().Width && MPos.Y + (M.getTex().Height) < EPos.Y + E.getTex().Height
         || MPos.X + (M.getTex().Width) > EPos.X && MPos.Y > EPos.Y && MPos.X + (M.getTex().Width) < EPos.X + E.getTex().Width && MPos.Y < EPos.Y + E.getTex().Height
         || MPos.X > EPos.X && MPos.Y + (M.getTex().Height) > EPos.Y && MPos.X < EPos.X + E.getTex().Width && MPos.Y + (M.getTex().Height) < EPos.Y + E.getTex().Height
         || MPos.X > EPos.X && MPos.Y > EPos.Y && MPos.X < EPos.X + E.getTex().Width && MPos.Y < EPos.Y + E.getTex().Height)
     {
         return true;
     }
     return false;
 }
Esempio n. 4
0
 public void AddDagger(Dagger s)
 {
     myDaggers.Add(s);
 }