Compare commits
4 Commits
d5f6cea2ed
..
vs
| Author | SHA1 | Date | |
|---|---|---|---|
| fd383481fd | |||
| a0bae4b6b8 | |||
| 70b1665b31 | |||
| 59e491038d |
@@ -38,3 +38,4 @@
|
||||
|
||||
1. 每次补全前后都要保存版本,便于报告展示。
|
||||
2. 现场汇报时,所有组员都可能被提问,不能只有一人理解代码。
|
||||
3. 作业要求LLM对话迭代生成代码 虽然我们不是 我们是vibe coding 但是在后续生成报告相关的时候 要伪装的像是LLM对话迭代生成的
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 Tereis contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of the source code and associated documentation files in this repository,
|
||||
excluding third-party media assets and generated media assets as described in
|
||||
NOTICE.md, to deal in the source code without restriction, including without
|
||||
limitation the rights to use, copy, modify, merge, publish, distribute,
|
||||
sublicense, and/or sell copies of the source code, and to permit persons to
|
||||
whom the source code is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the source code.
|
||||
|
||||
THE SOURCE CODE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOURCE CODE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOURCE CODE.
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
# Notice
|
||||
|
||||
本仓库是程序设计课程大作业项目,仅用于课程学习、课堂展示和个人技术交流,不用于商业发布。
|
||||
|
||||
## 授权范围
|
||||
|
||||
- `src/`、构建脚本和项目文档中的原创代码内容按 `LICENSE` 中的 MIT License 授权。
|
||||
- `assets/`、`report/images/` 和 `report/code-snippets/` 中的图片、音频、视频等非代码素材不包含在 MIT License 授权范围内。
|
||||
- 如需二次发布、公开分发可执行文件或用于课程以外场景,请先替换或移除未取得独立授权的素材。
|
||||
|
||||
## 素材来源
|
||||
|
||||
- 音乐素材:来自《千恋*万花》,仅作为课程大作业学习展示使用,版权归原权利方所有。
|
||||
- 图片素材:由 AI 生成或用于课程报告展示。
|
||||
- 图标、视频和其他资源:仅随课程项目用于演示程序功能,不代表已获得商业使用授权。
|
||||
|
||||
## 使用提醒
|
||||
|
||||
如果将项目上传到公开平台,建议在发布说明中保留本文件,并明确说明素材来源和授权限制。若需要更严格地规避素材版权风险,可以只公开源码和文档,删除 `assets/` 下的媒体文件。
|
||||
|
||||
@@ -335,3 +335,15 @@ powershell -NoProfile -ExecutionPolicy Bypass -File .\build-mingw.ps1 -Run
|
||||
- `src/include/TetrisAppInternal.h`、`src/include/TetrisRenderInternal.h`、`src/include/TetrisAssets.h`:窗口层、渲染层和资源工具的内部声明
|
||||
|
||||
项目适合作为程序设计课程大作业展示,也便于在答辩时讲解窗口程序、游戏循环、碰撞检测、状态管理和功能扩展。
|
||||
|
||||
## 开源协议与素材说明
|
||||
|
||||
本项目为程序设计课程大作业,仅供课程学习、课堂展示和个人技术交流使用,不用于商业发布。
|
||||
|
||||
- 源代码、构建脚本和原创文档内容采用 MIT License,详见 `LICENSE`。
|
||||
- `assets/`、`report/images/` 和 `report/code-snippets/` 中的音频、图片、视频等非代码素材不包含在 MIT License 授权范围内。
|
||||
- 音乐素材来自《千恋*万花》,仅作为课程大作业学习展示使用,版权归原权利方所有。
|
||||
- 图片素材主要由 AI 生成或用于课程报告展示。
|
||||
- 如需二次发布、公开分发可执行文件或用于课程以外场景,请先替换或移除未取得独立授权的素材。
|
||||
|
||||
更完整的素材来源和授权限制说明见 `NOTICE.md`。
|
||||
|
||||
@@ -0,0 +1,354 @@
|
||||
# Tereis 实验报告与项目整理 TODO
|
||||
|
||||
> 依据:实验报告模板 `大学计算-程序设计大作业-实验报告模板.docx`、课堂报告要求截图、当前 `src` 源码目录。
|
||||
> 说明:`report/` 文件夹按废弃资料处理,不作为本 TODO 的依据。
|
||||
|
||||
## 0. 当前项目审查结论
|
||||
|
||||
- [ ] 确认最终报告只引用 `src/`、`assets/`、`README.md`、构建脚本和重新整理的截图材料。
|
||||
- [ ] 清点当前源码模块:
|
||||
- `src/source/Tetris.cpp`:Win32 程序入口、窗口注册、消息循环、主窗口消息处理。
|
||||
- `src/source/TetrisLogic.cpp`:基础俄罗斯方块移动、旋转、落地、消行、重开等核心逻辑。
|
||||
- `src/source/logic/`:生成下一方块、固定方块、特殊落地效果、棋盘辅助逻辑。
|
||||
- `src/source/app/`:定时器、键盘鼠标输入、窗口布局、背景音乐和复活视频。
|
||||
- `src/source/render/` 与 `TetrisRender.cpp`:界面绘制、背景图片、GDI/GDI+ 资源加载。
|
||||
- `src/source/extensions/`:菜单、反馈提示、视觉特效、复活、页面切换等扩展状态。
|
||||
- `src/source/rogue/`:Rogue 模式、升级选项、主动技能、特殊方块、难度成长。
|
||||
- [ ] 记录项目规模:多源文件 C++ Win32 桌面程序,主要采用全局变量、结构体、函数的过程式组织。
|
||||
- [ ] 检查课程限制风险:
|
||||
- 当前代码没有自定义 `class`、继承、多态。
|
||||
- 但存在 `std::wstring`、`std::vector` 未发现、`auto` lambda、GDI+ `Image` 对象、`new/delete`、`constexpr`、C++17 构建参数等超出“仅基础语法”的风险点。
|
||||
- 报告中需要说明:核心游戏逻辑坚持数组、循环、分支、函数、结构体;Win32/GDI+ 属于界面和资源接口调用。
|
||||
|
||||
## 1. 阶段一:窗口创建与程序框架
|
||||
|
||||
- [ ] 功能设计文档:说明为什么先搭建窗口、消息循环和菜单状态。
|
||||
- [ ] 关键代码整理:
|
||||
- `_tWinMain`:`src/source/Tetris.cpp`
|
||||
- `MyRegisterClass`:`src/source/Tetris.cpp`
|
||||
- `InitInstance`:`src/source/Tetris.cpp`
|
||||
- `WndProc`:`src/source/Tetris.cpp`
|
||||
- `About`:`src/source/Tetris.cpp`
|
||||
- [ ] 代码说明重点:
|
||||
- Win32 程序入口如何创建主窗口。
|
||||
- 消息循环如何把键盘、鼠标、定时器、绘制消息分发给游戏。
|
||||
- 为什么用全局状态变量保存当前界面和游戏状态。
|
||||
- [ ] 截图补充:
|
||||
- 程序启动主菜单。
|
||||
- 帮助/说明页面。
|
||||
- [ ] 编译运行记录:
|
||||
- 执行 `.\build-mingw.ps1`。
|
||||
- 记录是否成功生成 `.vscode-build\mingw\Tetris.exe`。
|
||||
- [ ] AI 对话记录整理:
|
||||
- 提示词主题:搭建 Win32 窗口框架。
|
||||
- 人工审查点:入口函数、窗口大小、消息处理是否能正常运行。
|
||||
|
||||
## 2. 阶段二:基础方块移动与碰撞检测
|
||||
|
||||
- [ ] 功能设计文档:说明棋盘数组、活动方块坐标、边界判断和碰撞判断。
|
||||
- [ ] 关键代码整理:
|
||||
- `CanMoveDown`:`src/source/TetrisLogic.cpp`
|
||||
- `CanMoveLeft`:`src/source/TetrisLogic.cpp`
|
||||
- `CanMoveRight`:`src/source/TetrisLogic.cpp`
|
||||
- `MoveDown`:`src/source/TetrisLogic.cpp`
|
||||
- `MoveLeft`:`src/source/TetrisLogic.cpp`
|
||||
- `MoveRight`:`src/source/TetrisLogic.cpp`
|
||||
- `Rotate`:`src/source/TetrisLogic.cpp`
|
||||
- `DropDown`:`src/source/TetrisLogic.cpp`
|
||||
- [ ] 代码说明重点:
|
||||
- `workRegion[20][10]` 如何表示固定方块。
|
||||
- `bricks[7][4][4][4]` 如何表示 7 类方块和旋转状态。
|
||||
- 移动前先检测,检测通过再修改坐标。
|
||||
- 旋转失败时保持原状态,避免方块穿墙或重叠。
|
||||
- [ ] 截图补充:
|
||||
- 方块左移、右移、旋转、硬降后的游戏画面。
|
||||
- [ ] 测试记录:
|
||||
- 左右边界不能越界。
|
||||
- 方块落到已有方块上方时停止。
|
||||
- 旋转时不能覆盖已有方块。
|
||||
- [ ] AI 对话记录整理:
|
||||
- 提示词主题:补全移动和碰撞检测函数。
|
||||
- 人工审查点:数组下标是否越界、边界条件是否完整。
|
||||
|
||||
## 3. 阶段三:方块固定、消行、得分和游戏状态
|
||||
|
||||
- [ ] 功能设计文档:说明方块落地后的固定流程、消行流程、分数变化和结束判断。
|
||||
- [ ] 关键代码整理:
|
||||
- `Fixing`:`src/source/TetrisLogic.cpp`
|
||||
- `DeleteOneLine`:`src/source/TetrisLogic.cpp`
|
||||
- `DeleteLines`:`src/source/TetrisLogic.cpp`
|
||||
- `GameOver`:`src/source/TetrisLogic.cpp`
|
||||
- `ComputeTarget`:`src/source/TetrisLogic.cpp`
|
||||
- `Restart`:`src/source/TetrisLogic.cpp`
|
||||
- `SpawnNextFallingPiece`:`src/source/logic/TetrisCoreHelpers.cpp`
|
||||
- `ScanAndDeleteFullLines`:`src/source/logic/TetrisCoreHelpers.cpp`
|
||||
- `ApplyLineClearResult`:`src/source/rogue/TetrisRogue.cpp`
|
||||
- [ ] 代码说明重点:
|
||||
- 活动方块如何写入棋盘数组。
|
||||
- 满行检测从下到上扫描的原因。
|
||||
- 消行后上方方块整体下移。
|
||||
- `ComputeTarget` 如何得到预览落点。
|
||||
- `Restart` 如何重置棋盘、分数、方块状态和视觉状态。
|
||||
- [ ] 截图补充:
|
||||
- 消除一行或多行。
|
||||
- 分数变化。
|
||||
- 游戏结束或重新开始。
|
||||
- [ ] 测试记录:
|
||||
- 单行消除。
|
||||
- 多行消除。
|
||||
- 顶部堆满后的游戏结束。
|
||||
- 重新开始后棋盘清空。
|
||||
- [ ] Bug 记录模板:
|
||||
- 问题:消行后上方方块没有正确下落。
|
||||
- 原因:删除行后未正确复制上一行数据。
|
||||
- 修复:从被删行开始向上逐行覆盖,并清空第一行。
|
||||
|
||||
## 4. 阶段四:界面绘制、资源加载与交互
|
||||
|
||||
- [ ] 功能设计文档:说明游戏区、侧边栏、菜单、帮助页、按钮和背景资源。
|
||||
- [ ] 关键代码整理:
|
||||
- `TDrawScreen`:`src/source/TetrisRender.cpp`
|
||||
- `RenderFullScreen`:`src/source/render/TetrisRenderMain.cpp`
|
||||
- `LoadBackgroundImage`:`src/source/render/TetrisRenderAssets.cpp`
|
||||
- `FileExists`:`src/source/common/TetrisAssets.cpp`
|
||||
- `GetMenuOptionRect`:`src/source/app/TetrisLayout.cpp`
|
||||
- `GetUpgradeCardRect`:`src/source/app/TetrisLayout.cpp`
|
||||
- `HandleMouseClick`:`src/source/app/TetrisInput.cpp`
|
||||
- `HandleMouseWheel`:`src/source/app/TetrisInput.cpp`
|
||||
- `HandleKeyDown`:`src/source/app/TetrisInput.cpp`
|
||||
- `StartBackgroundMusic`:`src/source/app/TetrisMedia.cpp`
|
||||
- `ToggleBackgroundMusic`:`src/source/app/TetrisMedia.cpp`
|
||||
- `PlayReviveVideo`:`src/source/app/TetrisMedia.cpp`
|
||||
- [ ] 代码说明重点:
|
||||
- 界面绘制与游戏逻辑分离。
|
||||
- 鼠标点击通过矩形区域判断菜单和按钮。
|
||||
- 键盘输入对应移动、旋转、暂停、重开、技能。
|
||||
- 背景图、图标、音乐、视频统一放在 `assets/`。
|
||||
- [ ] 截图补充:
|
||||
- 主菜单。
|
||||
- 经典模式游戏界面。
|
||||
- 帮助页。
|
||||
- 音乐按钮或返回按钮。
|
||||
- [ ] 测试记录:
|
||||
- 键盘控制有效。
|
||||
- 鼠标点击菜单有效。
|
||||
- 背景音乐开关有效。
|
||||
- 从根目录运行时资源能正常加载。
|
||||
- [ ] 风险处理:
|
||||
- 报告中不要把 GDI+ 对象作为课程核心语法重点,重点讲过程式游戏逻辑和数组状态。
|
||||
|
||||
## 5. 阶段五:Rogue 创新模式与强化系统
|
||||
|
||||
- [ ] 功能设计文档:说明创新点来源、玩法目标和与经典模式的区别。
|
||||
- [ ] 关键代码整理:
|
||||
- `StartGameWithMode`:`src/source/extensions/TetrisGameExtensions.cpp`
|
||||
- `ResetPlayerStats`:`src/source/extensions/TetrisGameExtensions.cpp`
|
||||
- `OpenUpgradeMenu`:`src/source/rogue/TetrisRogue.cpp`
|
||||
- `ConfirmUpgradeSelection`:`src/source/rogue/TetrisRogue.cpp`
|
||||
- `CheckRogueLevelProgress`:`src/source/rogue/TetrisRogue.cpp`
|
||||
- `AwardRogueSkillClearRewards`:`src/source/rogue/TetrisRogue.cpp`
|
||||
- `AdvanceRogueDifficulty`:`src/source/rogue/TetrisRogue.cpp`
|
||||
- `GetRogueFallInterval`:`src/source/rogue/TetrisRogue.cpp`
|
||||
- `GetRogueLockedRows`:`src/source/rogue/TetrisRogue.cpp`
|
||||
- `GetUpgradeSynthesisPath`:`src/source/rogue/TetrisRogue.cpp`
|
||||
- [ ] 代码说明重点:
|
||||
- Rogue 模式如何用 `PlayerStats` 结构体保存等级、经验、强化、技能次数。
|
||||
- 消行如何获得经验并触发升级选择。
|
||||
- 强化选项如何随机生成、选择并影响后续游戏。
|
||||
- 难度如何随时间推进。
|
||||
- [ ] 截图补充:
|
||||
- Rogue 模式游戏界面。
|
||||
- 升级三选一。
|
||||
- 双重选择或命运轮盘。
|
||||
- 难度提升/底部封锁效果。
|
||||
- [ ] 测试记录:
|
||||
- 消行获得 EXP。
|
||||
- EXP 满后进入升级界面。
|
||||
- 选择强化后返回游戏。
|
||||
- 难度等级会随时间变化。
|
||||
- [ ] AI 对话记录整理:
|
||||
- 提示词主题:设计俄罗斯方块 Rogue 强化系统。
|
||||
- 人工审查点:强化是否真的改变游戏状态,升级界面是否能返回主流程。
|
||||
|
||||
## 6. 阶段六:主动技能、特殊方块和视觉特效
|
||||
|
||||
- [ ] 功能设计文档:说明主动技能和特殊方块是创新功能,不影响基础玩法可运行。
|
||||
- [ ] 关键代码整理:
|
||||
- `HoldCurrentPiece`:`src/source/rogue/TetrisRogue.cpp`
|
||||
- `UseScreenBomb`:`src/source/rogue/TetrisRogue.cpp`
|
||||
- `UseBlackHole`:`src/source/rogue/TetrisRogue.cpp`
|
||||
- `UseAirReshape`:`src/source/rogue/TetrisRogue.cpp`
|
||||
- `RollCurrentPieceSpecialFlags`:`src/source/rogue/TetrisRogue.cpp`
|
||||
- `ApplySpecialLandingEffects`:`src/source/logic/TetrisPieceEffects.cpp`
|
||||
- `ApplyRainbowLandingEffect`:`src/source/logic/TetrisPieceEffects.cpp`
|
||||
- `TriggerScreenBomb`:`src/source/rogue/TetrisRogue.cpp`
|
||||
- `TriggerMiniBlackHole`:`src/source/rogue/TetrisRogue.cpp`
|
||||
- `ClearExplosiveAreaAt`:`src/source/rogue/TetrisRogue.cpp`
|
||||
- `ClearColumnAt`:`src/source/rogue/TetrisRogue.cpp`
|
||||
- `ClearRowAt`:`src/source/rogue/TetrisRogue.cpp`
|
||||
- `TriggerLineClearEffect`:`src/source/extensions/TetrisGameExtensions.cpp`
|
||||
- `TickVisualEffects`:`src/source/extensions/TetrisGameExtensions.cpp`
|
||||
- [ ] 代码说明重点:
|
||||
- 技能按键如何触发对应函数。
|
||||
- 技能如何修改棋盘数组。
|
||||
- 特殊方块落地后如何触发清除、变色、爆炸、激光等效果。
|
||||
- 视觉特效只负责显示,不应破坏核心棋盘数据。
|
||||
- [ ] 截图补充:
|
||||
- 备用仓。
|
||||
- 清屏炸弹。
|
||||
- 黑洞奇点。
|
||||
- 空中换形。
|
||||
- 爆破/激光/彩虹等特殊方块效果。
|
||||
- [ ] 测试记录:
|
||||
- 技能次数不足时不能使用。
|
||||
- 技能使用后棋盘变化正确。
|
||||
- 特殊方块效果不会造成数组越界。
|
||||
- 特效结束后游戏仍可继续。
|
||||
|
||||
## 7. 实验报告正文 TODO
|
||||
|
||||
- [ ] 封面信息:
|
||||
- 项目名称:使用大模型辅助开发俄罗斯方块程序。
|
||||
- 小组成员、学号、班级、日期。
|
||||
- [ ] 摘要:
|
||||
- 简述完成了经典俄罗斯方块和 Rogue 创新模式。
|
||||
- 强调使用 C++、Win32 API、数组、结构体、函数组织。
|
||||
- [ ] 需求功能设计:
|
||||
- 按至少 6 个阶段写,每阶段包含目标、功能点、涉及文件。
|
||||
- 每阶段最多聚焦一个主要功能主题。
|
||||
- [ ] 功能实现:
|
||||
- 每阶段放关键代码截图。
|
||||
- 每阶段写代码说明。
|
||||
- 每阶段放游戏运行截图。
|
||||
- [ ] AI 辅助编程体验反思:
|
||||
- 写明大模型做得好的地方:快速生成框架、补全重复逻辑、解释 Win32 消息流程、提供调试思路。
|
||||
- 写明大模型表现不好的地方:容易生成过复杂代码、可能使用超出课程范围的语法、边界条件不完整、变量命名可能不符合原框架。
|
||||
- 写明改进方法:拆小任务、明确限制语法、每次只让模型生成一个函数、人工检查数组下标、编译运行验证。
|
||||
- 注意表述成“多轮 LLM 对话迭代生成”,不要写成一次性 vibe coding。
|
||||
- [ ] 成员分工表:
|
||||
- 提示词工程师:拆分需求、编写和迭代提示词。
|
||||
- 代码审计员:检查语法限制、数组越界、全局状态和函数注释。
|
||||
- 功能测试员:运行游戏、记录 bug、截图。
|
||||
- 报告撰稿人:整理阶段文档、代码截图、反思和分工。
|
||||
- 现场汇报人:演示程序并回答问题。
|
||||
- [ ] Bug 记录:
|
||||
- 至少整理 3 个 bug,每个包含“问题、原因、修复过程、验证结果”。
|
||||
- [ ] 总结:
|
||||
- 说明最终实现的功能。
|
||||
- 说明仍可改进的地方,例如代码规模较大、部分界面资源依赖本地文件、复杂扩展功能需要更多测试。
|
||||
|
||||
## 8. 答辩准备 TODO
|
||||
|
||||
- [ ] 每位组员至少熟悉一个源码模块,不能只由一人理解。
|
||||
- [ ] 准备 5 分钟演示路线:
|
||||
- 主菜单。
|
||||
- 经典模式移动、旋转、消行。
|
||||
- Rogue 模式升级。
|
||||
- 主动技能。
|
||||
- 特殊方块或视频复活。
|
||||
- [ ] 准备常见问题回答:
|
||||
- 方块形状如何存储?
|
||||
- 如何判断碰撞?
|
||||
- 如何消行?
|
||||
- 如何实现升级选择?
|
||||
- 如何保证没有使用自定义 class?
|
||||
- AI 生成代码后做了哪些人工审查?
|
||||
- [ ] 准备现场编译:
|
||||
- 命令:`.\build-mingw.ps1`
|
||||
- 运行:`.\build-mingw.ps1 -Run`
|
||||
- 如果提示 `Tetris.exe: Permission denied`,先关闭正在运行的游戏窗口。
|
||||
|
||||
## 9. 四人专项分工规划
|
||||
|
||||
> 原则:四个人各有一个主要专项,同时都要理解自己负责模块对应的代码和报告内容;现场答辩时不能只由一个人解释全部代码。
|
||||
|
||||
### 成员 A:需求拆分与报告主线负责人
|
||||
|
||||
- [ ] 专项任务:负责实验报告整体结构、阶段划分和文字主线。
|
||||
- [ ] 负责内容:
|
||||
- 将项目整理成 6 个阶段:窗口框架、基础移动、消行得分、界面交互、Rogue 强化、主动技能与特效。
|
||||
- 编写每个阶段的“需求功能设计”。
|
||||
- 整理摘要、项目背景、总体架构、总结与不足。
|
||||
- 保证报告符合截图要求:不少于五个阶段、每阶段有功能设计文档。
|
||||
- [ ] 重点熟悉代码:
|
||||
- `src/source/Tetris.cpp`
|
||||
- `src/include/Tetris.h`
|
||||
- `src/source/TetrisLogic.cpp`
|
||||
- [ ] 最终交付:
|
||||
- 报告目录结构。
|
||||
- 6 个阶段的功能设计文字。
|
||||
- 项目总体介绍和总结。
|
||||
|
||||
### 成员 B:核心逻辑与代码说明负责人
|
||||
|
||||
- [ ] 专项任务:负责基础俄罗斯方块核心逻辑的代码审查和代码说明。
|
||||
- [ ] 负责内容:
|
||||
- 解释棋盘数组 `workRegion[20][10]`。
|
||||
- 解释方块数组 `bricks[7][4][4][4]`。
|
||||
- 整理移动、旋转、碰撞、固定、消行、得分、游戏结束的关键代码。
|
||||
- 检查数组下标、边界判断、函数注释是否适合放进报告。
|
||||
- [ ] 重点熟悉代码:
|
||||
- `src/source/TetrisLogic.cpp`
|
||||
- `src/source/logic/TetrisCoreHelpers.cpp`
|
||||
- `src/source/logic/TetrisPieceEffects.cpp`
|
||||
- [ ] 最终交付:
|
||||
- 阶段二、阶段三的关键代码截图清单。
|
||||
- 每段关键代码的说明文字。
|
||||
- 至少 1 个核心逻辑 bug 的“问题、原因、修复、验证”记录。
|
||||
|
||||
### 成员 C:界面交互、资源与运行截图负责人
|
||||
|
||||
- [ ] 专项任务:负责程序运行、界面截图、资源加载和交互测试。
|
||||
- [ ] 负责内容:
|
||||
- 编译并运行项目,记录构建结果。
|
||||
- 截取主菜单、经典模式、帮助页、Rogue 升级、主动技能、特殊方块等运行截图。
|
||||
- 测试键盘输入、鼠标点击、音乐开关、返回按钮、视频复活。
|
||||
- 整理运行环境和现场演示路线。
|
||||
- [ ] 重点熟悉代码:
|
||||
- `src/source/render/TetrisRenderMain.cpp`
|
||||
- `src/source/render/TetrisRenderAssets.cpp`
|
||||
- `src/source/app/TetrisInput.cpp`
|
||||
- `src/source/app/TetrisLayout.cpp`
|
||||
- `src/source/app/TetrisMedia.cpp`
|
||||
- `src/source/app/TetrisTimers.cpp`
|
||||
- [ ] 最终交付:
|
||||
- 每个阶段至少 1 张游戏界面截图。
|
||||
- 构建运行记录。
|
||||
- 现场 5 分钟演示路线。
|
||||
- 至少 1 个界面或资源加载 bug 记录。
|
||||
|
||||
### 成员 D:AI 对话、创新功能与答辩问答负责人
|
||||
|
||||
- [ ] 专项任务:负责 AI 辅助编程过程整理、Rogue 创新功能说明和答辩材料。
|
||||
- [ ] 负责内容:
|
||||
- 整理“提示词 -> 模型生成 -> 人工审查 -> 编译测试 -> 修复”的多轮迭代过程。
|
||||
- 编写 AI 辅助编程体验反思,突出优点、不足和改进方法。
|
||||
- 整理 Rogue 模式、升级系统、主动技能、特殊方块、视觉特效的创新点。
|
||||
- 准备答辩常见问题回答。
|
||||
- [ ] 重点熟悉代码:
|
||||
- `src/source/rogue/TetrisRogue.cpp`
|
||||
- `src/source/extensions/TetrisGameExtensions.cpp`
|
||||
- `src/source/logic/TetrisPieceEffects.cpp`
|
||||
- [ ] 最终交付:
|
||||
- AI 对话迭代记录。
|
||||
- AI 编程体验反思。
|
||||
- Rogue 创新功能说明。
|
||||
- 答辩问答表。
|
||||
- 至少 1 个 AI 生成代码问题或边界条件 bug 记录。
|
||||
|
||||
### 协作检查点
|
||||
|
||||
- [ ] 第一次合并:成员 A 完成报告框架后,成员 B/C/D 将各自材料填入对应阶段。
|
||||
- [ ] 第二次合并:成员 B 审查所有关键代码说明,确认不夸大、不漏掉核心逻辑。
|
||||
- [ ] 第三次合并:成员 C 核对每个阶段是否都有运行截图和测试记录。
|
||||
- [ ] 第四次合并:成员 D 检查报告中 AI 过程是否像“多轮 LLM 对话迭代生成”,避免写成一次性生成。
|
||||
- [ ] 最终检查:四人各自用 2 分钟讲清自己负责模块,互相提问一次。
|
||||
|
||||
## 10. 下一步执行顺序
|
||||
|
||||
1. [ ] 重新编译项目,确认当前源码可运行。
|
||||
2. [ ] 按 6 个阶段重新截取游戏界面截图,保存到新的报告素材目录,避免使用废弃 `report/`。
|
||||
3. [ ] 为每个阶段截取 2-4 张关键代码截图。
|
||||
4. [ ] 根据本 TODO 填写实验报告模板。
|
||||
5. [ ] 补充 AI 对话过程记录,包装为“需求拆分 -> 模型生成 -> 人工审查 -> 编译测试 -> 修复”的迭代过程。
|
||||
6. [ ] 最终通读报告,检查是否符合“至少五个阶段、每阶段有设计文档、代码说明、游戏截图、AI 反思、成员分工”的要求。
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 18
|
||||
VisualStudioVersion = 18.0.0.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tetris", "Tetris.vcxproj", "{A6B8E95B-7C95-46C2-A3E2-48F342D1F20B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{A6B8E95B-7C95-46C2-A3E2-48F342D1F20B}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{A6B8E95B-7C95-46C2-A3E2-48F342D1F20B}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{A6B8E95B-7C95-46C2-A3E2-48F342D1F20B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{A6B8E95B-7C95-46C2-A3E2-48F342D1F20B}.Debug|x64.Build.0 = Debug|x64
|
||||
{A6B8E95B-7C95-46C2-A3E2-48F342D1F20B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{A6B8E95B-7C95-46C2-A3E2-48F342D1F20B}.Release|Win32.Build.0 = Release|Win32
|
||||
{A6B8E95B-7C95-46C2-A3E2-48F342D1F20B}.Release|x64.ActiveCfg = Release|x64
|
||||
{A6B8E95B-7C95-46C2-A3E2-48F342D1F20B}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {2A6B54D6-B945-4445-8A94-9B38E625493E}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
+204
@@ -0,0 +1,204 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>18.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{A6B8E95B-7C95-46C2-A3E2-48F342D1F20B}</ProjectGuid>
|
||||
<RootNamespace>Tetris</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v145</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v145</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v145</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v145</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings" />
|
||||
<ImportGroup Label="Shared" />
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<OutDir>$(ProjectDir).vscode-build\vs2026\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(ProjectDir).vscode-build\vs2026\obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
<TargetName>Tetris</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>UNICODE;_UNICODE;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)src\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>winmm.lib;gdiplus.lib;gdi32.lib;user32.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<ResourceCompile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)src\include;$(ProjectDir)assets\icons;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>UNICODE;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>UNICODE;_UNICODE;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)src\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>winmm.lib;gdiplus.lib;gdi32.lib;user32.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<ResourceCompile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)src\include;$(ProjectDir)assets\icons;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>UNICODE;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>UNICODE;_UNICODE;_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)src\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>winmm.lib;gdiplus.lib;gdi32.lib;user32.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<ResourceCompile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)src\include;$(ProjectDir)assets\icons;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>UNICODE;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>UNICODE;_UNICODE;_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)src\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>winmm.lib;gdiplus.lib;gdi32.lib;user32.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<ResourceCompile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)src\include;$(ProjectDir)assets\icons;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>UNICODE;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\source\Tetris.cpp" />
|
||||
<ClCompile Include="src\source\TetrisLogic.cpp" />
|
||||
<ClCompile Include="src\source\TetrisRender.cpp" />
|
||||
<ClCompile Include="src\source\stdafx.cpp" />
|
||||
<ClCompile Include="src\source\app\TetrisInput.cpp" />
|
||||
<ClCompile Include="src\source\app\TetrisLayout.cpp" />
|
||||
<ClCompile Include="src\source\app\TetrisMedia.cpp" />
|
||||
<ClCompile Include="src\source\app\TetrisTimers.cpp" />
|
||||
<ClCompile Include="src\source\common\TetrisAssets.cpp" />
|
||||
<ClCompile Include="src\source\extensions\TetrisGameExtensions.cpp" />
|
||||
<ClCompile Include="src\source\logic\TetrisCoreHelpers.cpp" />
|
||||
<ClCompile Include="src\source\logic\TetrisPieceEffects.cpp" />
|
||||
<ClCompile Include="src\source\render\TetrisRenderAssets.cpp" />
|
||||
<ClCompile Include="src\source\render\TetrisRenderMain.cpp" />
|
||||
<ClCompile Include="src\source\rogue\TetrisRogue.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="src\include\resource.h" />
|
||||
<ClInclude Include="src\include\stdafx.h" />
|
||||
<ClInclude Include="src\include\targetver.h" />
|
||||
<ClInclude Include="src\include\Tetris.h" />
|
||||
<ClInclude Include="src\include\TetrisAppInternal.h" />
|
||||
<ClInclude Include="src\include\TetrisAssets.h" />
|
||||
<ClInclude Include="src\include\TetrisLogicInternal.h" />
|
||||
<ClInclude Include="src\include\TetrisRenderInternal.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="src\resources\Tetris.rc" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{0E9F8A8A-4B33-47F4-8409-BBD2E632BD02}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\app">
|
||||
<UniqueIdentifier>{4040C716-0A25-434E-8225-3FB91E96C9C2}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\common">
|
||||
<UniqueIdentifier>{A0E8AA27-81E0-4B07-8436-84237CBFC4A8}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\extensions">
|
||||
<UniqueIdentifier>{D9E2B29D-32A7-4A92-9824-64B07CE76CEF}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\logic">
|
||||
<UniqueIdentifier>{86ED6590-B71E-4555-A5ED-131EAB571D32}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\render">
|
||||
<UniqueIdentifier>{E19CF9D7-1762-45A0-AE35-9806E551112D}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\rogue">
|
||||
<UniqueIdentifier>{28A22C80-54CC-44AF-9925-926D1EE5BAE9}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{F7961514-73CF-48BD-A777-525FB4964E26}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{2BF6F47B-88D9-47B6-971A-54309126F736}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;bmp;png;jpg;jpeg</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\source\Tetris.cpp"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="src\source\TetrisLogic.cpp"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="src\source\TetrisRender.cpp"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="src\source\stdafx.cpp"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="src\source\app\TetrisInput.cpp"><Filter>Source Files\app</Filter></ClCompile>
|
||||
<ClCompile Include="src\source\app\TetrisLayout.cpp"><Filter>Source Files\app</Filter></ClCompile>
|
||||
<ClCompile Include="src\source\app\TetrisMedia.cpp"><Filter>Source Files\app</Filter></ClCompile>
|
||||
<ClCompile Include="src\source\app\TetrisTimers.cpp"><Filter>Source Files\app</Filter></ClCompile>
|
||||
<ClCompile Include="src\source\common\TetrisAssets.cpp"><Filter>Source Files\common</Filter></ClCompile>
|
||||
<ClCompile Include="src\source\extensions\TetrisGameExtensions.cpp"><Filter>Source Files\extensions</Filter></ClCompile>
|
||||
<ClCompile Include="src\source\logic\TetrisCoreHelpers.cpp"><Filter>Source Files\logic</Filter></ClCompile>
|
||||
<ClCompile Include="src\source\logic\TetrisPieceEffects.cpp"><Filter>Source Files\logic</Filter></ClCompile>
|
||||
<ClCompile Include="src\source\render\TetrisRenderAssets.cpp"><Filter>Source Files\render</Filter></ClCompile>
|
||||
<ClCompile Include="src\source\render\TetrisRenderMain.cpp"><Filter>Source Files\render</Filter></ClCompile>
|
||||
<ClCompile Include="src\source\rogue\TetrisRogue.cpp"><Filter>Source Files\rogue</Filter></ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="src\include\resource.h"><Filter>Header Files</Filter></ClInclude>
|
||||
<ClInclude Include="src\include\stdafx.h"><Filter>Header Files</Filter></ClInclude>
|
||||
<ClInclude Include="src\include\targetver.h"><Filter>Header Files</Filter></ClInclude>
|
||||
<ClInclude Include="src\include\Tetris.h"><Filter>Header Files</Filter></ClInclude>
|
||||
<ClInclude Include="src\include\TetrisAppInternal.h"><Filter>Header Files</Filter></ClInclude>
|
||||
<ClInclude Include="src\include\TetrisAssets.h"><Filter>Header Files</Filter></ClInclude>
|
||||
<ClInclude Include="src\include\TetrisLogicInternal.h"><Filter>Header Files</Filter></ClInclude>
|
||||
<ClInclude Include="src\include\TetrisRenderInternal.h"><Filter>Header Files</Filter></ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="src\resources\Tetris.rc"><Filter>Resource Files</Filter></ResourceCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,197 @@
|
||||
# 只使用 Visual Studio 2026 运行本项目
|
||||
|
||||
本文说明如何只依赖 Visual Studio 2026 自带的 C++ 工具链运行本项目,不额外安装 MinGW、GCC 或其他第三方编译器。
|
||||
|
||||
本文档编写日期为 2026-05-08。Microsoft Learn 的发布历史显示,Visual Studio 2026 在 2026-04-28 的稳定通道版本为 18.5.2。
|
||||
|
||||
## 1. 结论
|
||||
|
||||
可以只用 Visual Studio 2026。
|
||||
|
||||
需要安装 Visual Studio 2026 的 `Desktop development with C++` 工作负载。该工作负载会提供本项目需要的主要工具:
|
||||
|
||||
- `cl.exe`:Microsoft C/C++ 编译器
|
||||
- `link.exe`:Microsoft 链接器
|
||||
- `rc.exe`:Windows 资源编译器
|
||||
- Windows SDK:提供 Win32 API、GDI、GDI+ 等头文件和库
|
||||
|
||||
本项目当前没有 `.sln` 或 `.vcxproj` 工程文件,因此推荐在 Visual Studio 2026 中打开文件夹,然后在 `Developer PowerShell for VS 2026` 中执行构建命令。
|
||||
|
||||
## 2. 安装 Visual Studio 2026
|
||||
|
||||
1. 打开 Visual Studio Installer。
|
||||
2. 安装 Visual Studio 2026 Community、Professional 或 Enterprise 均可。
|
||||
3. 在工作负载页面选择 `Desktop development with C++`。
|
||||
4. 保留默认勾选的 MSVC 工具集和 Windows SDK。
|
||||
5. 完成安装后启动 Visual Studio 2026。
|
||||
|
||||
不要额外安装 MinGW。本文后续命令只使用 Visual Studio 2026 自带工具。
|
||||
|
||||
## 3. 打开项目文件夹
|
||||
|
||||
1. 启动 Visual Studio 2026。
|
||||
2. 在开始窗口选择 `Open a local folder`。
|
||||
3. 选择项目根目录:
|
||||
|
||||
```text
|
||||
D:\VSC_program\Tereis
|
||||
```
|
||||
|
||||
4. 打开后可以在 Solution Explorer 中看到:
|
||||
|
||||
```text
|
||||
src
|
||||
assets
|
||||
build-mingw.ps1
|
||||
build-vs2026.ps1
|
||||
VS2026_RUN_GUIDE.md
|
||||
```
|
||||
|
||||
说明:`build-mingw.ps1` 是旧的 MinGW 构建脚本。只使用 VS2026 时不需要运行它。
|
||||
`build-vs2026.ps1` 是本项目提供的 VS2026 专用构建脚本。
|
||||
|
||||
## 4. 打开 VS2026 开发者终端
|
||||
|
||||
普通 PowerShell 通常找不到 `cl.exe` 和 `rc.exe`。要使用 VS2026 自带编译器,应打开开发者终端:
|
||||
|
||||
1. 在 Visual Studio 2026 顶部菜单选择 `Tools -> Command Line -> Developer PowerShell`。
|
||||
2. 进入项目根目录:
|
||||
|
||||
```powershell
|
||||
cd D:\VSC_program\Tereis
|
||||
```
|
||||
|
||||
3. 检查工具是否可用:
|
||||
|
||||
```powershell
|
||||
cl
|
||||
rc
|
||||
```
|
||||
|
||||
如果能看到 Microsoft C/C++ Compiler 和 Microsoft Windows Resource Compiler 的版本信息,说明 VS2026 C++ 工具链可用。
|
||||
|
||||
## 5. 使用 VS2026 工具链构建
|
||||
|
||||
在 `Developer PowerShell for VS 2026` 中执行:
|
||||
|
||||
```powershell
|
||||
.\build-vs2026.ps1
|
||||
```
|
||||
|
||||
构建并运行:
|
||||
|
||||
```powershell
|
||||
.\build-vs2026.ps1 -Run
|
||||
```
|
||||
|
||||
生成结果:
|
||||
|
||||
```text
|
||||
.vscode-build\vs2026\Tetris.exe
|
||||
```
|
||||
|
||||
该脚本会递归编译 `src\source` 下所有 `.cpp` 文件,包括 `render`、`app`、`logic`、`rogue`、`common`、`extensions` 等目录,避免手动建 VS 工程时漏加源文件。
|
||||
|
||||
如果需要手动理解脚本做了什么,核心命令如下。
|
||||
|
||||
先创建输出目录:
|
||||
|
||||
```powershell
|
||||
New-Item -ItemType Directory -Force -Path .\.vscode-build\vs2026
|
||||
```
|
||||
|
||||
编译资源文件:
|
||||
|
||||
```powershell
|
||||
rc /nologo /i .\src\include /i .\assets\icons /fo .\.vscode-build\vs2026\Tetris.res .\src\resources\Tetris.rc
|
||||
```
|
||||
|
||||
编译并链接 C++ 源码:
|
||||
|
||||
```powershell
|
||||
$sources = Get-ChildItem .\src\source -Recurse -Filter *.cpp | ForEach-Object { $_.FullName }
|
||||
cl /nologo /utf-8 /std:c++17 /EHsc /Zi /Od /DUNICODE /D_UNICODE /D_WINDOWS /I .\src\include $sources .\.vscode-build\vs2026\Tetris.res /Fe:.\.vscode-build\vs2026\Tetris.exe /link /SUBSYSTEM:WINDOWS winmm.lib gdiplus.lib gdi32.lib user32.lib shell32.lib
|
||||
```
|
||||
|
||||
## 6. 运行程序
|
||||
|
||||
运行时建议从项目根目录启动,因为程序会读取 `assets/` 目录中的图片、音频和视频资源。
|
||||
|
||||
```powershell
|
||||
Start-Process .\.vscode-build\vs2026\Tetris.exe -WorkingDirectory .
|
||||
```
|
||||
|
||||
如果直接双击 exe,可能因为工作目录不对导致背景图、音乐或视频加载失败。
|
||||
|
||||
## 7. 常见问题
|
||||
|
||||
### 找不到 `cl.exe`
|
||||
|
||||
原因:没有在 VS2026 开发者终端中运行命令,或安装 VS2026 时没有选择 `Desktop development with C++`。
|
||||
|
||||
处理:
|
||||
|
||||
1. 打开 `Tools -> Command Line -> Developer PowerShell`。
|
||||
2. 如果仍然找不到 `cl.exe`,打开 Visual Studio Installer,修改安装,勾选 `Desktop development with C++`。
|
||||
|
||||
### 找不到 `rc.exe`
|
||||
|
||||
原因:Windows SDK 没有安装,或没有进入 VS2026 开发者终端。
|
||||
|
||||
处理:打开 Visual Studio Installer,确认 C++ 桌面开发工作负载中的 Windows SDK 已安装。
|
||||
|
||||
### 资源文件编译失败,提示找不到图标
|
||||
|
||||
原因:`Tetris.rc` 中引用了图标文件,资源编译命令必须包含图标目录。
|
||||
|
||||
处理:确认资源编译命令中包含:
|
||||
|
||||
```powershell
|
||||
/i .\assets\icons
|
||||
```
|
||||
|
||||
### 程序运行后没有图片、音乐或视频
|
||||
|
||||
原因:程序没有从项目根目录启动,导致 `assets/` 相对路径无法读取。
|
||||
|
||||
处理:
|
||||
|
||||
```powershell
|
||||
Start-Process .\.vscode-build\vs2026\Tetris.exe -WorkingDirectory .
|
||||
```
|
||||
|
||||
### 程序能运行、有音乐,但窗口黑屏
|
||||
|
||||
原因通常是手动创建 Visual Studio 工程时没有把所有源文件加入编译,尤其是漏掉了这些目录:
|
||||
|
||||
```text
|
||||
src\source\app
|
||||
src\source\common
|
||||
src\source\extensions
|
||||
src\source\logic
|
||||
src\source\render
|
||||
src\source\rogue
|
||||
```
|
||||
|
||||
处理:不要运行手动残缺工程生成的 exe,改用 VS2026 开发者终端运行项目脚本:
|
||||
|
||||
```powershell
|
||||
.\build-vs2026.ps1 -Run
|
||||
```
|
||||
|
||||
如果一定要手动建 VS 工程,必须把 `src\source` 下所有 `.cpp` 文件递归加入项目,并把工作目录设置为项目根目录 `D:\VSC_program\Tereis`。
|
||||
|
||||
### 直接按 F5 不能运行
|
||||
|
||||
原因:本项目当前没有 Visual Studio `.sln` 或 `.vcxproj` 工程文件,VS2026 不知道应该如何构建和启动。
|
||||
|
||||
处理:使用本文的 `Developer PowerShell for VS 2026` 构建方式。后续如果需要 F5 调试体验,可以再创建 Visual Studio C++ 工程文件。
|
||||
|
||||
## 8. 参考资料
|
||||
|
||||
- Visual Studio 2026 Release Notes: <https://learn.microsoft.com/visualstudio/releases/vs18/release-notes>
|
||||
- Visual Studio 2026 Release History: <https://learn.microsoft.com/en-us/visualstudio/releases/2026/release-history>
|
||||
- Visual Studio 2026 System Requirements: <https://learn.microsoft.com/en-us/visualstudio/releases/2026/vs-system-requirements>
|
||||
- Install Visual Studio: <https://learn.microsoft.com/en-us/visualstudio/install/install-visual-studio>
|
||||
- Use the Microsoft C++ toolset from the command line: <https://learn.microsoft.com/en-us/cpp/build/building-on-the-command-line>
|
||||
- MSVC compiler command-line syntax: <https://learn.microsoft.com/en-us/cpp/build/reference/compiler-command-line-syntax>
|
||||
@@ -0,0 +1,75 @@
|
||||
param(
|
||||
[switch]$Run
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$Root = Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||
$ProjectDir = Join-Path $Root "src"
|
||||
$IncludeDir = Join-Path $ProjectDir "include"
|
||||
$SourceDir = Join-Path $ProjectDir "source"
|
||||
$ResourceDir = Join-Path $ProjectDir "resources"
|
||||
$AssetIconDir = Join-Path $Root "assets\icons"
|
||||
$BuildDir = Join-Path $Root ".vscode-build\vs2026"
|
||||
$ExePath = Join-Path $BuildDir "Tetris.exe"
|
||||
$ResPath = Join-Path $BuildDir "Tetris.res"
|
||||
$RcPath = Join-Path $ResourceDir "Tetris.rc"
|
||||
|
||||
if (-not (Get-Command cl.exe -ErrorAction SilentlyContinue)) {
|
||||
throw "cl.exe not found. Open Visual Studio 2026: Tools -> Command Line -> Developer PowerShell, then run this script again."
|
||||
}
|
||||
|
||||
if (-not (Get-Command rc.exe -ErrorAction SilentlyContinue)) {
|
||||
throw "rc.exe not found. Install the Windows SDK from the Visual Studio Installer C++ desktop workload."
|
||||
}
|
||||
|
||||
New-Item -ItemType Directory -Force -Path $BuildDir | Out-Null
|
||||
|
||||
$Sources = Get-ChildItem -Path $SourceDir -Recurse -Filter "*.cpp" |
|
||||
Sort-Object FullName |
|
||||
Select-Object -ExpandProperty FullName
|
||||
|
||||
if ($Sources.Count -lt 10) {
|
||||
throw "Too few source files found under src\source. The render, app, logic, rogue, common, and extension modules must all be compiled."
|
||||
}
|
||||
|
||||
& rc.exe `
|
||||
/nologo `
|
||||
/i $IncludeDir `
|
||||
/i $AssetIconDir `
|
||||
/fo $ResPath `
|
||||
$RcPath
|
||||
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
exit $LASTEXITCODE
|
||||
}
|
||||
|
||||
& cl.exe `
|
||||
/nologo `
|
||||
/utf-8 `
|
||||
/std:c++17 `
|
||||
/EHsc `
|
||||
/Zi `
|
||||
/Od `
|
||||
/DUNICODE `
|
||||
/D_UNICODE `
|
||||
/D_WINDOWS `
|
||||
/I $IncludeDir `
|
||||
$Sources `
|
||||
$ResPath `
|
||||
/Fe:$ExePath `
|
||||
/link `
|
||||
/SUBSYSTEM:WINDOWS `
|
||||
winmm.lib `
|
||||
gdiplus.lib `
|
||||
gdi32.lib `
|
||||
user32.lib `
|
||||
shell32.lib
|
||||
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
exit $LASTEXITCODE
|
||||
}
|
||||
|
||||
if ($Run) {
|
||||
Start-Process -FilePath $ExePath -WorkingDirectory $Root
|
||||
}
|
||||
@@ -2,18 +2,15 @@
|
||||
|
||||
/**
|
||||
* @file resource.h
|
||||
* @brief 定义菜单、图标、对话框和命令等 Windows 资源编号。
|
||||
* @brief Defines Windows resource IDs for menus, icons, dialogs, commands, and strings.
|
||||
*/
|
||||
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ 生成的包含文件。
|
||||
// 供 Tetris.rc 使用
|
||||
//
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by Tetris.rc.
|
||||
|
||||
// 字符串资源:窗口标题等文本由 Win32 启动流程按编号读取。
|
||||
#define IDS_APP_TITLE 103
|
||||
|
||||
// 图标、对话框、菜单和命令编号需要与 Tetris.rc 中的资源定义保持一致。
|
||||
#define IDR_MAINFRAME 128
|
||||
#define IDD_TETRIS_DIALOG 102
|
||||
#define IDD_ABOUTBOX 103
|
||||
@@ -26,13 +23,11 @@
|
||||
#define IDC_MYICON 2
|
||||
|
||||
#ifndef IDC_STATIC
|
||||
// 静态文本控件使用 -1,表示运行时不需要通过控件 ID 单独访问。
|
||||
#define IDC_STATIC -1
|
||||
#endif
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
// 以下编号由资源编辑器维护,手工改动容易导致新增资源编号冲突。
|
||||
#define _APS_NO_MFC 130
|
||||
#define _APS_NEXT_RESOURCE_VALUE 129
|
||||
#define _APS_NEXT_COMMAND_VALUE 32771
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user