BoundingBox( Rectangle ) class, help?

Ok, so for my game, I need to check collisions, and I thought the best way would be to create bounding boxes ( aka Rectangles ) around all my objects. I know that there is a Rectangle class somewhere in the Java API. but I need one with a little more precision. I cannot use any external libraries in my project, so I can’t use any of lwjgl features or of libgdx features.

I have created a class, I have tried testing it, but I’m not too sure if I’m testing it wrong, or if there is a problem in my class.

Can someone please read over it and tell me if its wrong, or where i should improve something?

The code will be in the pastebin : http://pastebin.java-gaming.org/d409e4c4246

Thanks

~ Scyth

You have way too many unnecessary functions and variables. Here’s a class I made a long time ago: http://www.java-gaming.org/?action=pastebin&id=445 http://www.java-gaming.org/?action=pastebin&id=446

When you say you need more “precision”, what do you mean?

That is very neat and tidy, and small, but how would I go about checking of something specifically intersected the top, bottom, left or right of the bounds? that’s why I have so many functions.

Make little rectangles on each side.
Like this:
http://info.sonicretro.org/SPG:Solid_Tiles