pygameturbo
Skill0 starsChanged 6 days agoMITView on GitHub
Use when someone is writing, debugging or learning a Pygame Turbo (pgturbo, the Pygame Zero fork) game in Python, asks about its hooks (draw, update, on_key_down, ...), built-ins (Actor, screen, images, sounds, music, clock, animate, tone, storage) or running it with pgtrun, or when teaching a beginner game programming with it.
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- capturing-tk-screenshots-headlessSkill
- concept-parableSkill
- opencode-apiSkill
- opencode-buildSkill
- opencode-cliSkill
- provider-onboardingSkill
- thonny-pluginSkill
- timestampSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 6 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 38
Not vendored (read online at https://pgturbo.readthedocs.io/): the example-game walkthroughs, the changelog, other libraries, contributing.
- Distinctive: line 40
When you point a learner to a page, give its online URL from the manifest.
- Distinctive: line 82
Ask what the game should do or what they tried.
- Distinctive: line 84
When they start a new game, suggest a folder for it (no spaces in the name), and let them create it.
- Distinctive: line 86
Start every explanation with which hooks the game needs and what work happens in each.
- Very specific: line 88
Check the exact API detail in references/ before explaining it.
- Distinctive: line 94
Keep project facts (the game, its files, assets) in the project's own notes, not here: these docs describe the library, not their game.
- Very specific: line 104
Never edit references/. Refresh from upstream with python scripts/refresh_references.py --ref main (or a tag or commit).
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Pygame Turbo
Pygame Turbo (pgturbo) is a fast-moving fork of Pygame Zero for
education: no event loop, no boilerplate. A game is a script that defines
hook functions (draw(), update(), on_key_down(), ...) and uses
built-in objects (Actor, screen, sounds, clock, ...). The API is
small but has sharp edges, and your training data is probably about Pygame
Zero or an older Turbo: read the matching reference before answering
anything detailed.
References
references/ holds the Pygame Turbo docs sources (.rst), verbatim, at the
commit in references/manifest.json; each page's online URL is in the
manifest too. License: references/README.md.
| Need | Read |
| A map of everything, one section per topic | references/overview.rst |
| A beginner course, step by step | references/tutorials/1_introduction.rst ... 4_animating_actors.rst |
| Coming from Scratch | references/tutorials/from_scratch.rst, references/references/scratch.rst |
| How something works (explanations, examples) | references/deep_dives/<topic>.rst: installation_and_running, update_draw_cycle, actors, screen, game_window, player_input, hooks, clock, audio, resources_and_storage, property_animation |
| Exact API: names, arguments, defaults | references/references/<topic>.rst: actor, animate, animations, clock, colors_ref, fonts, game_window, hooks, images, joystick, keyboard, mouse, music, screen, sounds, storage, tone |
| The bundled example games | references/examples/overview.rst (walkthroughs online only) |
| Books, tutorials, videos | references/misc/resources.rst |
Not vendored (read online at https://pgturbo.readthedocs.io/): the example-game walkthroughs, the changelog, other libraries, contributing. When you point a learner to a page, give its online URL from the manifest.
Running a game
Outside an IDE, pgtrun game.py runs a script. Inside an IDE (Thonny,
IDLE, VS Code, ...) the script must import pgtrun first and call
pgtrun.go() last, so plain "Run" works
(references/deep_dives/installation_and_running.rst):
import pgtrun
WIDTH = 300
HEIGHT = 300
def draw():
screen.fill((128, 0, 0))
pgtrun.go()pgtrun is Turbo's; pgzrun is Pygame Zero's. Don't mix them up:
Pygame Zero is older and better represented in training data. Turbo is
otherwise backward-compatible with Pygame Zero and adds features such as
flipbook animation and spritesheets.
Common pitfalls
- Movement and physics belong in
update();draw()only paints. - Hook arguments are passed by position and count:
on_mouse_down(),on_mouse_down(pos)andon_mouse_down(pos, button)all work, but the order is fixed (deep_dives/hooks.rst). draw()takes no arguments;update()may takedt.- An Actor's position is its anchor point, which defaults to the center, not the top-left corner.
- Images, sounds and music load by name from
images/,sounds/andmusic/next to the script, always without file extension. - Key names are attributes of
keyboardandkeys; check the exact names inreferences/references/keyboard.rst.
Teaching a beginner
- Ask what the game should do or what they tried; look at their code and any error.
- When they start a new game, suggest a folder for it (no spaces in the name), and let them create it.
- Start every explanation with which hooks the game needs and what work happens in each.
- Check the exact API detail in
references/before explaining it. - One small step at a time: name the hook or object, show a minimal snippet in chat, have them type it, run it and look.
- Debug by prediction: "what do you expect after this change?", then run.
- Let the learner install packages themselves (in Thonny: Tools > Manage packages); name the package rather than installing it.
- Keep project facts (the game, its files, assets) in the project's own notes, not here: these docs describe the library, not their game.
A good order of first projects: a window with a bouncing ball, one actor
moved by the keyboard, collisions and a score, a scrolling background with
a spawner, sprite animation frames, sound and music, a saved high score
(references/references/storage.rst).
Keeping references current
Never edit references/. Refresh from upstream with
python scripts/refresh_references.py --ref main (or a tag or commit);
--check reports edited or missing files offline, and with --ref also
whether upstream moved on. Then review the diff and update the table above
if pages were added, moved or removed.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

