当前位置:网站首页>win32版俄罗斯方块(学习MFC必不可少)
win32版俄罗斯方块(学习MFC必不可少)
2022-06-29 12:28:00 【强尼爆紫】
所有相关资源都放这了
链接:https://pan.baidu.com/s/1X0VtagZ5ZEoAm63n7f8l-A?pwd=pbbm
提取码:pbbm
游戏功能介绍:
加速下降,左右移动,按上键改变方块形状,空格暂停,得分显示。
直接复制头文件,源文件无法运行游戏,因为还有资源文件,都放在网盘里了。
头文件内容
#include <Windows.h>
#include <time.h>
#include "resource.h"
#define WINDOW_WIDTH 520
#define WINDOW_HEIGHT 640
#define ID_DOWNTIME 1
//背景网格
int g_arrBackground[20][10] = {
0 };
//俄罗斯方块预览
int g_arrPreviewTetris[2][4] = {
0 };
//俄罗斯方块
int g_arrTetris[2][4] = {
0 };
//预览图方块形状
int g_nPreviewBlockType = 0;
//当前俄罗斯方块形状
int g_nTetrisBlockType = 0;
//预览图坐标 x:横向;y:纵向
POINT g_PreviewBlockPos = {
-1, -1 };
//当前方块坐标
POINT g_TetrisBlockPos = {
-1, -1 };
BOOL g_bGameing;
int g_nScore=0;
void CreateTetrisBlock();
void Draw(HDC hDC, HBITMAP hBitMap);
void OnCreate();
void OnPaint(HDC hDC);
void OnReturn(HWND hWnd);
void OnTimer(HWND hWnd);
//复制俄罗斯方块到网格
void CopyTetrisBlock();
void BlockDown();
BOOL IsBottom();
void AdjustStatue();
BOOL OtherBlock();
BOOL IsGameOver(HWND hWnd);
void OnLeft();
void OnRight();
void OnDown(HWND hWnd);
void OnSpace(HWND hWnd);
void OnUp();
void StripChange();
void OnShape();
void CleanLine();
源文件内容
#include <Windows.h>
#include <time.h>
#include "resource.h"
#define WINDOW_WIDTH 520
#define WINDOW_HEIGHT 640
#define ID_DOWNTIME 1
//背景网格
int g_arrBackground[20][10] = { 0 };
//俄罗斯方块预览
int g_arrPreviewTetris[2][4] = { 0 };
//俄罗斯方块
int g_arrTetris[2][4] = { 0 };
//预览图方块形状
int g_nPreviewBlockType = 0;
//当前俄罗斯方块形状
int g_nTetrisBlockType = 0;
//预览图坐标 x:横向;y:纵向
POINT g_PreviewBlockPos = { -1, -1 };
//当前方块坐标
POINT g_TetrisBlockPos = { -1, -1 };
BOOL g_bGameing;
int g_nScore=0;
void CreateTetrisBlock();
void Draw(HDC hDC, HBITMAP hBitMap);
void OnCreate();
void OnPaint(HDC hDC);
void OnReturn(HWND hWnd);
void OnTimer(HWND hWnd);
//复制俄罗斯方块到网格
void CopyTetrisBlock();
void BlockDown();
BOOL IsBottom();
void AdjustStatue();
BOOL OtherBlock();
BOOL IsGameOver(HWND hWnd);
void OnLeft();
void OnRight();
void OnDown(HWND hWnd);
void OnSpace(HWND hWnd);
void OnUp();
void StripChange();
void OnShape();
void CleanLine();
边栏推荐
- Pod security policy (PSP)
- C语言内存函数
- File contained log poisoning (user agent)
- 记一次固态更新与系统迁移debug的过程
- Comparison table of LR and Cr button batteries
- The role of each part of Neural Network & thoroughly understand neural network
- Don't build the wheel again. It is recommended to use Google guava open source tool class library. It is really powerful!
- 服务器上的RTC时间与世界时间不一致解决办法
- asp. Net project using aspnet_ compiler. Exe Publishing
- The former security director of Uber faced fraud allegations and concealed the data leakage event
猜你喜欢

SCHIEDERWERK电源维修SMPS12/50 PFC3800解析

Matlab to find the limit

中职网络安全技能竞赛之应用服务漏洞扫描与利用(SSH私钥泄露)

Cvpr2022 𞓜 future transformer with long-term action expectation

CVPR2022 | 通过目标感知Transformer进行知识蒸馏

从Mpx资源构建优化看splitChunks代码分割

CVPR2022 | 长期行动预期的Future Transformer

Interesting talk on network protocol (II) transport layer

Cvpr2022 | a convnet for the 2020s & how to design neural network Summary

超 Nice 的表格响应式布局小技巧
随机推荐
CVPR2022 | 可精简域适应
Acwing 234 abandoning testing
Yolo series combs (IX) first taste of newly baked yolov6
Record the process of a solid-state update and system migration debug
Detailed explanation on configuration and commissioning of third-party servo of Beifu TwinCAT -- Taking Huichuan is620n as an example
QQ group was stolen, a large-scale social death scene caught off guard
C binary tree structure definition and node value addition
神经网络各个部分的作用 & 彻底理解神经网络
nvtmpp
Check yaml file security configuration: kubesec
C # realize the definition, stack entry and stack exit of stack structure
leetcode 522. 最长特殊序列 II
qt 自定义控件 :取值范围
bind原理及模拟实现
Schiederwerk power supply maintenance smps12/50 pfc3800 analysis
hutool工具类的学习(持续更新)
Acwing game 57
Ordinary users use vscode to log in to SSH and edit the root file
Install the typescript environment and enable vscode to automatically monitor the compiled TS file as a JS file
mybaits入门(含实例教程和源码)