| name | pygame-arcade |
| description | Build Python games with pygame (or pygame-ce) and arcade: event loop, clock and delta time, surfaces and sprite groups, arcade Window/View/SpriteList, a main.py layout whose logic stays testable without a display, pytest with SDL_VIDEODRIVER=dummy, windowed playtest, pyinstaller packaging. Use when the owner mentions pygame, arcade, or a Python game.
|
| version | 1.0.0 |
| author | Remedy |
| tags | ["game","python","pygame","arcade","pytest","pyinstaller"] |
| requires | [] |
| tools | ["game_project_info","bash_exec","file_read","file_write","file_edit","repo_search","list_dir","game_playtest","computer_screenshot","vision_decode"] |
| triggers | ["\\b(pygame|pygame-ce|arcade game|python game|python arcade)\\b"] |
pygame / arcade (Python games)
Python games are quick to scaffold and quick to verify: the logic runs
headless under pytest, and the window opens in a second for a playtest.
Fingerprint
game_project_info(path); file_read pyproject.toml / requirements.txt
→ pygame, pygame-ce (drop-in fork, same import pygame), or
arcade. main.py or <pkg>/__main__.py is the entry.
python -c "import pygame; print(pygame.version.ver)" or
import arcade; print(arcade.version.VERSION) inside the project's
environment (.venv, uv run, poetry run — follow what exists).
assets/ for images/sounds; tests/ for pytest.
Install when missing (ask first if the env is shared): pip install pygame-ce
or pip install arcade (arcade 3.x needs Python 3.9+ and OpenGL 3.3+).
Layout that stays testable
<game>/
main.py creates the window, runs the loop — thin
game/
logic.py rules, state, grid, scoring — no pygame import
entities.py dataclasses for player/enemies; pure math
render.py draws state onto a Surface / arcade window
input.py maps pygame events → logic commands
assets/
tests/test_logic.py
The split is the whole trick: logic.py never touches a display, so
pytest runs anywhere. Details: references/testing-without-a-window.md.
pygame loop (the shape)
pygame.init() → screen = pygame.display.set_mode((w, h)) →
clock = pygame.time.Clock() → loop: dt = clock.tick(60) / 1000 →
for event in pygame.event.get() (handle QUIT, KEYDOWN) →
keys = pygame.key.get_pressed() → update logic with dt → draw to
screen → pygame.display.flip(). Sprites: subclass pygame.sprite.Sprite
with image + rect, keep them in pygame.sprite.Group, call
and . Full skeleton and collision
helpers: .