i have some Problems with an Error Code!
This is my Code at the zombieSpawnSystem class:
Please Help me to fix the code and don't get the error :)))
java.lang.NullPointerException at ZombieSpawnSystem.toteZombies10(ZombieSpawnSystem.java:39) at ZombieSpawnSystem.act(ZombieSpawnSystem.java:21)
public class ZombieSpawnSystem extends Actor
{
public void act()
{
if(this !=null)
{
spawn();
toteZombies10();
}
}
public void spawn()
{
if(Greenfoot.getRandomNumber(100) == 1)
{
getWorld().addObject(new Zombie(), Greenfoot.getRandomNumber(getWorld().getWidth()), 0);
}
}
public void toteZombies10()
{
if(Zombie.toteZombies == 10)
{
getWorld().removeObject(this);
getWorld().addObject(new ZombieSpawnSystem2(), 437, 212);
}
}
}

