I tries using this line:
<< Code Omitted >>
and I got an error that says "cannot find symbol". Please help!
The isKeyDown method is a member of the Greenfoot class. It is not in the class you are calling it from. You must (dot) prefix the call with the class name:
YAY! Greenfoot.isKeyDown(...
Footnote: Prefixing with a class name only works on methods that are declared static. Non-static methods must be called on an object (or, instance) of the class the method is found in.
That means all methods in the class greenfoot.Greenfoot works only with the class Greenfoot as prefix as danpost explaned! (Example Greenfoot.setWorld(), Greenfoot.getKey() and so on...) Because they are all static.
See in the Greenfoot.API
All other classes in the greenfoot package are non-static methods except some greenfoot.UserInfo() methods.