Im building a rocket game where I want my fuel to countdown from 100 when the play presses the space bar. This is the code I have so far and nothing is working.
Could someone give me a hand with this?
private void updateFuelDisplay()
{
fuelElapsed=100;
fuelElapsed=fuelElapsed-1;
fuelDisplay.setImage(new GreenfootImage("Fuel:"+fuelElapsed, 24, java.awt.Color.white,null));
if (Greenfoot.isKeyDown("Space"))
{
fuelElapsed=(fuelElapsed-1)%10;
updateFuelDisplay();
}
}

