Hey guys, i have a problem accesing a value out of a world subclass from my actor subclass because im getting a nullpointer exception.
I can get a value directly from the world subclass aka. System.out.println(s2); so that means it should not be null.
My actor class:
My world class:
What do i do wrong?
Thx in advance!
Projectile(){ AntWorld antWorld = (AntWorld) getWorld(); System.out.println(antWorld.getS2()); }
public int getS2() { int s2 = getObjects(S2.class).size(); System.out.println(s2); return s2; }