1
Java / Collision Detection
« on: August 24, 2015, 02:28:46 am »
Hi, I'm somewhat new to java game development and thought I'd give SFML a try. I'm trying to do some basic collision detection. For some reason it's not detecting anything. Here's my function for my collision:
Code: [Select]
public static boolean isColliding(ArrayList<Sprite> sprites, Sprite spriteA){
boolean result = false;
for(Sprite sprite : sprites){
if(spriteA.getGlobalBounds().intersection(sprite.getGlobalBounds())!= null){
result = true;
break;
}
}
return result;
}
Am I on the right track at least?