当前位置:网站首页>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();
边栏推荐
- Cvpr2022 | panopticdepth: a unified framework for depth aware panoramic segmentation
- 代码整洁之道学习笔记
- C # output the middle order traversal through the clue binary tree
- Leetcode game 299
- cnpm报错‘cnpm‘不是内部或外部命令,也不是可运行的程序或批处理文件
- Principle and Simulation of bind
- Yolo series combs (IX) first taste of newly baked yolov6
- UI file introduction in QT
- leetcode 903. DI 序列的有效排列
- 安装terraform-ovirt插件为ovirt提供自动化管理
猜你喜欢

CVPR2022 | 重新审视池化:你的感受野不是最理想的

基于51单片机控制的BUCK开关电源Proteus仿真

CVPR 2022 | 未知目标检测模块STUD:学习视频中的未知目标

Leetcode game 299

RT-Thread内存管理

Lm07 - detailed discussion on cross section strategy of futures

倍福TwinCAT配置、调试第三方伺服详细讲解--以汇川IS620N为例子

C语言内存函数

倍福控制器连接松下EtherCAT伺服注意事项

Cvpr2022 𞓜 future transformer with long-term action expectation
随机推荐
如果我在深圳,到哪里开户比较好?另外想问,现在在线开户安全么?
Hystrix断路器
【云驻共创】工业智慧“大脑”,老厂焕新的加速秘籍
The role of each part of Neural Network & thoroughly understand neural network
Can I open an account online? Is it safe
Principle and Simulation of bind
YOLO系列梳理(九)初尝新鲜出炉的YOLOv6
倍福TwinCAT3 的OPC_UA通信测试案例
GEE——美国LANDFIRE火灾数据集
三维模型下载与动画控制
Nacos startup error
Matlab to find the limit
C语言字符函数
Cvpr2022 𞓜 loss problem in weakly supervised multi label classification
神经网络各个部分的作用 & 彻底理解神经网络
SCHIEDERWERK电源维修SMPS12/50 PFC3800解析
C#通过中序遍历对二叉树进行线索化
商品搜索引擎—推荐系统设计
倍福PLC通过CANOpen通信控制伺服
Detailed explanation on configuration and commissioning of third-party servo of Beifu TwinCAT -- Taking Huichuan is620n as an example