I need some help. I'm trying to pass a score to another class using the getScore method, but it keeps returning 0.
public void score() { score = score + 1; Test w = (Test) getWorld(); ScoreBoard sb = new ScoreBoard(score); getWorld().removeObjects(getWorld().getObjects(ScoreBoard.class)); w.addObject(sb, 50, 20); } public int getScore() { return score; }
public void finalScore() { Fly fly = new Fly(); Test w = (Test) getWorld(); if(alive == false){ GameOver go = new GameOver(fly.getScore()); w.addObject(go, 200, 200); } }