How do you create an instance variable in Greenfoot?
Greenfoot uses Java; so you should ask how to create one there (in Java).
In java, instance fields are defined as non-static variables within classes. There are not the local variables defined within methods -- they are declared outside of any method in the class. At minimum, you need a declared type and a legal (standard java naming procedure) user-defined name:
type name;
The type can any of the primitive types (int, double, long, boolean, byte, char, float ... others?) or it can be an Object type (Actor, World, String, Integer, etc. or the type of a class you have defined). An array is a type of Object, as well. The field declaration line can start with an access modifier (public, protected, private); it can be modified to make it a constant (final). The field can also be assigned an initial value. Examples follows:
private final int GRAVITY = 2;
protected int vSpeed;
public int[][] map = new int[10][10];
By convention, the names of constants are in all uppercase with words separated with an underscore ("_"). Normal variables are in lowercase characters with all but the first world beginning with an uppercase character. Only alpha characters and the underscore are allowed in names.