Welcome to the Rain Bucket Game! This is an arcade-style game developed using Python's pygame library, now featuring both Human and AI modes. The objective remains the same: catch raindrops using a bucket and score points within a limited time.
- Randomly generated raindrops fall from the top of the screen โ
- Human Control Mode: Use arrow keys to move your bucket and catch raindrops ๐ฎ
- AI Control Mode: Let the AI move the bucket using heuristic rules to catch raindrops automatically ๐ค
- Separate scoring for Human and AI players, displayed during and after the game ๐
- Adjustable game speed to control difficulty โฉ
- Game over condition after a specified duration โณ
- Sound effects for catching raindrops and game over events ๐
- Python 3.x
- pygame library
-
Clone the repository:
git clone <repository-url> -
Install pygame:
pip install pygame
-
Run the game by executing
python rain_bucket_game.py. -
Start the Game:
- Click on Start Game on the main menu to begin.
-
Select Control Mode:
- Human Control: Use the left and right arrow keys to move the human bucket.
- AI Control: Watch as the AI automatically moves its bucket to catch raindrops based on heuristic rules.
-
Catch Raindrops: Position your bucket(s) to catch falling raindrops. Each catch earns points for the respective player (Human or AI).
-
Game Over: The game ends after 30 seconds. You can return to the menu to play again.
- Users can now play against an AI
- Game Over screen now displays final score and game result
- Add sound effects for game events
- A water drop sound effect is played when a raindrop is caught by the bucket
- Game Over sound effect is played when the game ends
- The score is reset to 0 when the game ends to ensure a fresh start for the next game. (Bug fix for version 2.6)
- Added bucket colors for human and AI control
- Refactored code to separate Human and AI control modes
- Improved user interface
- Update game duration to 30 seconds in game loop
- Adjust bucket speed for smoother movement
- The game can be now played with the human and AI control modes.
- Added game over screen with return to menu option.
- Improved look and feel of the start screen.
- Add control mode selection to start screen
- Refactor code to separate Human and AI control modes
- Enhanced AI control using heuristic rules:
- Distance Calculation: Calculates the distance between each raindrop and the bucket.
- Direction Prediction: Predicts the direction of each raindrop's movement (left or right).
- Optimal Bucket Movement: Moves the bucket towards the predicted landing position of the closest raindrop.
- Added AI control option for the bucket, automatically moving towards the closest raindrop.
- Improved Start Screen.
- Updated scoring system to reflect AI-controlled catches.
- Added game over condition after a specified duration (default 30 seconds).
- Enhanced user interface with a start screen featuring a clickable start button.
- Implemented scoring system where players accumulate points for catching raindrops with the bucket.
- Added player-controlled bucket to catch raindrops.
- Implemented collision detection between bucket and raindrops.
- Introduced adjustable game speed to control the falling rate of raindrops.
- Added game over condition after 60 seconds with final score display.
- Implemented basic game structure.
- Added functionality for raindrops to fall from the top of the screen.
- Implemented score tracking for each raindrop that falls off the screen.