# Game Collection
A collection of classic arcade games including Snake, Tetris, Arkanoid, and Pac-Man, built with Python and Pygame.
## Features
- **Snake**: Classic snake game with growing mechanics
- **Tetris**: Block-stacking puzzle game with line clearing
- **Arkanoid**: Breakout-style game with paddle and ball physics
- **Pac-Man**: Maze navigation game with dots and ghosts
## Installation
### From Source
```bash
# Clone the repository
git clone <repository-url>
cd game-collection
# Install in development mode
pip install -e .
# Or install with development dependencies
pip install -e ".[dev]"
```
### From PyPI
```bash
# Standard installation
pip install game-collection
# If you have permission issues on Windows:
pip install game-collection --no-deps --user
```
### Windows Installation
If you encounter permission errors with pygame on Windows, use the automated installer:
```bash
# Run the installer
install_game.bat
# Or manual installation
pip install game-collection --no-deps --user
```
## Usage
### Command Line
After installation, you can run the game collection using:
```bash
# Using the entry point (if PATH is configured)
game-collection
# Using Python module (always works)
python -m game
# Using local file (for development)
python main.py
```
### Troubleshooting
If the `game-collection` command is not found:
1. **Windows**: Run `setup_path.bat` as administrator
2. **Alternative**: Always use `python -m game`
3. **See**: [Windows Installation Guide](WINDOWS_INSTALLATION_GUIDE.md) for detailed solutions
### Development
```bash
# Run the game
make run
# Run tests
make test-unit
# Run tests with coverage
make test-cov
# Check code quality
make quality
# Build executable
make build
# Setup pre-commit hooks
make pre-commit-install
# Run pre-commit on all files
make pre-commit-run
# Check readiness for PyPI publication
make publish-check
# Publish to TestPyPI (for testing)
make publish-test
# Publish to PyPI (requires API token)
make publish
```
### Debug Features
The game includes a debug overlay that can be toggled during gameplay:
- **F1**: Toggle debug overlay on/off
- **F2**: Reset FPS history
- **F3**: Toggle fullscreen mode
The debug overlay shows:
- Real-time FPS and FPS history
- Current game and state
- Mouse position
- Currently pressed keys
- Performance statistics
## Configuration
The game uses a configuration system that stores settings in platform-appropriate directories:
- **Windows**: `%APPDATA%/GameCollection/`
- **macOS**: `~/Library/Application Support/GameCollection/`
- **Linux**: `~/.local/share/GameCollection/`
### Configuration Files
- `config.json`: Game settings, controls, audio, and difficulty levels
- `scores.json`: High scores for all games
### Configuration Options
The configuration includes:
- **Display**: Resolution, fullscreen mode, FPS
- **Controls**: Key mappings for each game
- **Game Settings**: Speed, grid size, lives, etc.
- **Audio**: Volume levels and enable/disable
- **Difficulty**: Easy, Normal, Hard presets
## Development
### Project Structure
```
src/
├── game/
│   ├── __init__.py
│   ├── __main__.py          # Entry point
│   ├── main.py              # Main game loop
│   ├── config.py            # Configuration management
│   ├── config.json          # Default configuration
│   ├── games/               # Game implementations
│   │   ├── base.py          # Base game class
│   │   ├── logic.py         # Pure game logic functions
│   │   ├── snake.py         # Snake game
│   │   ├── tetris.py        # Tetris game
│   │   ├── arkanoid.py      # Arkanoid game
│   │   └── pacman.py        # Pac-Man game
│   └── ui/                  # User interface
│       ├── menu.py          # Main menu
│       └── scores.py        # Score management
tests/                       # Unit tests
docs/                        # Documentation
```
### Testing
The project includes comprehensive unit tests for all game logic:
```bash
# Run all tests
python -m pytest tests/
# Run specific test file
python -m pytest tests/test_tetris_logic.py
# Run with coverage
python -m pytest tests/ --cov=src/game/games --cov-report=html
```
### Code Quality
The project uses modern Python tooling:
- **Ruff**: Fast linting and formatting
- **MyPy**: Static type checking
- **Pytest**: Testing framework
- **Appdirs**: Platform-appropriate data directories
### Building Executables
```bash
# Build with PyInstaller
make build
# Or manually
pyinstaller --onefile --windowed --name GameCollection src/game/__main__.py
```
## Requirements
- Python 3.10+
- Pygame 2.5.0+
- Appdirs 1.4.4+ (for data directory management)
### Development Requirements
- Ruff 0.1.0+ (linting and formatting)
- MyPy 1.8.0+ (type checking)
- Pytest 7.4.0+ (testing)
- PyInstaller 5.13.0+ (executable building)
## Contributing
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Run the quality checks: `make quality`
5. Submit a pull request
## License
MIT License - see [LICENSE](LICENSE) file for details.
## Changelog
See [CHANGELOG.md](CHANGELOG.md) for a detailed list of changes.
            
         
        Raw data
        
            {
    "_id": null,
    "home_page": null,
    "name": "game-collection",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "games, arcade, pygame, snake, tetris, arkanoid, pacman",
    "author": null,
    "author_email": "Game Collection Team <game-collection@example.com>",
    "download_url": "https://files.pythonhosted.org/packages/54/20/c6af15708d020316f509fe8fe2da0fb0460299bbd45e73bf926e62661386/game_collection-1.1.11.tar.gz",
    "platform": null,
    "description": "# Game Collection\r\n\r\nA collection of classic arcade games including Snake, Tetris, Arkanoid, and Pac-Man, built with Python and Pygame.\r\n\r\n## Features\r\n\r\n- **Snake**: Classic snake game with growing mechanics\r\n- **Tetris**: Block-stacking puzzle game with line clearing\r\n- **Arkanoid**: Breakout-style game with paddle and ball physics\r\n- **Pac-Man**: Maze navigation game with dots and ghosts\r\n\r\n## Installation\r\n\r\n### From Source\r\n\r\n```bash\r\n# Clone the repository\r\ngit clone <repository-url>\r\ncd game-collection\r\n\r\n# Install in development mode\r\npip install -e .\r\n\r\n# Or install with development dependencies\r\npip install -e \".[dev]\"\r\n```\r\n\r\n### From PyPI\r\n\r\n```bash\r\n# Standard installation\r\npip install game-collection\r\n\r\n# If you have permission issues on Windows:\r\npip install game-collection --no-deps --user\r\n```\r\n\r\n### Windows Installation\r\n\r\nIf you encounter permission errors with pygame on Windows, use the automated installer:\r\n\r\n```bash\r\n# Run the installer\r\ninstall_game.bat\r\n\r\n# Or manual installation\r\npip install game-collection --no-deps --user\r\n```\r\n\r\n## Usage\r\n\r\n### Command Line\r\n\r\nAfter installation, you can run the game collection using:\r\n\r\n```bash\r\n# Using the entry point (if PATH is configured)\r\ngame-collection\r\n\r\n# Using Python module (always works)\r\npython -m game\r\n\r\n# Using local file (for development)\r\npython main.py\r\n```\r\n\r\n### Troubleshooting\r\n\r\nIf the `game-collection` command is not found:\r\n\r\n1. **Windows**: Run `setup_path.bat` as administrator\r\n2. **Alternative**: Always use `python -m game`\r\n3. **See**: [Windows Installation Guide](WINDOWS_INSTALLATION_GUIDE.md) for detailed solutions\r\n\r\n### Development\r\n\r\n```bash\r\n# Run the game\r\nmake run\r\n\r\n# Run tests\r\nmake test-unit\r\n\r\n# Run tests with coverage\r\nmake test-cov\r\n\r\n# Check code quality\r\nmake quality\r\n\r\n# Build executable\r\nmake build\r\n\r\n# Setup pre-commit hooks\r\nmake pre-commit-install\r\n\r\n# Run pre-commit on all files\r\nmake pre-commit-run\r\n\r\n# Check readiness for PyPI publication\r\nmake publish-check\r\n\r\n# Publish to TestPyPI (for testing)\r\nmake publish-test\r\n\r\n# Publish to PyPI (requires API token)\r\nmake publish\r\n```\r\n\r\n### Debug Features\r\n\r\nThe game includes a debug overlay that can be toggled during gameplay:\r\n\r\n- **F1**: Toggle debug overlay on/off\r\n- **F2**: Reset FPS history\r\n- **F3**: Toggle fullscreen mode\r\n\r\nThe debug overlay shows:\r\n- Real-time FPS and FPS history\r\n- Current game and state\r\n- Mouse position\r\n- Currently pressed keys\r\n- Performance statistics\r\n\r\n## Configuration\r\n\r\nThe game uses a configuration system that stores settings in platform-appropriate directories:\r\n\r\n- **Windows**: `%APPDATA%/GameCollection/`\r\n- **macOS**: `~/Library/Application Support/GameCollection/`\r\n- **Linux**: `~/.local/share/GameCollection/`\r\n\r\n### Configuration Files\r\n\r\n- `config.json`: Game settings, controls, audio, and difficulty levels\r\n- `scores.json`: High scores for all games\r\n\r\n### Configuration Options\r\n\r\nThe configuration includes:\r\n\r\n- **Display**: Resolution, fullscreen mode, FPS\r\n- **Controls**: Key mappings for each game\r\n- **Game Settings**: Speed, grid size, lives, etc.\r\n- **Audio**: Volume levels and enable/disable\r\n- **Difficulty**: Easy, Normal, Hard presets\r\n\r\n## Development\r\n\r\n### Project Structure\r\n\r\n```\r\nsrc/\r\n\u251c\u2500\u2500 game/\r\n\u2502   \u251c\u2500\u2500 __init__.py\r\n\u2502   \u251c\u2500\u2500 __main__.py          # Entry point\r\n\u2502   \u251c\u2500\u2500 main.py              # Main game loop\r\n\u2502   \u251c\u2500\u2500 config.py            # Configuration management\r\n\u2502   \u251c\u2500\u2500 config.json          # Default configuration\r\n\u2502   \u251c\u2500\u2500 games/               # Game implementations\r\n\u2502   \u2502   \u251c\u2500\u2500 base.py          # Base game class\r\n\u2502   \u2502   \u251c\u2500\u2500 logic.py         # Pure game logic functions\r\n\u2502   \u2502   \u251c\u2500\u2500 snake.py         # Snake game\r\n\u2502   \u2502   \u251c\u2500\u2500 tetris.py        # Tetris game\r\n\u2502   \u2502   \u251c\u2500\u2500 arkanoid.py      # Arkanoid game\r\n\u2502   \u2502   \u2514\u2500\u2500 pacman.py        # Pac-Man game\r\n\u2502   \u2514\u2500\u2500 ui/                  # User interface\r\n\u2502       \u251c\u2500\u2500 menu.py          # Main menu\r\n\u2502       \u2514\u2500\u2500 scores.py        # Score management\r\ntests/                       # Unit tests\r\ndocs/                        # Documentation\r\n```\r\n\r\n### Testing\r\n\r\nThe project includes comprehensive unit tests for all game logic:\r\n\r\n```bash\r\n# Run all tests\r\npython -m pytest tests/\r\n\r\n# Run specific test file\r\npython -m pytest tests/test_tetris_logic.py\r\n\r\n# Run with coverage\r\npython -m pytest tests/ --cov=src/game/games --cov-report=html\r\n```\r\n\r\n### Code Quality\r\n\r\nThe project uses modern Python tooling:\r\n\r\n- **Ruff**: Fast linting and formatting\r\n- **MyPy**: Static type checking\r\n- **Pytest**: Testing framework\r\n- **Appdirs**: Platform-appropriate data directories\r\n\r\n### Building Executables\r\n\r\n```bash\r\n# Build with PyInstaller\r\nmake build\r\n\r\n# Or manually\r\npyinstaller --onefile --windowed --name GameCollection src/game/__main__.py\r\n```\r\n\r\n## Requirements\r\n\r\n- Python 3.10+\r\n- Pygame 2.5.0+\r\n- Appdirs 1.4.4+ (for data directory management)\r\n\r\n### Development Requirements\r\n\r\n- Ruff 0.1.0+ (linting and formatting)\r\n- MyPy 1.8.0+ (type checking)\r\n- Pytest 7.4.0+ (testing)\r\n- PyInstaller 5.13.0+ (executable building)\r\n\r\n## Contributing\r\n\r\n1. Fork the repository\r\n2. Create a feature branch\r\n3. Make your changes\r\n4. Run the quality checks: `make quality`\r\n5. Submit a pull request\r\n\r\n## License\r\n\r\nMIT License - see [LICENSE](LICENSE) file for details.\r\n\r\n## Changelog\r\n\r\nSee [CHANGELOG.md](CHANGELOG.md) for a detailed list of changes.\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A collection of classic arcade games including Snake, Tetris, Arkanoid, and Pac-Man",
    "version": "1.1.11",
    "project_urls": {
        "Changelog": "https://github.com/example/game-collection/blob/main/CHANGELOG.md",
        "Homepage": "https://github.com/example/game-collection",
        "Issues": "https://github.com/example/game-collection/issues",
        "Repository": "https://github.com/example/game-collection"
    },
    "split_keywords": [
        "games",
        " arcade",
        " pygame",
        " snake",
        " tetris",
        " arkanoid",
        " pacman"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "02529beb555350567f914225162d554a4cfd5dabccdf5d33011d0a47db669536",
                "md5": "4b7b075c389b4d77ceaefee6f168bc89",
                "sha256": "d11a16d3fe9e0c6a8bbe8c169ed8a40e4f8b5b28ce8a12ea640223af0953d11f"
            },
            "downloads": -1,
            "filename": "game_collection-1.1.11-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4b7b075c389b4d77ceaefee6f168bc89",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 44828,
            "upload_time": "2025-09-16T00:24:09",
            "upload_time_iso_8601": "2025-09-16T00:24:09.099609Z",
            "url": "https://files.pythonhosted.org/packages/02/52/9beb555350567f914225162d554a4cfd5dabccdf5d33011d0a47db669536/game_collection-1.1.11-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "5420c6af15708d020316f509fe8fe2da0fb0460299bbd45e73bf926e62661386",
                "md5": "58a03049cee7d82ae01ffc296e8ebc53",
                "sha256": "fd56d9880faa02995c2ef0a86b0d178f08888dcc6ca3c24c6de80a0f8fcb84f6"
            },
            "downloads": -1,
            "filename": "game_collection-1.1.11.tar.gz",
            "has_sig": false,
            "md5_digest": "58a03049cee7d82ae01ffc296e8ebc53",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 42216,
            "upload_time": "2025-09-16T00:24:10",
            "upload_time_iso_8601": "2025-09-16T00:24:10.401714Z",
            "url": "https://files.pythonhosted.org/packages/54/20/c6af15708d020316f509fe8fe2da0fb0460299bbd45e73bf926e62661386/game_collection-1.1.11.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-16 00:24:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "example",
    "github_project": "game-collection",
    "github_not_found": true,
    "lcname": "game-collection"
}