{"id":19283139,"url":"https://github.com/sqlsec/tetris","last_synced_at":"2025-06-21T10:08:03.014Z","repository":{"id":112977967,"uuid":"163306592","full_name":"sqlsec/Tetris","owner":"sqlsec","description":"南京邮电大学Windows高级软件开发最后一次大作业，C++语言实现win32下俄罗斯方块，附上详细注释。","archived":false,"fork":false,"pushed_at":"2018-12-27T15:07:55.000Z","size":32,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-21T10:07:45.400Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","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/sqlsec.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}},"created_at":"2018-12-27T15:01:22.000Z","updated_at":"2023-01-14T11:35:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"73f4b72b-4573-4429-b680-7cacf08cd84c","html_url":"https://github.com/sqlsec/Tetris","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sqlsec/Tetris","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqlsec%2FTetris","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqlsec%2FTetris/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqlsec%2FTetris/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqlsec%2FTetris/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sqlsec","download_url":"https://codeload.github.com/sqlsec/Tetris/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqlsec%2FTetris/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261103451,"owners_count":23109932,"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":[],"created_at":"2024-11-09T21:29:50.574Z","updated_at":"2025-06-21T10:07:58.003Z","avatar_url":"https://github.com/sqlsec.png","language":"C++","readme":"# Tetris\n南京邮电大学Windows高级软件开发最后一次大作业，C++语言实现win32下俄罗斯方块，附上详细注释。\n# 第一部分\n一、将本代码仓库clone到本地\n二、运行`examle/tetris.sln`代码，开发环境为`visual studio 2017`\n三、对`tetris.h`和`Tetris.cpp`分别补充完整注释（在**//**后面），对如下**每一步**commit一次：\n- 1、注释完tetris.h中的函数声明\n- 2、注释完tetris.h中的常量声明\n- 3、注释完tetris.h中的全局变量声明\n- 4、注释完Tetris.cpp中全局变量和wWinMain函数内部\n- 5、注释完Tetris.cpp中MyRegisterClass和InitInstance函数 内部\n- 6、注释完Tetris.cpp中WndProc函数内部\n- 7、注释完Tetris.cpp中其它部分\n四、将本地代码仓库push到远程仓库\n# 第二部分\n一、将本代码仓库clone到本地\n二、运行`MyTetris/Tetris.sln`代码，开发环境为`visual studio 2017`\n三、参照`example/Tetris.cpp`来按照如下步骤来完善`Tetris.cpp`，对如下每一步编译通过，然后commit一次，commit信息填写对应的步骤\n- 1、在项目中动态添加菜单\"开始游戏、结束游戏\"，在窗口处理函数WM_CREATE 中创建菜单\n- 2、加入对菜单的响应，在窗口处理函数的WM_COMMAND 中处理， 以MessageBox显示点击了哪个菜单\n```c\nMessageBox(\n        NULL,\n        (LPCWSTR)L\"Menu File is pressed\",\n        (LPCWSTR)L\"Debug\",\n        MB_OK\n         );\n```\n- 3、加入对键盘消息（4个方向键）的响应，WM_KEYDOWN中处理，以MessageBox显示敲击了哪个键\n```c\nMessageBox(\n        NULL,\n        (LPCWSTR)L\"Key A is pressed\",\n        (LPCWSTR)L\"Debug\",\n        MB_OK\n        );\n```\n- 4、在Tetris.cpp中实现头文件中声明的函数\n- 5、加入对WM_PAINT的响应，画背景\n- 6、加入对WM_PAINT的响应，画NEXT\n- 7、加入对WM_PAINT的响应，画SCORE\n- 8、将菜单跟对应的函数对接起来，取消之前的MessageBox\n- 9、将键盘跟对应的函数对接起来，取消之前的MessageBox\n- 10、添加菜单“旋转方向”，参考example/Tetris.cpp中205行~216行\n```c\n        rotate = CreatePopupMenu();//\n        AppendMenu(hSysmenu, MF_POPUP, (UINT_PTR)rotate, L\"旋转选择\");//\n\t\tAppendMenu(rotate, MF_STRING, ID_ROATE1, L\"顺时针\");//\n\t\tAppendMenu(rotate, MF_STRING, ID_ROATE2, L\"逆时针\");//\n\t\tSetMenu(hWnd, rotate);//\t\n```\n- 11、添加菜单“顺时针”和“逆时针”的响应\n```c\n//参考Tetris.cpp中239~244行\n        case ID_ROATE1:\n\t\t\tselectRotate(hWnd, 0);//顺时针\n\t\t\tbreak;\n\t\tcase ID_ROATE2:\n\t\t\tselectRotate(hWnd, 1);//逆时针\n\t\t\tbreak;\n```\n- 12、修改Tetris.cpp525行RotateTeris的实现代码，根据GAME_ROTATE的值来确定旋转方向，0：顺时针，1：逆时针\n- 13、填写\"MyTetris/大作业报告.doc\" 按照该模板撰写大作业报告(需要填写“学号”、“姓名”和报告正文，报告中不需要代码截图，也不需要运行结果截图)\n四、将本地代码仓库push到远程仓库","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsqlsec%2Ftetris","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsqlsec%2Ftetris","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsqlsec%2Ftetris/lists"}