Skip to content

๐ŸŽฎ Big Ball Swallows Small Ball - An addictive arcade game with AI support. Control a demon ball to eat smaller dots while avoiding bigger ones. Features dynamic movement, rainbow effects, and reinforcement learning capabilities. Built with Pygame and PyTorch. ๐Ÿ˜ˆ ๐ŸŒˆ

License

Notifications You must be signed in to change notification settings

me0w00f/Big-Ball-Swallows-Small-Ball

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Big Ball Swallows Small Ball ๐ŸŽฎ

A dynamic arcade game where you control a demon ball to eat smaller dots and grow bigger. Features both manual play and AI learning modes.

โœจ Features

  • Demon-themed player ball with rainbow glow effects
  • 6 types of food dots with unique behaviors
  • Dynamic dot movements with bounce physics
  • High score system
  • Two play modes: Manual and AI
  • Real-time visual effects and particle systems

๐ŸŽฏ Game Modes

Manual Play

Control your demon ball directly:

  • โ†‘ Move up
  • โ†“ Move down
  • โ† Move left
  • โ†’ Move right
  • SPACE Restart after game over

AI Training Mode

Watch and train an AI agent to play:

๐ŸŽฒ Game Elements

Food Types

  • ๐Ÿ”ต Black dot (3px) - 10 points
  • ๐ŸŸข Green dot (5px) - 20 points
  • ๐Ÿ”ท Blue dot (7px) - 30 points
  • ๐ŸŸฃ Purple dot (9px) - 40 points
  • ๐ŸŸก Orange dot (12px) - 80 points
  • ๐Ÿ”ด Red dot (15px) - 160 points

Victory & Defeat

  • Win: Reach 5000 points
  • Lose: Touch any dot larger than yourself

๐ŸŽฎ How to Play

Installation

# Install game dependencies
pip install -r requirements.txt

Running the Game

# Manual play mode
python manual_play.py
# AI training mode with game rendering.
python train.py --render

# AI training mode, text only
python train.py
# Test trained AI
python test.py --model models/model_1000.pth --render

๐Ÿค– AI Training Features

  • Deep Q-Network (DQN) implementation
  • Prioritized Experience Replay
  • Dynamic reward system
  • Real-time training visualization
  • WandB integration for metrics tracking

๐Ÿ› ๏ธ Development

  • Python 3.10+
  • Pygame 2.6.1
  • PyTorch for AI training
  • WandB for experiment tracking

๐Ÿ“Š High Scores

Scores are automatically saved in highscores.json. Only top 10 scores are kept.

๐ŸŽต Sound Effects

Coming soon!


Have fun!

About

๐ŸŽฎ Big Ball Swallows Small Ball - An addictive arcade game with AI support. Control a demon ball to eat smaller dots while avoiding bigger ones. Features dynamic movement, rainbow effects, and reinforcement learning capabilities. Built with Pygame and PyTorch. ๐Ÿ˜ˆ ๐ŸŒˆ

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages