Implement minor changes in game start function
This commit is contained in:
@@ -20,11 +20,6 @@ public class MenuActions {
|
|||||||
|
|
||||||
public void startGame(Player player) {
|
public void startGame(Player player) {
|
||||||
while (player.getKeysCollectedCount() < 3) {
|
while (player.getKeysCollectedCount() < 3) {
|
||||||
// System.out.println("Keys collected: " + player.getStringKeysCollected());
|
|
||||||
// if (askInventory(player)) {
|
|
||||||
//
|
|
||||||
// };
|
|
||||||
|
|
||||||
askInventory(player);
|
askInventory(player);
|
||||||
Enemy enemy = chooseEnemy();
|
Enemy enemy = chooseEnemy();
|
||||||
Entity winner = fight(player, enemy);
|
Entity winner = fight(player, enemy);
|
||||||
@@ -34,7 +29,12 @@ public class MenuActions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (player.getKeysCollectedCount() == 3) {
|
if (player.getKeysCollectedCount() == 3) {
|
||||||
askInventory(player);
|
bossFight(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void bossFight(Player player) {
|
||||||
System.out.println("Congratulations! You have successfully collected all 3 keys\n" +
|
System.out.println("Congratulations! You have successfully collected all 3 keys\n" +
|
||||||
"You may now fight the Dragon");
|
"You may now fight the Dragon");
|
||||||
System.out.println("Make sure to upgrade before entering the castle!");
|
System.out.println("Make sure to upgrade before entering the castle!");
|
||||||
@@ -48,8 +48,6 @@ public class MenuActions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private Enemy chooseEnemy() {
|
private Enemy chooseEnemy() {
|
||||||
while (true) {
|
while (true) {
|
||||||
Location location = new Location();
|
Location location = new Location();
|
||||||
|
|||||||
Reference in New Issue
Block a user