Skip to main content

A GPU-accelerated 2D game engine for Python with camera, drawing and packaging helpers.

Project description

PyBitEngine ⚡

Documentation License Python

A GPU-accelerated 2D game engine for Python, built on SDL2, ModernGL, NumPy and Numba.

PyBitEngine helps developers draw thousands of 2D objects efficiently while keeping the API simple. It uses instanced GPU rendering, texture atlases, and Numba kernels to reduce runtime overhead.


📦 Version: 0.1.3

This release brings major new features: a unified collision system, mouse helpers, rounded shapes, pixel‑perfect texture collisions, a texture atlas, depth sorting, performance optimizations, and a complete timer module.

What is new in 0.1.3

  • Unified collision systemCheckCollision works with any combination of immutable shapes (Rect, Circle, Ellipse, Triangle, Line, RotRect, RoundedRect, Polygon, TextureCollider). Zero object creation overhead.
  • Mouse helpersMouseOver, MousePressed, MouseClicked, MouseHeld, MouseDragging, MouseWheelOn work directly with any shape and optionally with a camera for world-space picking.
  • Full rounded shapesDrawRoundedRect, DrawRoundedTriangle and their outline variants, with GPU-instanced batch versions (DrawRoundedRectsBatch, DrawRoundedTrianglesBatch).
  • Pixel‑perfect texture collisionsCollidePointTexture and CollidePointTextureBatch use the alpha channel stored on the CPU (no GPU readback, no disk I/O at runtime).
  • Texture atlasLoadTextureAtlas inserts an image into the shared atlas; DrawSpritesBatch can then render thousands of sprites from the same atlas in one draw call.
  • Easy‑to‑use batch wrappersDrawRects, DrawLines, DrawCircles, DrawEllipses, DrawSprites, DrawTexts accept lists of tuples with the same parameters as their immediate counterparts. No NumPy knowledge required.
  • Early‑Z / depth sortingenable_early_z() and the begin_opaque_pass() / begin_transparent_pass() helpers let you sort opaque objects front‑to‑back and transparent objects back‑to‑front, dramatically reducing overdraw.
  • Performance boost — color packing in uint32, pre‑computed cos/sin on the CPU, optimized Numba kernels, and fewer allocations make batch rendering faster than ever.
  • Complete key constants — all keyboard and mouse constants are now exported, including previously missing ones like PE_K_CAPSLOCK, PE_K_NUMLOCK, PE_K_PRINTSCREEN, PE_K_LSUPER, etc.
  • PE_TIME module — non‑blocking timers: Scheduler, After, Every, Countdown, Cooldown, Stopwatch, plus AsyncTimer/AsyncAfter for background work with RunOnMainThread and PumpMainThread.
  • PE_PAKER modulepack() creates standalone executables using cx_Freeze, with automatic inclusion of assets and dependencies.
  • CameraGPU and CameraCPU — both now support smooth follow, screen‑shake, world bounds, coordinate conversion (screen_to_world / world_to_screen), and batch culling (is_visible_batch). The shake offset is now zero‑mean (no net drift).
  • Painter’s algorithm fixedDrawTexture now participates in the same batching system as primitives, so draw calls appear in the exact order they are issued.

🚀 Installation

pip install pybitengine

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

pybitengine-0.1.3a2.tar.gz (98.0 kB view details)

Uploaded Source

Built Distribution

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

pybitengine-0.1.3a2-py3-none-any.whl (97.7 kB view details)

Uploaded Python 3

File details

Details for the file pybitengine-0.1.3a2.tar.gz.

File metadata

  • Download URL: pybitengine-0.1.3a2.tar.gz
  • Upload date:
  • Size: 98.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for pybitengine-0.1.3a2.tar.gz
Algorithm Hash digest
SHA256 9f994cb7a20620f6f5e77cfaa6fa3d74a1b3bf17bbc3f783ad93739e280cc64b
MD5 752cb2ade83ba99ea4c61503ed39076f
BLAKE2b-256 2ead87e55239d24a4c9713b44e661a1323e3c8012250ec29514caa1d9bb172d8

See more details on using hashes here.

File details

Details for the file pybitengine-0.1.3a2-py3-none-any.whl.

File metadata

  • Download URL: pybitengine-0.1.3a2-py3-none-any.whl
  • Upload date:
  • Size: 97.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for pybitengine-0.1.3a2-py3-none-any.whl
Algorithm Hash digest
SHA256 8fd779ffb23f30c0af446782c79fe36c8538143f9c094ef113b8642fca5abb19
MD5 877ff3950e23f3199970087501ec4bb8
BLAKE2b-256 54aecfac4160d2aafd2601f84b595e0f6a9fa8620a4c054fc2d857e5fac4b647

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