It's recommended to use pyenv or a venv for development.
To set up a local development environment:
python3 -m venv venv
source venv/scripts/activate
python3 -m venv venv
venv/Scripts/activate
Once you have an environment created, link the local source tree with pip.
pip install -e .
The engine supports two pacing backends for the render loop:
pygame(default): usespygame.time.delay/get_ticks.fast: usestime.perf_counter_ns()with a sleep+spin hybrid for tighter pacing.
CLI options (inherited by all games):
--timer-backend=pygame|fast- Selects the pacing backend (default:
pygame).
- Selects the pacing backend (default:
--sleep-granularity-ns=<int>- Minimum sleep granularity in nanoseconds for the
fastbackend. - Default:
1000000(1 ms). Set to0to uncap (spin-only last mile).
- Minimum sleep granularity in nanoseconds for the
--windows-timer-1ms- On Windows, request 1 ms system timer resolution via WinMM while running (power impact; off by default).
--log-timer-jitter- Periodically logs jitter statistics (p50/p95/p99/max) for the last frames.
Examples:
# Default behavior (pygame backend)
python -m glitchygames.tools.bitmappy --timer-backend=pygame
# High-precision pacing with 1 ms granularity
python -m glitchygames.tools.bitmappy --timer-backend=fast --sleep-granularity-ns=1000000
# Fully uncap (no pacing) – combine with target fps 0
python -m glitchygames.tools.bitmappy --target-fps=0
# Windows: enable 1 ms resolution
python -m glitchygames.tools.bitmappy --timer-backend=fast --windows-timer-1ms
# Debug jitter stats
python -m glitchygames.tools.bitmappy --timer-backend=fast --log-timer-jitter