whats wrong with my text based mini-game? (java)
so i tried to make a text based mini - game but it not works like i think, i tried solve it many times but i failed probably the problem is on loop statement EDIT (FIXED): i've fixed loop problem while writing this post xd, anyway the problem is chopping tree's not giving any amount to purse variable, whats the problem with currency? EDIT 2: thx jonas i learned something new and issue get fixed, but problem is rn with the multiplier i tried change position of if but its not fixed woodPrice must 2x when axe is bought but for some reason this not works package basics; import java.util.Scanner; public class basc1 { public static void main(String[] args) { Scanner terminal = new Scanner(System.in); System.out.println("WELCOME TO TREE CHOPPING GAME! \nstart the game by typing chop tree!"); int purse = 5; int multiplier = 1; double woodPrice = 10; boolean axeEquipped = false; final int axePrice = 20; String movement = terminal.nextLine(); while (!movement.equals("quit game")) { movement = terminal.nextLine(); if (movement.equals("buy axe")) { if (purse > axePrice) { if (axeEquipped == true) multiplier += 2; System.out.println("now you earn 2x wood!"); purse -= axePrice; axeEquipped = true; System.out.println("AXE BOUGHT!"); } else if (purse < axePrice) { System.out.println((purse - axePrice) + "missing cash"); } } switch(movement) { case "bank": System.out.println("bank: " + purse); break; case "chop tree": System.out.println("tree chopped"); purse += woodPrice * multiplier; break; case "/help": System.out.println("Commands listed ---> 'chop tree', 'buy axe', 'bank', 'quit game'"); break; } } } }