So I been messing around doing random stuff with code and I just reached a point where I’m testing collision detection, one of the test I started with is the one on the pastebins I linked at the end of this post
What it’s supposed to do is to draw rectangles and they are supposed to bounce around the screen until it finds another rectangle or the border of the screen. It all works good until theres way too much rectangles and they start overlapping and it just is a mess, because they start changing direction like they should but its never supposed to overlap because they stay on the same position.
I hope someone understand what I’m trying to say, heres the links and thanks in advance for the help.
http://pastebin.java-gaming.org/930c87c26
http://pastebin.java-gaming.org/4872a892a
http://pastebin.java-gaming.org/025d09227