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

  1. Module-Based First: Start with module-level functions and minimal state. Only introduce classes when the game genuinely complexifies.
  2. Layered Architecture: Split the project into three layers:
    • core/ — data, physics, input, and graphics abstractions (no rendering code)
    • game/ — gameplay logic; imports only from core
    • engine/ — Raylib adapters implementing the core protocols
  3. Engine Injection: main.py wires the system, injecting the concrete implementations into the game layer. This lets tests swap the real adapters for mocks.
  4. Simulation/Visualization Split: Keep physics and state updates separate from Raylib drawing. The simulation must be testable without a graphics context.
  5. Headless-Ready (Strict): Logic in core/ and game/ must never import from engine/ or pyray.
  6. 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.
  7. 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.
  8. 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.

Project Structure

Installs
5
First Seen
Jul 29, 2026