0

I am working on a Java project where some Sprites can move around, be rotated, and be resized.

Is there any way for me to get pixel perfect collision detection for both rotated and resized images?

Mike Laren
  • 8,028
  • 17
  • 51
  • 70
Jaboyc
  • 567
  • 1
  • 8
  • 16
  • 1
    Yes there is. If you're asking for code, then I'm going to vote to close as too broad. – Jashaszun Jul 06 '15 at 21:38
  • Welcome to StackOverflow! To help others answer your question better, please include details about what you have already tried, and also possibly some more details about your problem. – ricky3350 Jul 06 '15 at 21:45
  • Do you only care if pixels collide or do you have a collision box/shape instead? – MadProgrammer Jul 06 '15 at 23:46
  • Using a collision box/shape would be simpler, something like [this for example](http://stackoverflow.com/questions/20927189/detecting-collision-of-two-sprites-that-can-rotate/20928531#20928531), you could compound shapes together to generate a more complex collision box as required. But, you could also use something like [this example](http://stackoverflow.com/questions/23332096/how-to-detect-if-two-images-collide-in-java/23332186#23332186) to detect if non-transparent pixels overlap, which is more labor intensify, so you'll likely take a performance hit for it – MadProgrammer Jul 06 '15 at 23:53
  • I would prefer pixel perfect Collision but rectangles are okay – Jaboyc Jul 07 '15 at 00:14

0 Answers0