opencode/skills/game-development/flame/SKILL.md
Flame Engine 2D 遊戲開發完整指南 - 核心、系統、模板、部署
npx skillsauth add mbuyco/dotfiles flame-game-devInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Flame Engine 遊戲開發完整指南,包含核心基礎、14 個遊戲系統、3 種遊戲類型模板。
| Skill | Description | Reference Count | |-------|-------------|-----------------| | flame-core | 引擎核心基礎 | 10 references | | flame-systems | 14 個遊戲系統 | 14 references | | flame-templates | 遊戲類型模板 | 3 references |
components.md - 組件生命週期、類型
input.md - 觸控、鍵盤、搖桿
collision.md - 碰撞檢測、Hitbox
camera.md - 相機、HUD、視口
animation.md - 精靈動畫、Effects
scenes.md - RouterComponent、Overlays、UI
audio.md - 音效、背景音樂
particles.md - 粒子系統、特效
performance.md - 效能優化、最佳實踐
debug.md - 除錯模式、日誌
quest.md - 任務系統 achievement.md - 成就系統
dialogue.md - 對話系統 shop.md - 商店系統
localization.md - 多語言系統 crafting.md - 製作系統
inventory.md - 背包系統 procedural.md - 程序生成
paperdoll.md - 紙娃娃系統 multiplayer.md - 多人連線
combat.md - 戰鬥系統 leveleditor.md - 關卡編輯器
skills.md - 技能系統
saveload.md - 存檔系統
rpg.md - 回合制/動作 RPG
platformer.md - 橫向卷軸平台遊戲
roguelike.md - 程序生成地下城
# 基礎問題
需要了解 Flame? → 先讀 flame-core/SKILL.md
需要特定功能? → 根據 flame-core 索引讀取對應 reference
# 系統實作
需要任務/對話系統? → 讀 flame-systems/references/quest.md 或 dialogue.md
需要戰鬥系統? → 讀 flame-systems/references/combat.md + skills.md
需要存檔功能? → 讀 flame-systems/references/saveload.md
需要多人連線? → 讀 flame-systems/references/multiplayer.md
# 完整遊戲
要做 RPG? → 讀 flame-templates/references/rpg.md
要做平台遊戲? → 讀 flame-templates/references/platformer.md
要做 Roguelike? → 讀 flame-templates/references/roguelike.md
# 部署發布
要發布遊戲? → 參考下方「部署平台」章節
根據 Filip Hráček 的 Benchmark 測試,Flame 與其他引擎比較:
| 項目 | Flame | Unity/Godot | |------|-------|-------------| | 啟動時間 | 最快 | 較慢 | | 包體大小 | 較小 | 較大 | | 學習曲線 | Flutter 開發者友善 | 需學習新工具 | | 跨平台 | 一套代碼 6 平台 | 需平台適配 | | 熱重載 | 支援 | 部分支援 |
| 項目 | Flame | Unity/Godot | |------|-------|-------------| | 最大實體數 | ~數百個 | 數千個 | | 3D 支援 | 無 | 完整 | | 物理引擎 | 基礎 (Forge2D) | 完整 | | 編輯器 | 無視覺化編輯器 | 完整 IDE |
flutter create my_game && cd my_game
flutter pub add flame
flutter pub add flame_audio # 選用
flutter pub add flame_tiled # 選用
import 'package:flame/game.dart';
import 'package:flutter/material.dart';
void main() => runApp(GameWidget(game: MyGame()));
class MyGame extends FlameGame with HasCollisionDetection {
@override
Future<void> onLoad() async {
camera.viewfinder.anchor = Anchor.topLeft;
// 開始建構你的遊戲!
}
}
Flame 基於 Flutter,支援多平台部署:
| 平台 | 發布管道 | 指令 |
|------|----------|------|
| iOS | App Store | flutter build ios --release |
| Android | Google Play | flutter build apk --release |
| Web | itch.io / GitHub Pages | flutter build web --release |
| macOS | App Store / 獨立 | flutter build macos --release |
| Windows | Steam / 獨立 | flutter build windows --release |
| Linux | Steam / 獨立 | flutter build linux --release |
# 1. 建置 Web 版本
flutter build web --release --web-renderer canvaskit
# 2. 上傳 build/web 資料夾到 itch.io
# 3. itch.io 設置
# - Kind of project: HTML
# - Embed options: Click to launch in fullscreen
# 1. 建立 keystore
keytool -genkey -v -keystore ~/my-game.jks -keyalg RSA -keysize 2048 -validity 10000 -alias my-game
# 2. 設定 android/key.properties
storePassword=<password>
keyPassword=<password>
keyAlias=my-game
storeFile=/Users/you/my-game.jks
# 3. 建置 App Bundle
flutter build appbundle --release
# 4. 上傳 build/app/outputs/bundle/release/app-release.aab
# 1. 建置 Desktop 版本
flutter build windows --release # 或 macos / linux
# 2. 使用 Steamworks SDK 打包
# - 設定 app_build.vdf
# - 上傳到 Steam Partner
# 3. 建議加入 Steam 成就整合
# flutter pub add steamworks
flame/ (本索引)
│
├── flame-core (核心基礎)
│ └── 10 reference files
│
├── flame-systems (遊戲系統)
│ └── 14 reference files
│
└── flame-templates (遊戲模板)
└── 3 reference files
development
# SKILL.md ## Name VimReaper ## Description VimReaper is a dead‑code cleanup skill that systematically scans a codebase to identify and safely remove unused code—dead functions, unreachable blocks, obsolete variables, redundant imports, and leftover comments—while preserving the intended logic and test suite. As its name suggests, VimReaper wields the **vim editor** as its primary scalpel: code removal is performed using vim’s precise ex commands, search patterns, and scripted editing modes, m
development
Test-driven development with red-green-refactor loop. Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants integration tests, or asks for test-first development.
development
Find deepening opportunities in a codebase, informed by the domain language in CONTEXT.md and the decisions in docs/adr/. Use when the user wants to improve architecture, find refactoring opportunities, consolidate tightly-coupled modules, or make a codebase more testable and AI-navigable.
testing
Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".