When I compile the code, all is ok, but when i try to run it, it says everytime "java.lang.NullpointerException". Why?
it marked "if(mi.getActor()==start){"
it marked "if(mi.getActor()==start){"
it marked "if(mi.getActor()==start){"
if(gamestatus==1){
MouseInfo mi=Greenfoot.getMouseInfo();
if(mi.getActor()!=null){
if(mi.getActor()==start) setImage("Clear.png");
}
}
if(gamestatus==1){
MouseInfo mi=Greenfoot.getMouseInfo();
if(mi.getActor()!=null && mi.getActor()==start) setImage("Clear.png");
}
if(mi.getActor()!=null){ if(mi != null){
The spf.addObject... was marked
Just the NullpointerException, the other Errors are cleared.