I have programmed a game like Break Out, i want to make a lifecounter so, if the ball hits the bottom the "3 lifes" get -1, and when this happends the text should display "3 lifes"... look at my code and tell me whats wrong PS: Im german so "Leben" means "lifes" and "spielball" is the object from the ball:
I wrote this in the world subclass
public byte c=3;
---------------------
public void lifecounter(){
if(c == 3){
showText("3 Leben",300,500);
}
else{
if(c == 2){
showText("2 Leben",300,500);
}
else{
if(c == 1){
showText("1 Leben",300,500);
}
else{
if(c == 0){
showText("GAME OVER",300,500);
Greenfoot.stop();
}
}
}
}
}
-----------------------
public void lifemachine(){
if(spielball.getY() > 780){
c--;
}
}
