Hello,
following code throws me a NullPointException and i cant figure out why:
It should and an Obect at the Location of an Gegner1.class Object, but it doesnt work.
can somebody help me?
thanks in advance
public void checkMouse(){
if(Greenfoot.mouseClicked(null) && !gotTarget){
Actor f = getOneObjectAtOffset(300,300,Gegner1.class);
getWorld().addObject(new Spell3(), f.getX(), f.getY());
gotTarget=true;
}
}
