{"id":29414444,"url":"https://github.com/foxzool/reversi","last_synced_at":"2026-04-19T02:03:52.434Z","repository":{"id":302793498,"uuid":"1013501505","full_name":"foxzool/reversi","owner":"foxzool","description":"黑白棋游戏","archived":false,"fork":false,"pushed_at":"2025-07-04T08:58:03.000Z","size":107,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-04T09:32:27.845Z","etag":null,"topics":["bevy","bevy-game"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/foxzool.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}},"created_at":"2025-07-04T02:36:23.000Z","updated_at":"2025-07-04T08:58:06.000Z","dependencies_parsed_at":"2025-07-04T09:34:12.171Z","dependency_job_id":"9b125777-0c94-4e24-9303-02ba25784f08","html_url":"https://github.com/foxzool/reversi","commit_stats":null,"previous_names":["foxzool/reversi"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/foxzool/reversi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxzool%2Freversi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxzool%2Freversi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxzool%2Freversi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxzool%2Freversi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/foxzool","download_url":"https://codeload.github.com/foxzool/reversi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxzool%2Freversi/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264827204,"owners_count":23669702,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bevy","bevy-game"],"created_at":"2025-07-11T14:00:51.453Z","updated_at":"2026-04-19T02:03:52.407Z","avatar_url":"https://github.com/foxzool.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Reversi (Othello) Game\n\n基于最新Bevy 0.16引擎的黑白棋游戏实现，包含AI对手和完整的移动端优化游戏界面。\n\n## ✨ v0.3.0 新功能\n\n- 🎮 **完整游戏流程重设计**: 加载界面 → 语言选择 → 难度选择 → 游戏进行\n- 📱 **移动端优化**: 44px最小触摸目标，400×600分辨率优化，完美触摸支持\n- 🤖 **异步AI系统**: 防止UI阻塞的异步计算，流畅游戏体验\n- 🎨 **视觉改进**: 玩家头像匹配棋子颜色，随机初始棋子变化\n- 🌍 **国际化支持**: 完整的中英双语界面\n- ⚡ **性能优化**: 实体清理系统，Changed\u003cT\u003e过滤器优化\n\n## 功能特点\n\n- **高效位板表示**: 使用64位整数表示棋盘状态，实现快速计算\n- **智能AI对手**: \n  - Minimax算法配合Alpha-Beta剪枝\n  - 异步计算防止界面卡顿\n  - 多级难度设置（初级、中级、高级、专家）\n  - 综合评估函数（角位控制、稳定性、行动力等）\n- **现代游戏界面**: 基于Bevy引擎的2D渲染\n- **移动端友好**: 触摸优化，响应式设计\n- **事件驱动架构**: 使用ECS模式组织代码\n\n## 项目结构\n\n```\nsrc/\n├── game/           # 游戏核心逻辑\n│   ├── board.rs    # 棋盘表示和基础操作\n│   └── rules.rs    # 游戏规则和着法生成\n├── ai/             # AI相关模块\n│   ├── minimax.rs  # Minimax搜索算法（异步优化）\n│   ├── evaluation.rs # 棋盘评估函数\n│   └── difficulty.rs # AI难度级别和异步任务管理\n├── ui/             # 用户界面\n│   ├── board_ui.rs # 棋盘渲染（性能优化）\n│   ├── game_ui.rs  # 游戏状态显示（移动端优化）\n│   └── mod.rs      # UI模块导出\n├── localization/   # 国际化模块\n│   ├── mod.rs      # 语言设置管理\n│   └── texts.rs    # 多语言文本定义\n├── fonts/          # 字体管理\n│   └── mod.rs      # 中英文字体加载\n├── audio/          # 音频系统\n│   └── mod.rs      # 音效管理\n├── lib.rs          # 库入口（用于测试和文档）\n└── main.rs         # 主程序入口（状态管理）\n```\n\n## 运行方式\n\n### 本地开发\n```bash\n# 测试基础功能\ncargo run --example simple_test\n\n# 运行完整游戏\ncargo run\n```\n\n### 运行完整游戏\n```bash\ncargo run\n```\n\n## 游戏操作\n\n### 界面流程\n1. **语言选择**: 首次进入选择中文/English界面语言\n2. **难度选择**: 选择AI难度级别（初级、中级、高级、专家）\n3. **游戏进行**: 正式开始游戏对局\n\n### 游戏控制\n- **鼠标/触摸**: 点击空白格子进行落子\n- **有效位置**: 白色半透明圆点表示可落子位置\n- **返回按钮**: 游戏界面左上角可返回难度选择\n- **帮助规则**: 难度选择界面可查看游戏规则\n\n### 移动端优化\n- **触摸友好**: 所有按钮44px最小触摸目标\n- **响应式布局**: 400×600最佳分辨率，适配手机屏幕\n- **触摸反馈**: 按钮按压和悬停效果\n\n### 音效系统\n- **落子音效**: 每次成功落子时播放\n- **翻转音效**: 棋子翻转时播放\n- **胜利音效**: 玩家获胜时播放\n- **失败音效**: 玩家失败时播放\n- **错误音效**: 无效落子时播放\n- 音效可通过M键开关，默认开启\n\n## AI技术特点\n\n### 算法实现\n- **异步计算**: 使用AsyncComputeTaskPool防止UI阻塞\n- **搜索深度**: 根据难度动态调整（2-12层）\n- **时间控制**: 迭代加深搜索，带超时保护\n- **跨平台优化**: 桌面版多线程，Web版单线程兼容\n\n### 评估函数\n- **角位控制** (权重: 100): 占据角位获得稳定优势\n- **稳定性** (权重: 50): 不可翻转棋子的价值\n- **行动力** (权重: 30): 可用合法着法数量\n- **位置价值** (权重: 20): 基于位置的静态评估\n- **奇偶性** (权重: 10): 残局中的先手优势\n\n### 难度级别\n- **初级**: 深度2层，30%随机错误\n- **中级**: 深度4层，15%错误率\n- **高级**: 深度6层，5%错误率  \n- **专家**: 深度12层，完美对弈\n\n## 技术栈\n\n- **Bevy 0.16**: 现代Rust游戏引擎\n- **AsyncComputeTaskPool**: Bevy异步任务系统\n- **Rayon**: 并行计算框架（桌面版）\n- **futures-lite**: 异步任务轮询\n- **WASM**: Web平台支持\n- **位运算优化**: 高效的棋盘状态计算\n\n## 开发特色\n\n- 完全遵循Bevy的ECS架构模式\n- 事件驱动的游戏逻辑\n- 异步AI计算，不阻塞主线程\n- 移动端优化的触摸界面\n- 国际化支持，多语言切换\n- 模块化设计，易于扩展\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxzool%2Freversi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoxzool%2Freversi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxzool%2Freversi/lists"}