2d-games

A reference for making two-dimensional games, where play happens across a flat screen using sprites, tiles, and animation. It covers the building blocks behind responsive movement and coherent visuals.

In plain words
What is it for?
Use it when building or reviewing platformers, top-down shooters, or other 2D games, including sprite animation, tilemaps, collision and physics, camera behavior, and jump feel.
Why use it?
It gives developers practical guidance for solving common 2D game problems without having to work out sprite setup, collisions, cameras, and movement patterns from scratch.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/phuonghx/aim-cli/2d-games
Any agent
npx skills add phuonghx/aim-cli --skill 2d-games
Clone the repo
git clone --depth 1 https://github.com/phuonghx/aim-cli

Made for: Claude Code, Codex.

Per session 96 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,038 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00096 $0.01038
Opus 5 $0.00048 $0.00519
Sonnet 5 $0.00019 $0.00208
Haiku 4.5 $0.00010 $0.00104

Measured 2d ago against content hash 7b8291e2d359, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

2d-games scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

aim/templates/aim-agents/skills/game-development/2d-games/SKILL.md · 113 lines

How it starts

The opening of the file, as written. The whole thing — 113 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Building Games in 2D

A working reference for the systems that make a 2D game feel responsive and look coherent.


Sprites and Animation

Art that is loaded and drawn efficiently keeps frame times low and motion legible.

How to organize sprite data:

  • Texture atlas — pack many images into one sheet so the GPU issues fewer draw calls. A character's idle, walk, and jump frames all live on a single sheet rather than as 30 separate files.
  • Frame sequence — an ordered list of regions on the atlas, cycled to produce motion.
  • Pivot point — the anchor used for rotation and scaling. Put a sword's pivot at the handle, not the center, so it swings correctly.
  • Z-order — the integer that decides who draws on top. The player's z sits above the floor tiles but below the HUD.

Making motion feel alive:

  • Animate somewhere between 8 and 24 frames per second depending on the style — chunky retro sprites read fine at the low end, fluid action wants the high end.
  • Compress and elongate shapes (squash & stretch) on impacts and jumps to sell weight.
  • Lead into a big action with a brief wind-up (anticipation) — a crouch before a leap.
  • Let motion settle afterward (follow-through) instead of snapping to a stop.

Tilemaps

Grid-based levels are fast to author and cheap to render.

Decision Guidance
Tile dimension Stick to a power of two — 16, 32, or 64 px — and stay consistent
Terrain edges Lean on auto-tiling so corners and borders pick themselves
Collision data Approximate with coarse shapes, not the exact painted pixels

A typical layer stack, back to front:

  1. Backdrop — distant scenery you can never touch.
  2. Ground — the solid tiles the player stands on.
  3. Objects — chests, switches, pickups the player interacts with.
  4. Overlay — foreground elements that scroll at a different rate for parallax depth.

Collision and Physics

Collider Best for
Box Crates, platforms, walls
Circle Coins, bombs, anything round
Capsule Player and enemy bodies
Polygon Irregular hand-authored shapes

Read the full file on GitHub · 113 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 113 lines · 96 tokens per session scan A 7b8291e2d359

Subscribe to this mod's changes

2d-games is a skill published in the GitHub repository phuonghx/aim-cli (1 stars, last pushed 2mo ago), licensed MIT. It adds 96 tokens to every session and 1,038 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

hs-release

Cut a core Hindsight release (vX.Y.Z) and open the changelog + blog PR. Use when asked to cut/start a release, bump the version, or publish a new Hindsight version.

vectorize-io/hindsight · 45 tokens

research-repository

Build a repository that makes findings findable, reusable, and cumulative across teams. Use when the same research keeps getting redone. For synthesising one study, use affinity-diagram.

Owl-Listener/designer-skills · 43 tokens

survey-design

Design unbiased survey instruments — question wording, scales, and sampling — to measure attitudes at scale. Use when you need quantitative breadth. For behavioural experiments, use a-b-test-design (prototyping-testing).

Owl-Listener/designer-skills · 47 tokens

design-critique

Facilitate a structured team critique — framing, feedback rules, and actionable outcomes. Use when running a session with people in the room. For a solo expert review, use heuristic-evaluation (prototyping-testing).

Owl-Listener/designer-skills · 53 tokens

handoff-spec

Write the implementation handoff — measurements, behaviours, assets, states, and edge cases. Use when engineering picks up the work. For verifying the result afterwards use design-qa-checklist; for reusable library components use component-spec (design-systems).

Owl-Listener/designer-skills · 57 tokens

team-workflow

Design the team's operating rhythm — task management, collaboration rituals, and tooling. Use when the day-to-day cadence needs structure. For a time-boxed sprint, use design-sprint-plan.

Owl-Listener/designer-skills · 43 tokens