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: 846
        
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):
- Make my own Collision detection class that extends Rectangle class.
 - 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? - I want to extend Rectangle class because of the 
contains()andintersects()methods; should I be doing that or should I be doing something else for 2D collision detection in Java? 
© Stack Overflow or respective owner