loxtn10 wrote...
Nullpointerexception when i click x. the current code for when x is clicked and near the shop the show becomes 1;
public void act()
{
getImage().setTransparency(0);
show = 0;
if((isTouching(meh.class) || isTouching(meh2.class) ) && ("x".equals (Greenfoot.getKey())))
{
Greenfoot.getKey();
show = 1;
}
} if((isTouching(meh.class) || isTouching(meh2.class) && Greenfoot.isKeyDown ("x"))after the show gets 1 value this code then happens
< Code Omitted >
then proceeds to thes after opening the shop.
RIGHT BEFORE THE SHOP OPENS nullpointerexception happens in this code. I've already cleared the Greenfoot.getKey() which means no more registered key. but nullpointerexception happens
< Code Omitted >
Remove all 'Greenfoot.getKey()' operations and comparisons in the srrfc class.


