0

So I have a class. In this class I have a timer which repeats every 100 millisecs. I want to check If 2 objects collidate. Everthing is fine with rectangles and circles but custom images won't work or do only collide with one rectangle on the screen which is very weird.

private boolean checkCollision(GameObject ob1, GameObject ob2) {
     if(ob1.getBounds().intersects(ob2.getBounds())) return true;
     return false;
}
Jan T.
  • 43
  • 6
  • Use the code seen in [this answer](https://stackoverflow.com/a/7059497/418556) to get shapes based on the image, then use the code seen in [this answer](https://stackoverflow.com/a/14575043/418556) to determine when it collides with other shapes. – Andrew Thompson May 24 '20 at 00:54
  • Found my mistake.. I'm so stupid I have a method to enable and disable collision for objects I disabled it for every object .... – Jan T. May 24 '20 at 20:28

0 Answers0