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
1 2 3 4 5 6 7 8 9 10 | 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 ; } } |