Esempio n. 1
0
 public Boolean CollisionBoltAndEnemy(Bolt B, Enemy E)
 {
     Vector2 MPos = B.getPosition();
     Vector2 EPos = E.getPosition();
     if (MPos.X + (B.getBolt1().Width) > EPos.X && MPos.Y + (B.getBolt1().Height) > EPos.Y && MPos.X + (B.getBolt1().Width) < EPos.X + E.getTex().Width && MPos.Y + (B.getBolt1().Height) < EPos.Y + E.getTex().Height
         || MPos.X + (B.getBolt1().Width) > EPos.X && MPos.Y > EPos.Y && MPos.X + (B.getBolt1().Width) < EPos.X + E.getTex().Width && MPos.Y < EPos.Y + E.getTex().Height
         || MPos.X > EPos.X && MPos.Y + (B.getBolt1().Height) > EPos.Y && MPos.X < EPos.X + E.getTex().Width && MPos.Y + (B.getBolt1().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;
 }