Skip to main content

XBoing - A classic breakout-style game modernized with Python and Pygame

Project description

XBoing II (Python port)

PyPI version Pylint Tests Build

Now available on PyPI!
Install with pip install xboing and run with python -m xboing.

๐Ÿš€ Quick Start

pip install xboing
python -m xboing

๐ŸŽฎ For Players

What is XBoing?

XBoing is a fast-paced, blockout-style arcade game where you control a paddle to bounce a ball around the play area, destroying blocks and collecting power-ups. Inspired by the classic arcade genre, XBoing features:

  • 80+ challenging levels with unique layouts and increasing difficulty
  • A variety of colorful block types, including indestructible, counter, bomb, sticky, and death blocks
  • Special power-ups and power-downs: multiball, extra ball, paddle expand/shrink, sticky paddle, and more
  • Lively sound effects and vibrant graphics
  • Classic arcade-style gameplay with modern conveniences
  • Addictive, skill-based action that rewards quick reflexes and strategy

Originally developed for X11 in C, XBoing was designed for speed and fun, with a focus on colorful visuals and responsive controls. This Python port faithfully recreates the original experience while adding modern compatibility.

Installation & Playing

1. Install from PyPI (Recommended)

pip install xboing
python -m xboing

2. (Optional) Development Install from Source

If you want the latest development version or to contribute:

git clone https://github.com/jmf-pobox/xboing-python.git
cd xboing-python
pip install -e .
python -m xboing

Or use Hatch for advanced development workflows (see below).

Game Controls

  • Left/Right Arrow Keys: Move paddle
  • Space: Launch ball / Pause game
  • Esc: Quit game
  • F: Toggle fullscreen

Special Blocks & Power-ups

  • Multiball: Splits your ball into multiple balls
  • Extra Ball: Gives you an additional ball
  • Paddle Expander: Makes your paddle larger
  • Paddle Shrinker: Makes your paddle smaller
  • Counter Blocks: Require multiple hits to destroy
  • Death Blocks: End your current life when hit
  • Black Blocks: Indestructible, bounce balls away
  • Bomb Blocks: Explode and destroy neighboring blocks
  • Sticky Blocks: Make balls stick to paddle

Project Status

This Python port is under active development and is already playable. Current features include:

  • โœ… Full conversion of all original XBoing assets (graphics, sounds, levels)
  • โœ… Level loading system that reads and displays original level files
  • โœ… Block implementation with correct behaviors and effects
  • โœ… Ball physics and collision detection
  • โœ… Paddle movement and control (keyboard and mouse)
  • โœ… Audio system for event-driven sound effects
  • โœ… Event-driven, component-based UI (score, lives, ammo, level, timer, messages)
  • โœ… Paddle gun/ammo feature: ammo state, UI, collection, and sound (Phase 1 complete)
  • ๐Ÿšง Special power-ups and effects (in progress)
  • ๐Ÿšง Game state management and transitions (polished, but ongoing)
  • ๐Ÿšง Score tracking and high scores (basic, more to come)
  • ๐Ÿšง Machine gun mode and bullet logic (planned)

The game is fully playable, with most core features implemented and tested. Remaining work focuses on advanced power-ups, polish, and additional features to match and extend the original XBoing experience.

๐Ÿ’ป For Developers

Project Structure

xboing-python/
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ xboing/
โ”‚       โ”œโ”€โ”€ assets/           # Game assets (images, sounds, levels, config)
โ”‚       โ”‚   โ”œโ”€โ”€ images/       # All game images (balls, blocks, backgrounds, etc.)
โ”‚       โ”‚   โ”œโ”€โ”€ sounds/       # Sound effects (WAV)
โ”‚       โ”‚   โ”œโ”€โ”€ levels/       # Level data files
โ”‚       โ”‚   โ””โ”€โ”€ config/       # Block types and other config
โ”‚       โ”œโ”€โ”€ controllers/      # Controllers for game, window, UI, etc.
โ”‚       โ”œโ”€โ”€ engine/           # Game engine (graphics, audio, input, window)
โ”‚       โ”œโ”€โ”€ game/             # Game logic (ball, blocks, paddle, collision, state)
โ”‚       โ”œโ”€โ”€ layout/           # Layout helpers and game layout logic
โ”‚       โ”œโ”€โ”€ renderers/        # Rendering helpers (digits, lives, etc.)
โ”‚       โ”œโ”€โ”€ ui/               # User interface components (views, displays)
โ”‚       โ”œโ”€โ”€ utils/            # Utility functions and helpers
โ”‚       โ”œโ”€โ”€ di_module.py      # Dependency injection setup
โ”‚       โ”œโ”€โ”€ app_coordinator.py# App entry coordination
โ”‚       โ””โ”€โ”€ main.py           # Main entry point
โ”œโ”€โ”€ docs/                     # Documentation and design docs
โ”œโ”€โ”€ scripts/                  # Utility scripts for asset conversion, etc.
โ”œโ”€โ”€ tests/                    # Test scripts
โ”‚   โ”œโ”€โ”€ integration/          # Integration tests
โ”‚   โ””โ”€โ”€ unit/                 # Unit tests
โ””โ”€โ”€ xboing2.4-clang/          # Original XBoing C source/assets (reference)

