Bubble Trouble is an exciting, time-based game developed using Pygame. Players navigate through various levels, facing different challenges while using a variety of weapons to defeat enemies. The game includes custom sounds, textures, and a unique level system to enhance the gaming experience.
Play the game directly in your browser: https://adrianolm1.github.io/BubbleTrouble/
The web version is automatically deployed using GitHub Pages and pygbag whenever changes are pushed to the main branch.
- Time-Based Gameplay: Complete levels within a specified time limit.
- Multiple Weapons: Choose from various weapons, each with unique characteristics:
- Mono Shooter
- Tri Shooter
- Laser
- Chain Shooter
- Bomber
- Custom Sounds: Includes custom sound effects for different actions and events.
- Custom Textures: Unique textures to enhance the visual appeal of the game.
- Level System: Progress through multiple levels, with each level introducing new challenges.
- Coins: Collect coins to increase your score.
- Pause and Game Over Screens: Properly handles game pause and game over states with informative displays.
Simply visit https://adrianolm1.github.io/BubbleTrouble/ to play instantly without any installation!
-
Clone the Repository:
git clone https://github.com/AdrianOlm1/BubbleTrouble.git cd BubbleTrouble -
Install Dependencies: Make sure you have Python and Pygame installed. You can install Pygame using pip:
pip install pygame
-
Run the Game:
cd BubbleTrouble python main.py
-
Install pygbag:
pip install pygbag
-
Build and serve the game:
pygbag BubbleTrouble
Then open your browser to
http://localhost:8000
- Movement: Use the left and right arrow keys to move the player.
- Shooting:
- Press '1' to shoot Mono Bullets.
- Press '2' to shoot Tri Bullets.
- Press '3' to shoot a Chain.
- Press '4' to shoot a Laser.
- Press 'Space' to deploy a Bomber. -Pause: Press the 'ESC' key to pause the game -Objective: Destroy all bubbles in each level before time runs out. Collect coins to increase your score.
- Player: The main character controlled by the player.
- ProjectileMono, ProjectileTri, ProjectileLaser, ProjectileChain, ProjectileBomber: Different projectile types with unique behaviors.
- WeaponHandler: Manages the player's weapons and shooting mechanics.
- Bubble: The primary enemy that splits into smaller bubbles when hit.
- Coin: Collectible items that increase the player's score.
reset_game(): Resets the game state.new_level(): Initializes a new level with appropriate enemies and settings.display(): Updates and displays the game HUD.display_game_over(): Shows the game over screen and handles replay logic.display_pause(): Shows the pause screen.
This game is automatically deployed to GitHub Pages using pygbag. The deployment workflow:
- Converts the Pygame code to run in the browser using WebAssembly
- Packages all assets (sounds, fonts, graphics) into the web build
- Deploys to GitHub Pages automatically on every push to main branch
To enable deployment for your own fork:
- Go to your repository Settings
- Navigate to "Pages" in the left sidebar
- Under "Build and deployment", set Source to "GitHub Actions"
- Push changes to the main branch to trigger automatic deployment
- Your game will be available at
https://[your-username].github.io/BubbleTrouble/
The game will work with all sounds and assets in the browser!