Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Codejunkie

Pages: [1]
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?

Pages: [1]
anything