i've made most of the logic for my 'block based game' upon my Background class, which is a subclass of world.
I tryed this code out:
if(Greenfoot.mouseClicked(this))
{
CurrentShape.moveRight();
}
which worked fine, but obviously using the mouse to move right isn't ideal so i tried loads using the keyboard, particularly the one which is actually given in the programmer manual (http://www.greenfoot.org/doc/manual.html#keyboard)
if(Greenfoot.getKey().equals("space")
{
some code here
}
but it just keeps giving me a NullPointerException pointing to the getKey line of code. help?