My math is right, why isn't it taking more away?

Here are my two screenshotscode%202


The errors in the first screenshot just tell me to make the numbers final.

My question is how do I make the code only subtract. like it starts at 20, and goes down every time the button is clicked?

Thanks :grinning:

Hereโ€™s some code:

        //gets text from userInput text field
        int player = Integer.parseInt(userInput.getText());
        
        //Generates the computers number
        Random rand = new Random();
        int min = 1;
        int max = 3;
        int number = rand.nextInt(max - min + 1) + min;
        
        int playerAmount = playerTotal - player;
        
        int computerAmount = computer - number;
        
        //Will set text depending on user input
        if (player >= 1)
        {   
            outputLabel.setText("You have " + playerAmount + " stones left. I have " + computerAmount + " left.");
        } 
        else if (player < 0)
        {
            outputLabel.setText("The number you chose is too small");
        } 
        else if (player > 3)
        {
            outputLabel.setText("The number you have picked is too large");
        }
        else if (playerAmount == 0 || computerAmount == 0)
        {
            outputLabel.setText("The game is done, thanks for playing");
        }
        else
        {
            outputLabel.setText("Invaild Input");
        }
        

and


        int computer = 20;
        
        //sets player amount to start from 20
        int playerTotal = 20;

all I need is some help with figuring out the Global Variable in general