TIPS FOR DEBUGGING
1. Write small amounts of code, then test it! Try not to write many lines of code without testing. You don't know which of the many is the problem, while if you write one line, you know the error has to be in the line you just wrote. (It might not do anything on the screen, but it will throw an error in the console if your code has an issue.)
2. Check to make sure your braces match up! Functions need open and close curly braces, as do if, else, for, and while.
3. Check for parentheses. If statements and loops need to have open and close parentheses, but you might also have them at the end of method calls.
4. Spelling. That includes upper and lower case letters. "thisThing" is utterly different from "thisthing" to a computer. It will be so offended by your spelling it won't even run your code.
5. If you are having trouble narrowing down what the problem is, try commenting out sections of your code. (Don't erase it!) Then slowly uncomment the code until you find the line that is the problem.
Setup
Drawing
Force
Collisions
Zooming (There's a problem with how I do this! Can you figure out what I did wrong?)
Things to Alter