Asset Management

All asset path helpers resolve to src/xboing/assets/ and its subfolders. All images, sounds, and levels are loaded from this canonical directory inside the package. Asset conversion scripts in scripts/ should use this path for input/output.

  • Original XPM graphics โ†’ PNG format (in src/xboing/assets/images/)
  • Original AU sound files โ†’ WAV format (in src/xboing/assets/sounds/)

Use the provided conversion scripts in scripts/ to update or add assets as needed.

Asset Migration Tools

# Run tests
hatch run test

# Convert XPM to PNG (for new assets)
python scripts/convert_xpm_to_png.py path/to/image.xpm output.png

# Convert AU to WAV (for new sounds)
python scripts/convert_au_to_wav.py path/to/sound.au output.wav

# Normalize all audio files in the assets directory
python scripts/normalize_audio.py

# Fix background images (formatting, transparency, etc.)
python scripts/fix_background.py

# Fix ball lost sound or related assets
python scripts/fix_balllost.py

# Search dependencies in the codebase
python scripts/dep_grep.py <search_term>

Design Documentation

See the docs/ directory for detailed information:

Contributing

Contributions are welcome! Areas that need work:

  1. Complete implementation of all special block effects
  2. High score system
  3. Game state management and transitions
  4. Enhanced visual effects
  5. Additional sound effects
  6. Level editor

Testing & Quality

  • All major UI components (score, lives, level, timer, message window) are event-driven, component-based, and have dedicated unit tests.
  • The test suite includes both unit and integration tests, covering game logic, event-driven UI updates, and core systems.
  • Tests are run before and after each major change to ensure stability and catch regressions early.
  • Type hints and docstrings are used throughout for clarity and static analysis.
  • Logging is used for warnings and errors (no print statements in production code).
  • The codebase is designed for maintainability, extensibility, and testability, following modern Python best practices.

License

This project is licensed under the same terms as the original XBoing - see the LICENSE file for details.

Original Source

The original source code is available at: https://www.techrescue.org/xboing/xboing2.4.tar.gz

Commit Message Standard

This project uses the Conventional Commits standard for all commit messages. This helps automate changelogs, semantic versioning, and improves code review clarity.

Format:

<type>(<scope>): <short summary>
  • type: feat, fix, chore, refactor, test, docs, etc.
  • scope: the area of the codebase affected (e.g., gun, ammo, ui)
  • summary: a brief description of the change

Example:

feat(gun): implement ammo collection event, state, and UI update

See the Conventional Commits documentation for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xboing-0.3.3.tar.gz (14.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xboing-0.3.3-py3-none-any.whl (15.0 MB view details)

Uploaded Python 3

File details

Details for the file xboing-0.3.3.tar.gz.

File metadata

  • Download URL: xboing-0.3.3.tar.gz
  • Upload date:
  • Size: 14.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for xboing-0.3.3.tar.gz
Algorithm Hash digest
SHA256 bac19c91e39fbd6d97dd389dc6779d3db6032297769b04e702b38125c7b82f66
MD5 8e2aa063936a316ebb06d88481090d81
BLAKE2b-256 48fee9bd2a1e40b6cc46cc4255bb3f533d9481c00f8b20ccf6d9d01866ebf80e

See more details on using hashes here.

File details

Details for the file xboing-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: xboing-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 15.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for xboing-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2cae4b956c05486b5caa7abe5ac9334f694a6625c732c64f509725056b0067bc
MD5 c71f00de89f44200bf15127e9977e703
BLAKE2b-256 d3d3720f7e9e55a9bb26c5312b0509ed0fb078b839ef3066667c91f7d51e3b53

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page