Skip to content

Latest commit

 

History

History
 
 

water_gun_game

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Water Gun Game in Java

A simple text-based two-player water gun game implemented in Java.

Game Description

In this game, two players take turns choosing actions: filling their water guns or shooting each other. The game continues until one of the players runs out of water.

Features

  • Two-player game with basic actions: Fill water gun and Shoot.
  • Random water shot amounts between 0 and 20.

Getting Started

  1. Clone or download the project to your local machine.

  2. Compile and run the game using a Java development environment or command line.

  3. Follow the on-screen instructions to play the game.

  4. Players can choose to "Fill water gun" (action 1) to restore their water or "Shoot" (action 2) to shoot the other player with a random water amount.

Sample Gameplay

Welcome to the Water Gun Game!
Enter Player 1's name: Alice
Enter Player 2's name: Bob

Alice's water: 100
Bob's water: 100
Alice, choose an action (1: Fill water gun, 2: Shoot): 2
Alice shot Bob with 9 water!

Alice's water: 100
Bob's water: 91
Bob, choose an action (1: Fill water gun, 2: Shoot): 1
Bob filled their water gun.

Alice's water: 100
Bob's water: 100
Alice, choose an action (1: Fill water gun, 2: Shoot): 2
Alice shot Bob with 15 water!

...

Bob is out of water. Alice wins!