Problem is in the levels here my code:
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) public class Zombie extends Actor { private GreenfootImage zombieAnim1 = new GreenfootImage("Zombieanim.png"); private GreenfootImage zombieAnim2 = new GreenfootImage("Zombieanim2.png"); private GreenfootImage zombieAnim3 = new GreenfootImage("Zombieanim3.png"); private int frame = 1; private int animationCount = 0; private int health = 200; private int level = 0; private Counter counter; public Zombie(Counter pointCounter) { counter = pointCounter; } public void act() { AI(); if(animationCount % 12 == 0) animationWalk(); animationCount ++; eat(); death(); level(); } public void level() { if(level == 0) { move(1); } else if(level == 10) { move(2); } else if(level == 20) { move(3); } else if(level == 40) { move(5); } else if(level == 80) { move(8); } else if(level == 120) { move(12); } } public void AI() { turnTowards(Soldier.currentX, Soldier.currentY); } public void animationWalk() { if(frame == 1) { setImage(zombieAnim1); frame = 2; } else if(frame == 2) { setImage(zombieAnim2); frame = 3; } else if(frame == 3) { setImage(zombieAnim3); frame = 1; } } public void death() { Actor bullet = getOneIntersectingObject(Bullet.class); if (bullet != null) { health = health - 10; getWorld().removeObject(bullet); } if (health <= 0) { getWorld().removeObject(this); level = level += 1; } } public void eat() { Actor soldier; soldier = getOneObjectAtOffset(0, 0, Soldier.class); if (soldier != null) { World ZombieWorld; ZombieWorld = getWorld(); ZombieWorld.removeObject(soldier); setImage("gameoverr.png"); Greenfoot.stop(); Greenfoot.stop(); } } }