python-game-developer
Installation
SKILL.md
Raylib Game Development
This skill provides a foundation for building games using Python and raylib for simulation and visualization.
Core Philosophy
- Module-Based First: Start with module-level functions and minimal state. Only introduce classes when the game genuinely complexifies.
- Layered Architecture: Split the project into three layers:
core/— data, physics, input, and graphics abstractions (no rendering code)game/— gameplay logic; imports only fromcoreengine/— Raylib adapters implementing thecoreprotocols
- Engine Injection:
main.pywires the system, injecting the concrete implementations into the game layer. This lets tests swap the real adapters for mocks. - Simulation/Visualization Split: Keep physics and state updates separate from Raylib drawing. The simulation must be testable without a graphics context.
- Headless-Ready (Strict): Logic in
core/andgame/must never import fromengine/orpyray. - Simple Before Object-Oriented: Prefer plain functions and dataclasses. The Scene pattern is valid for complex state machines, but start with module-level functions and refactor only when needed.
- Decouple Input and Graphics: Always decouple the input implementation and the graphical implementation instead of creating a monolithic "engine". Keeping them separate allows independent mocking/testing and simplifies implementation swapping.
- High-Level Representation Rendering: Rendering protocols must define high-level, semantic representation draws (e.g.,
render_game(state)) rather than exposing low-level primitives (like line/rectangle draws) to the game logic. This gives any concrete implementation the liberty to enhance and polish graphics (e.g., adding shaders, rich UI styling, particles) without changing a single line of game logic.