A fun PyGame where you control a player trying to catch different types of bugs. Each bug type offers different rewards and challenges!
-
Three Bug Types:
- 🟢 Green Bugs (Normal) = 1 point
- 🌟 Golden Bugs = 5 points
- 🔵 Blue Bugs = Speed power-up
-
Dynamic Difficulty:
- Bugs speed up as your score increases
- Speed thresholds at 20, 50, 100, and 150 points
- Each level makes bugs progressively faster
-
Movement Mechanics:
- Double jump capability
- Left/Right movement
- Speed power-ups from blue bugs
-
Prerequisites:
# Make sure you have Python 3.7+ installed python3 --version # Make sure you have Node.js and npm installed node --version npm --version
-
Setup:
# Clone or download the game files git clone https://github.com/yourusername/cat-and-bugs-game.git cd cat-and-bugs-game # Setup virtual environment and install dependencies # On macOS/Linux: npm run setup # On Windows: npm run setup-win
-
Run the game:
npm start
If you encounter any issues:
- Make sure you're not in any virtual environment when starting the installation (run
deactivateif needed) - You can manually set up the environment:
# Create and activate virtual environment python3 -m venv venv source venv/bin/activate # On Windows use: venv\Scripts\activate # Install dependencies python3 -m pip install -r requirements.txt
- After manual setup, you can still use
npm startto run the game
- ←/→ Arrow Keys: Move left/right
- Spacebar: Jump(Swim)
- Close Window: Quit game
- The fish can only move left/right while in the air
- Jump(Swim) to start swimming/moving
- This creates a fluid, swimming-like motion
- Must jump off the ground to initiate movement
- Catch green bugs for 1 point
- Catch golden bugs for 5 points
- Catch blue bugs for temporary speed boost
- Blue bugs give 5-second speed boosts
- Speed boost helps catch other bugs more easily
- Score 20: Bugs move 20% faster
- Score 50: Bugs move 50% faster
- Score 100: Bugs move 80% faster
- Score 150: Bugs move twice as fast
You can customize the game by adding your own images in the assets/images/ folder:
player.png: Your custom player spritebug.png: Normal bug spritegolden.png: Golden bug spritepower.png: Power-up bug spritebackground.png: Game background
Images will automatically scale to fit the game's dimensions.
The game shows various information on screen:
- Current Score
- Remaining Jumps
- Active Speed Boost timer
- Current Speed Level (when bugs are faster)
If you encounter issues:
- Verify Python version is 3.7+
- Ensure pygame is installed correctly
- Check that all game files are in the correct directory structure
- Make sure you're running from the game's root directory
- Prioritize golden bugs for quick score increases
- Use speed boosts strategically
- Watch for increasing difficulty as your score grows
The game includes a comprehensive test suite using pytest. To run the tests:
# Run all tests
npm run test- Player movement and collision detection
- Bug behavior and spawning mechanics
- Game state management
- Power-up system
- Score tracking and leaderboard
To create a standalone executable:
npm run build # For Unix/Mac
npm run build-win # For WindowsEnjoy playing! 🎮✨