#pragma warning(disable:4996)//sprintf出错加这句
#include<iostream>
#include<string>
#include<stdio.h>
#include <time.h>
#include <windows.h>
#include <Windows.h>
#include <thread>
#include <stdlib.h>
#include <conio.h>
#include<cstdio>
#include<cstdlib>
#define XX 20
#define YY 30
#define KEY_DOWN(vk_c) (GetAsyncKeyState(vk_c)&0x8000?1:0)
using namespace std;
char p[31][20][2];
int spin = 1;
int MX = 0, MY = -4;
int FX = MX, FY = MY;
int Time = 500;
HANDLE hOutput, hOutBuf;
COORD coord = {
0,0 };
DWORD bytes = 0;
int Gdata = 0;
int weizhi = 0;
int Down = 0;
int Gp = 0;
int Clear = 0;
int FIX[5], FIY[5];
int fen = 0;
char o[3] = "▇";
char k[3] = " "; char b[3] = "◆";
char control = 0;
int F1[4][4] = {
{
0,1,0,0 },{
0,1,0,0 },{
0,1,0,0 },{
0,1,0,0 } },
F2[4][4] = {
{
0,0,0,0 },{
1,1,1,1 },{
0,0,0,0 },{
0,0,0,0 } },
F3[4][4] = {
{
0,1,1,0 },{
0,1,1,0 },{
0,0,0,0 },{
0,0,0,0 } },
F4[4][4] = {
{
0,1,0,0 },{
0,1,1,0 },{
0,0,1,0 },{
0,0,0,0 } },
F5[4][4] = {
{
0,0,1,0 },{
0,1,1,0 },{
0,1,0,0 },{
0,0,0,0 } },
F6[4][4] = {
{
0,0,0,0 },{
1,0,0,0 },{
1,1,1,0 },{
0,0,0,0 } },
F7[4][4] = {
{
0,0,0,0 },{
0,0,0,1 },{
0,1,1,1 },{
0,0,0,0 } },
F8[4][4] = {
{
0,0,0,0 },{
0,1,0,0 },{
1,1,1,0 },{
0,0,0,0 } };
int FF[4][4];
void GW(int x, int y)
{
if (weizhi == 0)
{
weizhi = 1;
FX = x; FY = y;
weizhi = 0;
}
}
void dayin()
{
for (int y = 0; y < 30; y++)
{
for (int x = 0; x < 20; x++)
{
if (y == 0 || y == 29)
{
for (int z = 0; z < 2; z++)
{
p[y][x][z] = o[z];
}
}
else
用c++编写俄罗斯方块
最新推荐文章于 2024-08-25 21:00:00 发布
本文介绍了使用C++编程语言实现经典游戏俄罗斯方块的过程,包括游戏规则、方块生成、下落、旋转、消除行等核心功能。
摘要由CSDN通过智能技术生成