Collision Detection - Java - Rectangle

Posted by Trizicus on Stack Overflow See other posts from Stack Overflow or by Trizicus
Published on 2010-03-19T16:20:04Z Indexed on 2010/03/19 16:31 UTC
Read the original article Hit count: 721

Filed under:
|
|
|

I would like to know if this is a good idea that conforms to best practices that does not lead to obscenely confusing code or major performance hit(s):

  1. Make my own Collision detection class that extends Rectangle class.
  2. Then when instantiating that object doing something such as Collision col = new Rectangle(); <- Should I do that or is that something that should be avoided? I am aware that I 'can' but should I?
  3. I want to extend Rectangle class because of the contains() and intersects() methods; should I be doing that or should I be doing something else for 2D collision detection in Java?

© Stack Overflow or respective owner

Related posts about java

Related posts about collision-detection