So I am currently making this game for a school project and I wanted to increase my score by increments of 1000 because one of the objectives of my game is to collect money. I wanted the score to increase by 1000 because the money is worth $1000. Right now with my code it increases by 1.
If there is any way of doing this?
Also, I realised that the score doesn't show until I collect money. Is there a way of showing the score before I collect any money? eg. Player 1 Score: $0
Thanks
public class Player_1 extends Actor
{
private int score;
public void act()
{
collectMoney();
}
public void increaseScore()
{
score++;
showStatus();
}
public void collectMoney()
{
if (isTouching(Money.class))
{
removeTouching(Money.class);
increaseScore();
World world = getWorld();
world.addObject(new Money(), Greenfoot.getRandomNumber(1690), Greenfoot.getRandomNumber(900));
}
}
public void showStatus()
{
getWorld().showText("Player 1 Score : $"+score, 70,560);
getWorld().showText("Player 1 Death : "+score2, 70,540);
}
