Press space to switch the shape following your mouse. Try moving the shape near the circles and rectangles! I'm cheating a little for circle v. rectangle collisions, but otherwise, these collisions use the Separating Axis Theorem. Basically, if you can find a line that separates the two shapes, they aren't colliding. If you can't, they are colliding. In 2D, the separating line is always perpendicular to a normal vector of one of the shapes.
Heyoooo, I put in all the formulas for rectangle v. rectangle collisions and it worked correctly the first time. These two sources have been incredibly helpful so far: http://www.metanetsoftware.com/technique/tutorialA.html http://www.jkh.me/files/tutorials/Separating%20Axis%20Theorem%20for%20Oriented%20Bounding%20Boxes.pdf