A Streamlit-based game hub that mimics a Windows desktop interface, featuring 5 classic mini games with smooth controls and polished gameplay.
- Windows-like Desktop UI: Stunning gradient background with clickable game icons and hover effects
- 5 Fully Playable Games:
- 🐍 Snake - Navigate the snake to eat apples and grow (with anti-reverse protection)
- 🕹️ Flappy Bird - Guide the bird through pipes with balanced physics
- ❌⭕ XOX (Tic Tac Toe) - Classic two-player strategy game with win detection
- 🏓 Ping Pong - Two-player paddle game with realistic ball physics
- 🦫 Beaver Hit - Whac-a-Mole style clicking game with 30-second timer
- Smooth Controls: No page scrolling, optimized game speeds, intuitive navigation
- Beautiful UI: Each game has its own themed gradient background and polished interface
GameHub/
├── app.py # Main launcher with desktop UI
├── requirements.txt # Python dependencies
├── games/
│ ├── __init__.py # Package initializer
│ ├── snake.py # Snake game
│ ├── flappy.py # Flappy Bird game
│ ├── xox.py # Tic Tac Toe game
│ ├── pong.py # Ping Pong game
│ └── beaver_hit.py # Beaver Hit game
└── README.md # This file
-
Clone or download this project
-
Install dependencies:
pip install -r requirements.txt
Start the Game Hub:
streamlit run app.pyThe application will open in your default web browser at http://localhost:8501
- Arrow Keys (↑ ↓ ← →) to control snake direction
- No reverse direction allowed - prevents instant death from going backwards
- Eat apples to grow and score points
- Avoid hitting walls or yourself
- SPACE to restart after game over
- Balanced speed: Starts slower, gradually increases
- SPACE or Click to make the bird jump
- Avoid pipes and ground
- Score points by passing through gaps
- Optimized physics: Smoother gravity and wider pipe gaps for better playability
- Click on empty squares to place your mark
- ❌ goes first
- Get three in a row (horizontal, vertical, or diagonal) to win
- Reset button to start a new game
- Player 1 (Left Paddle): W = Up, S = Down
- Player 2 (Right Paddle): ↑ = Up, ↓ = Down
- First to 5 points wins
- Ball speed increases with each paddle hit
- No page scrolling with arrow keys
- Click Start Game to begin 30-second timer
- Click on beavers as they pop up from holes
- Score 10 points per successful hit
- Try to get the highest score before time runs out
- Beavers appear randomly every second
This project follows the KISS principle (Keep It Simple, Stupid):
- Clean, modular structure
- Each game in its own file
- Minimal dependencies
- Easy to understand and extend
- Framework: Streamlit 1.28.0+
- Language: Python 3.7+
- Game Rendering: HTML5 Canvas + JavaScript for interactive games
- State Management: Streamlit session_state for navigation and game states
- Performance: Optimized game loops with balanced speeds
- UX Features:
- Prevented page scrolling during gameplay
- Anti-reverse direction in Snake game
- Buffered input handling for smooth controls
- Auto-refresh for real-time game updates
- Themed backgrounds for each game
- No Page Scrolling: Arrow keys and game controls won't scroll the page
- Balanced Game Speed: Snake and Flappy Bird are now perfectly playable
- Snake Anti-Reverse: Can't accidentally reverse into yourself
- Beautiful UI: Each game has custom gradient backgrounds and styling
- Smooth Navigation: Instant game switching with back button
- Responsive Controls: All buttons and inputs work reliably
To add a new game:
- Create a new file in
games/directory (e.g.,games/tetris.py) - Implement a
run()function that contains the game logic - Add the game to the desktop in
app.py:games = [ # ... existing games ... {"name": "Tetris", "emoji": "🧱", "key": "tetris"}, ]
- Add the game launcher in the
main()function:elif active_game == "tetris": from games import tetris tetris.run()
This project is open source and available for educational purposes.
✅ COMPLETE - All features implemented and tested
- All 5 games fully functional
- Smooth controls with no page scrolling
- Balanced gameplay speeds
- Beautiful UI with themed backgrounds
- Bug-free navigation and state management
Enjoy your Game Hub! 🎮 Have fun playing these classic games!