This is actually my final project for the semester for my CS course.
Written from scratch using Java, the main focus has been optimizing collision detection.
The collision objects are added to a sorted list, kept sorted from frame to frame.
This exploits Temporal Coherence
http://en.wikipedia.org/wiki/Collision_ ... _coherence in the fact that most objects do not move a great deal from each frame to the next, so it is easy to keep a list sorted when adding or removing objects.
I use a Binary Search to effectively Sweep And Prune all objects that can not collide with the object in question, before applying an Axis Aligned Bounding Box collision algorithm.