I am a new programmer and I am making a console/text strategy game in java.
my program works like you are in while (true) switch case and you got options if you press 1 you collect wood, 2 for stones and like that, I would like to make it that your wood, stones, food gather automatically and I have no idea how to make it will welcome any help,
simplified code looks like this
while (true) {
Scanner in = new Scanner(System.in);
String volbačlověk = in.nextLine();
switch (volbačlověk) {
case "1":
wood = wood + 1;
break;
case "2":
stone = stone + 1;
break;
case "3":
food = food + 1;
break;
}
}
basically what I want to do is to make case 1,2,3 be done automatically every x seconds, so it works like you gather those materials automatically and in switch case there are building options.
also since I am a newbie in programing, please be specific I will not be ashamed I have to learn it somehow.