So im approaching the last stages of my game. everything works now except i seem to be unable to call the score stored in a counter class and display it on the game over world screen despite being able to display it on the in game world screen.
My guess is that my problem is in here somewhere
this is a part of my zombie code and as you can see, when it reaches a survivor class it is supposed to activate the game over screen (which it does) however the game over screen counter will always display 0 and i cant understand why when it works fine "in game"
any suggestions? any other areas of code i can show you guys to assist you in assisting me?
public class Zombie extends CHARACTERS { private int score = 0; /** * Act - do whatever the Zombie wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ public void act() { followHuman(); move(1); Actor Survivor; Survivor = getOneObjectAtOffset(0,0, Survivor.class); if (Survivor != null) { World world; world = getWorld(); world.removeObject(Survivor); world = getWorld(); Background background = (Background)world; Counter counter = background.getCounter(); score = counter.getScore(score); world.removeObject(this); Greenfoot.setWorld(new GameOver(score)); } }