{"id":50492090,"url":"https://github.com/listar/topdown-adventure","last_synced_at":"2026-06-02T03:31:12.664Z","repository":{"id":356676680,"uuid":"1233577492","full_name":"listar/topdown-adventure","owner":"listar","description":"topdown-adventure","archived":false,"fork":false,"pushed_at":"2026-05-09T06:43:02.000Z","size":10766,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-09T08:36:48.810Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/listar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-09T05:38:41.000Z","updated_at":"2026-05-09T06:43:06.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/listar/topdown-adventure","commit_stats":null,"previous_names":["listar/topdown-adventure"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/listar/topdown-adventure","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/listar%2Ftopdown-adventure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/listar%2Ftopdown-adventure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/listar%2Ftopdown-adventure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/listar%2Ftopdown-adventure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/listar","download_url":"https://codeload.github.com/listar/topdown-adventure/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/listar%2Ftopdown-adventure/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33805340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-02T02:00:07.132Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-02T03:31:11.400Z","updated_at":"2026-06-02T03:31:12.659Z","avatar_url":"https://github.com/listar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 仙踪奇缘 · Topdown Adventure\n\n受《梦幻西游》启发的 **2D 竖屏回合制 RPG** 浏览器 Demo：探索场景、对话、任务与回合战斗。设计目标见仓库内 [`design-doc.md`](design-doc.md)。\n\n## 技术栈\n\n- **渲染**：HTML5 Canvas 2D（内部分辨率 384×640，CSS 适配手机竖屏）\n- **逻辑**：原生 JavaScript（无构建步骤、无 npm 依赖）\n- **资源**：`art/` 下 PNG 精灵与场景图（可由 `art/` 内 Python 脚本再生成）\n\n## 本地运行\n\n仓库根目录即为静态站点根路径，需用 **HTTP 服务** 打开（直接 `file://` 打开可能受浏览器安全策略影响）。\n\n```bash\ncd /path/to/topdown-adventure\npython3 -m http.server 8080\n```\n\n浏览器访问：\u003chttp://localhost:8080\u003e\n\n或使用任意静态服务器，例如：`npx --yes serve -p 8080`。\n\n## 目录结构\n\n| 路径 | 说明 |\n|------|------|\n| `index.html` | 入口页 |\n| `style.css` | 全局样式（手机框、画布缩放等） |\n| `js/` | 游戏逻辑：`game.js` 主循环与资源；`battle.js` 战斗；`scenes.js` / `npc.js` / `quests.js` 等 |\n| `art/assets/` | UI 与过场卡片等图 |\n| `art/scenes/` | 场景背景与装饰精灵 |\n| `art/tiles/` | 瓦片与道具图 |\n| `art/*.py` | 美术资源生成脚本（需 Python 与 Pillow 等，见各文件头部说明） |\n| `design-doc.md` | 游戏设计文档（GDD） |\n\n## 在 GitHub 上在线访问（GitHub Pages）\n\n本仓库包含 [GitHub Actions 工作流](.github/workflows/pages.yml)：在推送 `main` 分支后自动把可运行站点部署到 **GitHub Pages**。\n\n### 一次性配置（顺序很重要）\n\n1. 将本仓库推送到 GitHub（例如 `https://github.com/\u003c你的用户名\u003e/topdown-adventure`）。\n2. **先**打开仓库 **Settings → Pages**。\n3. 在 **Build and deployment** 里，把 **Source** 设为 **GitHub Actions**，并保存（页面里会说明将通过 Actions 发布）。  \n   **若仍为 “Deploy from a branch” 或从未打开过 Pages，工作流在部署阶段可能失败。**\n4. **再**推送到 `main`（或手动 **Run workflow**），等待 “Deploy static site to GitHub Pages” 变绿。\n\n### 故障排除\n\n| 现象 | 处理 |\n|------|------|\n| `Get Pages site failed` / `Not Found`（与 `configure-pages` 或 Pages API 相关） | 已在工作流中去掉 `configure-pages`。若仍失败，请确认第 3 步已把 **Source** 设为 **GitHub Actions**，保存后重新运行工作流。 |\n| 私有仓库部署异常 | 确认仓库 **Settings → Actions → General** 里 Workflow permissions 允许读写；私有仓库的 Pages 可能受套餐限制，见 [GitHub 文档](https://docs.github.com/pages/getting-started-with-github-pages/about-github-pages)。 |\n\n### 访问地址\n\n项目站点的默认 URL 为：\n\n```text\nhttps://\u003c你的用户名\u003e.github.io/\u003c仓库名\u003e/\n```\n\n例如仓库名为 `topdown-adventure` 时，游戏入口为：\n\n```text\nhttps://\u003c你的用户名\u003e.github.io/topdown-adventure/\n```\n\n若使用组织或自定义域名，以 GitHub Pages 设置页显示的 URL 为准。\n\n### 手动再次部署\n\n在 Actions 页面选择该工作流，点击 **Run workflow** 即可在不改代码的情况下重新部署当前 `main`。\n\n或在已安装 [GitHub CLI](https://cli.github.com/) 且已 `gh auth login` 的机器上执行：\n\n```bash\n./scripts/publish-github-pages.sh\n```\n\n默认从分支 `main` 触发；若要部署其他分支：`./scripts/publish-github-pages.sh 你的分支名`。\n\n## 许可与贡献\n\n若你尚未添加许可证，可在仓库根目录补充 `LICENSE` 后再开源。欢迎通过 Issue / PR 讨论玩法与代码改进。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flistar%2Ftopdown-adventure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flistar%2Ftopdown-adventure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flistar%2Ftopdown-adventure/lists"}