From b6ad6a965dd3f21072cba5bc327e6695f7470199 Mon Sep 17 00:00:00 2001 From: kaus2004 <136147712+kaus2004@users.noreply.github.com> Date: Mon, 16 Oct 2023 02:45:29 -0500 Subject: [PATCH] Create BowserRushGame.java --- BowserRushGame.java | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 BowserRushGame.java diff --git a/BowserRushGame.java b/BowserRushGame.java new file mode 100644 index 00000000..20bf62db --- /dev/null +++ b/BowserRushGame.java @@ -0,0 +1,35 @@ +import java.util.Scanner; + +public class BowserRushGame { + public static void main(String[] args) { + Scanner scanner = new Scanner(System.in); + int score = 0; + boolean isGameOver = false; + + System.out.println("Welcome to Bowser Rush Game!"); + System.out.println("Help Bowser collect coins and avoid obstacles."); + System.out.println("Enter 'left' to move left, 'right' to move right, or 'quit' to exit."); + + while (!isGameOver) { + String input = scanner.nextLine().toLowerCase(); + + if (input.equals("quit")) { + isGameOver = true; + System.out.println("Game Over! Your final score: " + score); + } else { + // Simulate gameplay - collect coins, avoid obstacles, and update the score. + score += 10; // Example: add 10 to the score. + + System.out.println("Score: " + score); + + // Check for game over conditions (e.g., hitting an obstacle). + if (score >= 100) { + isGameOver = true; + System.out.println("Congratulations! You won the game!"); + } else { + System.out.println("Enter your next move."); + } + } + } + } +}