Communitygithub.com

SamuelChien/mega-skills-collection

2D游戏开发原则:精灵、瓦片地图、物理、摄像机。

mega-skills-collection 是什么?

此技能提供了一套全面的2D游戏开发原则,覆盖精灵系统、瓦片地图设计、2D物理、摄像机系统以及常见游戏类型模式。它帮助开发者快速掌握最佳实践,例如使用图集减少绘制调用、简化碰撞体形状、以及平滑摄像机跟随。该技能适用于Claude Code等AI编码助手,支持在对话中直接应用这些指导方针。通过清晰的表格和反模式列表,开发者可以避免常见陷阱,构建更清晰的2D游戏体验。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/SamuelChien/mega-skills-collection/tree/HEAD/2d-games

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

2D 游戏开发

2D 游戏系统开发原则。


1. 精灵系统

精灵组织

组件用途
图集 (Atlas)合并纹理,减少绘制调用
动画 (Animation)帧序列
轴心点 (Pivot)旋转/缩放原点
层级 (Layering)Z 轴顺序控制

动画原则

  • 帧率:通常为 8-24 FPS
  • 挤压与拉伸增强冲击力
  • 动作前的预备动作
  • 动作后的跟随动作

2. 瓦片地图设计

瓦片考量

因素建议
尺寸16x16、32x32、64x64
自动贴图用于地形生成
碰撞使用简化形状

图层

图层内容
背景不可交互的场景
地形可行走的地面
道具可交互的对象
前景视差覆盖层

3. 2D 物理

碰撞形状

形状使用场景
盒体 (Box)矩形物体
圆形 (Circle)球体、圆角物体
胶囊体 (Capsule)角色
多边形 (Polygon)复杂形状

物理考量

  • 像素完美 vs 基于物理
  • 固定时间步长确保一致性
  • 使用图层进行过滤

4. 摄像机系统

摄像机类型

类型用途
跟随 (Follow)跟踪玩家
前瞻 (Look-ahead)预判移动方向
多目标 (Multi-target)双人模式
房间切换 (Room-based)类银河恶魔城游戏

屏幕震动

  • 持续时间短(50-200 毫秒)
  • 强度逐渐衰减
  • 慎用

5. 游戏类型模式

平台跳跃游戏

  • 悬空补偿(离开边缘后的缓冲)
  • 跳跃缓冲
  • 可变跳跃高度

俯视角游戏

  • 八方向或自由移动
  • 瞄准辅助或自动瞄准
  • 考虑是否启用旋转

6. 反模式

❌ 不要✅ 应该
使用独立纹理使用图集
复杂碰撞形状简化碰撞
抖动摄像机平滑跟随
像素完美与物理混用选择其中一种方法

记住: 2D 的核心是清晰。每个像素都应有其意义。

适用场景

当任务明确匹配上述概述中的工作流或操作时,可使用此技能。

限制

  • 仅当任务明确匹配上述范围时使用此技能。
  • 请勿将输出视为环境特定验证、测试或专家评审的替代方案。
  • 如果缺少必要的输入、权限、安全边界或成功标准,请停止并请求澄清。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

SamuelChien/mega-skills-collection

Security audit, hardening, threat modeling (STRIDE/PASTA), Red/Blue Team, OWASP checks, code review, incident response, and infrastructure security for any project.

SamuelChien/mega-skills-collection

Arquitecto de Soluciones Principal y Consultor Tecnológico de Andru.ia. Diagnostica y traza la hoja de ruta óptima para proyectos de IA en español.

SamuelChien/mega-skills-collection

Ingeniero de Sistemas de Andru.ia. Diseña, redacta y despliega nuevas habilidades (skills) dentro del repositorio siguiendo el Estándar de Diamante.

SamuelChien/mega-skills-collection

Estratega de Inteligencia de Dominio de Andru.ia. Analiza el nicho específico de un proyecto para inyectar conocimientos, regulaciones y estándares únicos del sector. Actívalo tras definir el nicho.

SamuelChien/mega-skills-collection

3D game development principles. Rendering, shaders, physics, cameras.

SamuelChien/mega-skills-collection

Expert in building 3D experiences for the web - Three.js, React Three Fiber, Spline, WebGL, and interactive 3D scenes. Covers product configurators, 3D portfolios, immersive websites, and bringing depth to web experiences.

SamuelChien/mega-skills-collection

Accessibility audit skill for scanning, fixing, and verifying WCAG 2.2 Level A and AA compliance across React, Next.js, Vue, Angular, Svelte, and plain HTML codebases. Use when auditing accessibility, fixing a11y violations, checking color contrast, generating compliance reports, or integrating accessibility checks into CI/CD pipelines.

SamuelChien/mega-skills-collection

Ab Test Analyzer - Auto-activating skill for Data Analytics. Triggers on: ab test analyzer, ab test analyzer Part of the Data Analytics skill category.

SamuelChien/mega-skills-collection

A B Test Config Creator - Auto-activating skill for ML Deployment. Triggers on: a b test config creator, a b test config creator Part of the ML Deployment skill category.

SamuelChien/mega-skills-collection

When the user wants to plan, design, or implement an A/B test or experiment. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," "hypothesis," "conversion experiment," "statistical significance," or "test this." For tracking implementation, see analytics-tracking.

SamuelChien/mega-skills-collection

Acceptance Criteria Creator - Auto-activating skill for Enterprise Workflows. Triggers on: acceptance criteria creator, acceptance criteria creator Part of the Enterprise Workflows skill category.

SamuelChien/mega-skills-collection

Use when a coding task should be driven end-to-end from issue intake through implementation, review, deployment, and acceptance verification with minimal human re-intervention.

SamuelChien/mega-skills-collection

Accessibility Audit Runner - Auto-activating skill for Frontend Development. Triggers on: accessibility audit runner, accessibility audit runner Part of the Frontend Development skill category.

SamuelChien/mega-skills-collection

You are an accessibility expert specializing in WCAG compliance, inclusive design, and assistive technology compatibility. Conduct audits, identify barriers, and provide remediation guidance.

SamuelChien/mega-skills-collection

Web accessibility patterns for WCAG 2.2 compliance including ARIA, keyboard navigation, screen readers, and testing

SamuelChien/mega-skills-collection

Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed, or change policy for the Discord channel.

SamuelChien/mega-skills-collection

Create unified specification packages across Business, Development, and Design teams. Staged elaboration (L0 Vision → L1 Requirements → L2 Team Detail → L3 Acceptance Criteria) to build shared understanding. Does not write code.

SamuelChien/mega-skills-collection

Research a company or person and get actionable sales intel. Works standalone with web search, supercharged when you connect enrichment tools or your CRM. Trigger with "research [company]", "look up [person]", "intel on [prospect]", "who is [name] at [company]", or "tell me about [company]".

SamuelChien/mega-skills-collection

Create forensically sound bit-for-bit disk images using dd and dcfldd while preserving evidence integrity through hash verification.

SamuelChien/mega-skills-collection

Validate messaging consistency across website, GitHub repos, and local documentation generating read-only discrepancy reports. Use when checking content alignment or finding mixed messaging. Trigger with phrases like "check consistency", "validate documentation", or "audit messaging".

相关技能