Ejemplo n.º 1
0
 public bool checkCollision(CollisionSprite s1, CollisionSprite s2)
 {
     if (s1.getPosX() - (s1.getWidth() / 2) < s2.getPosX() + (s2.getWidth() / 2) && s1.getPosX() + (s1.getWidth() / 2) > s2.getPosX() - (s2.getWidth() / 2))
     {
         if (s1.getPosY() - (s1.getHeight() / 2) < s2.getPosY() + (s2.getHeight() / 2) && s1.getPosY() + (s1.getHeight() / 2) > s2.getPosY() - (s2.getHeight() / 2))
         {
             return(true);
         }
     }
     return(false);
 }
Ejemplo n.º 2
0
 public float getPosX()
 {
     return(boundaryBox.getPosX());
 }