i have made a score board for my game but it works in my level1 but not in my level2. can someone help.
This one works:
This one doesnt
some extra incase needed
public void pickFlowers()
{
if(canSee(Flower.class))
{
Flower flower = (Flower) getOneObjectAtOffset(0, 0, Flower.class);
if(flower.getPoisonous())
{
removeObject (LittleRedCap.class);
score=score-5;
}else {
score++;
}
removeObject (Flower.class);
World world = getWorld();
world.removeObjects(world.getObjects(ScoreBoard.class));
world.addObject (new ScoreBoard(score), 75,25);
}
} public void CoinGrab()
{
if(canSee(Coins.class))
{
Coins coins = (Coins) getOneObjectAtOffset(0, 0, Coins.class);
score=score++;
}
removeObject(Coins.class);
World world = getWorld();
world.removeObjects(world.getObjects(ScoreBoard.class));
world.addObject (new ScoreBoard(score), 75,50);
}public class ScoreBoard extends Actor
{
// instance variables - replace the example below with your own
private int score;
public static final float FONTSIZE = 24.0f;
public static final int WIDTH = 150;
public static final int HEIGHT = 50;
public static final int TRANSPARENCY = 128;
public static final int RED = 255;
public static final int GREEN = 255;
public static final int BLUE = 255;
public ScoreBoard(int scoreParameter)
{
score=scoreParameter;
makeScoreBoard();
}addObject(new ScoreBoard(0),75,50);
