pygame-core
Structure a pygame (pygame-ce) game in Python: the init/event/update/draw loop, delta-time movement, Surface/Rect blitting, keyboard/mouse input, and Sprite/Group management with collision. Use when building or debugging a pygame game — when the user mentions pygame, pygame-ce, the game loop, blit, Surface, Rect, sprite groups, or clock.tick. Targets pygame-ce.
npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill pygame-core --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# pygame Core Build the foundation of a pygame game in Python: the main loop, delta-time movement, drawing with `Surface`/`Rect`, input, and `Sprite`/`Group` management. Targets **pygame-ce 2.5+** (the actively maintained community fork; same `import pygame`). ## When to use - Use when starting a pygame game, fixing the loop, frame-rate-dependent speed, input handling, blitting, or sprite/group collision. - Use when code does `import pygame` and the project depends on `pygame-ce` (or `pygame`). **When *not* to use:** Python language questions unrelated to pygame. 3D rendering (pygame is 2D). For cross-engine save/load use `save-systems`; for rebindable input architecture see `input-systems`. ## Core workflow 1. **Install pygame-ce, not legacy pygame.** `pip install pygame-ce` — it's the maintained fork and imports as `pygame`. Don't install both in one environment. 2. **Init and open a window.** `pygame.init()`, `screen = pygame.display.set_mode((w, h))`, `clock = pygame.time.Clock()`. 3. **Run one loop: events → update → draw → flip.** Pump the event queue every frame (`for event in pygame.event.get()`), update state, redraw, then `pygame.display.flip()`. 4. **Make it frame-rate i
- When to use
- Core workflow
- Patterns
- 1. Minimal game loop (the skeleton)
- 2. Delta-time movement (frame-rate independent)
- 3. Input: events vs polling
- 4. A Sprite subclass + a Group
- 5. Collision detection
- Pitfalls
- References
- Related skills
What does the pygame-core skill do?
Structure a pygame (pygame-ce) game in Python: the init/event/update/draw loop, delta-time movement, Surface/Rect blitting, keyboard/mouse input, and Sprite/Group management with collision. Use when building or debugging a pygame game — when the user mentions pygame, pygame-ce, the game loop, blit, Surface, Rect, sprite groups, or clock.tick. Targets pygame-ce.
How do I install it?
Run `npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill pygame-core --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From gamedev-skills/awesome-gamedev-agent-skills, a repository with 406 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
