资深光能
自己做的一个小小的代码。本人只是六年级,有些地方有不足,还请各位大佬们轻**。
说实话,还有多少人记得酷町天梯呢?
//头文件
#include<bits/stdc++.h>
#include<windows.h>
#include<conio.h>
#include<stdio.h>
#include<cstdlib>
#include<winuser.h>
#include<iomanip>
using namespace std;
int l,r;
//SetPos定义
void SetPos(COORD a) {
HANDLE out=GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(out, a);
}
void SetPos(int i, int j) {
COORD pos={i, j};
SetPos(pos);
}
//自定义函数
void initialization();//初始化函数初始化输出
void Super_Mario();//超级马里奥(游戏开始)
void output(int x1,int y1,int x,int y);//定点输出
void cls();//清屏函数
void Introduction();//操作简介
bool ok();//判断是否还能继续
bool ko();//判断是否成功
bool success();//判断终点是否存在
//地图
int map1[2000][2000]={//13行18列
// 0 1 2 3 4 5 6 7 8 9 10111213141516171819
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},//0
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},//1
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},//2
{0,1,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1},//3
{0,1,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1},//4
{0,1,4,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1},//5
{0,1,1,1,0,1,0,1,1,1,0,0,0,0,0,0,1,0,0,1},//6
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1},//7
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},//8
{0,1,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,1},//9
{0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1},//10
{0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1},//11
{0,1,5,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1},//12
{0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1},//13
{0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1},//14
};
int main(){
initialization();//初始化
Super_Mario();//超级马里奥(游戏开始)
return 0;
}
bool ok(){
if(map1[l+1][r]!=2)return true;
return false;
}
bool success(){
for(int i=0;i<=14;i++){
for(int j=0;j<=19;j++){
switch(map1[i][j]){
case 4:{
return false;
break;
}
}
}
}
return true;
}
bool ko(){
if(map1[l][r-1]==4||success())return true;
return false;
}
//地图输出
void output(int x,int y,int x1,int y1){
for(int i=x;i<=x1;i++){
for(int j=y;j<=y1;j++){
switch(map1[i][j]){
case 0:{
cout<<" ";
break;
}
case 1:{
cout<<"■";
break;
}
case 5:{
cout<<"♀";
l=i;r=j;
break;
}
case 2:{
cout<<"**";
break;
}
case 4:{
cout<<"×";
break;
}
}
}
cout<<endl;
}
}
//清屏函数
void cls(){
system("cls");
}
//初始化函数初始化输出
void initialization(){
printf("酷町天梯\n");
printf("经典小游戏\n");
printf("C.G出品\n");
//特殊符号┍┑┕┙‖═
printf("操作提示:上(W),下(S),确定(Z)\n");
printf("┍═════════════┑\n");
printf("‖> 开始游戏 ‖\n");
printf("‖ 操作简介 ‖\n");
printf("┕═════════════┙\n");
int flag=0;
while(1){
if(GetAsyncKeyState('W')){
cls();
printf("酷町天梯\n");
printf("经典小游戏\n");
printf("C.G出品\n");
//特殊符号┍┑┕┙‖═
printf("操作提示:上(W),下(S),确定(Z)\n");
printf("┍═════════════┑\n");
printf("‖> 开始游戏 ‖\n");
printf("‖ 操作简介 ‖\n");
printf("┕═════════════┙\n");
flag=0;
}else if(GetAsyncKeyState('S')){
cls();
printf("酷町天梯\n");
printf("经典小游戏\n");
printf("C.G出品\n");
//特殊符号┍┑┕┙‖═
printf("操作提示:上(W),下(S),确定(Z)\n");
printf("┍═════════════┑\n");
printf("‖ 开始游戏 ‖\n");
printf("‖> 操作简介 ‖\n");
printf("┕═════════════┙\n");
flag=1;
}else if(GetAsyncKeyState('Z')){
switch(flag){
case 0:{
return ;
break;
}
case 1:{
Introduction();
return ;
break;
}
}
}
}
}
//操作简介
void Introduction(){
cls();
printf("操作简介\n");
printf("往左移动:A 往右移动:D 跳跃:W\n");
printf("Z.退出");
while(1){
if(GetAsyncKeyState('Z')){
return ;
}
}
}
//超级马里奥函数
void Super_Mario(){
int flag=0;
cls();
output(0,0,14,19);
while(ok()){
if(ko()){
cls();
cout<<"过关!";
Sleep(2000);
return ;
}
cls();
output(0,0,14,19);
if(GetAsyncKeyState('D')&&map1[l][r+1]!=1){
map1[l][r]=0;
r++;
map1[l][r]=5;
}
if(GetAsyncKeyState('A')&&map1[l][r-1]!=1){
map1[l][r]=0;
r--;
map1[l][r]=5;
}
if(GetAsyncKeyState('W')&&map1[l-1][r]!=1&&flag==0){
map1[l][r]=0;
l--;
map1[l][r]=5;
flag++;
continue;
}
if(flag==1&&map1[l-1][r]!=1){
map1[l][r]=0;
l--;
map1[l][r]=5;
flag++;
continue;
}
if(flag==2&&map1[l+1][r]!=1){
map1[l][r]=0;
l++;
map1[l][r]=5;
flag++;
continue;
}else if(flag==2){
flag++;
}
if(flag==3&&map1[l+1][r]!=1){
map1[l][r]=0;
l++;
map1[l][r]=5;
flag=0;
continue;
}else if(flag==3){
flag=0;
}
while(map1[l+1][r]==0&&flag==0){
map1[l][r]=0;
l++;
map1[l][r]=5;
continue;
}
}
cls();
cout<<"Gave Over!!!";
Sleep(2000);
}
陈则霖在2021-11-17 18:49:13追加了内容
//头文件
#include<bits/stdc++.h>
#include<windows.h>
#include<conio.h>
#include<stdio.h>
#include<cstdlib>
#include<winuser.h>
#include<iomanip>
using namespace std;
int l,r,d=1;
//SetPos定义
void SetPos(COORD a) {
HANDLE out=GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(out, a);
}
void SetPos(int i, int j) {
COORD pos={i, j};
SetPos(pos);
}
void cls()//清屏函数,对于推箱子的意义重大,但是也存在问题
{
Sleep(100);
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
COORD coordScreen = { 0, 0 };
SetConsoleCursorPosition( hConsole, coordScreen );
}
//自定义函数
void initialization();//初始化函数初始化输出
void Super_Mario();//超级马里奥(游戏开始)
void output(int x1,int y1,int x,int y);//定点输出
void Introduction();//操作简介
bool ok();//判断是否还能继续
bool ko();//判断是否成功
bool success();//判断终点是否存在
//地图
int map1[100][100][100]={//13行18列
{
// 0 1 2 3 4 5 6 7 8 9 10111213141516171819
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},//0
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},//1
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},//2
{0,1,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1},//3
{0,1,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1},//4
{0,1,4,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1},//5
{0,1,1,1,0,1,0,1,1,1,0,0,0,0,0,0,1,0,0,1},//6
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1},//7
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},//8
{0,1,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,1},//9
{0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1},//10
{0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1},//11
{0,1,5,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1},//12
{0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1},//13
{0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1},//14
},
{
// 0 1 2 3 4 5 6 7 8 9 10111213141516171819
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},//0
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},//1
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},//2
{0,1,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1},//3
{0,1,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1},//4
{0,1,4,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1},//5
{0,1,1,1,0,1,0,1,1,1,0,0,0,0,0,0,1,0,0,1},//6
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1},//7
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},//8
{0,1,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,1},//9
{0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1},//10
{0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1},//11
{0,1,5,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1},//12
{0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1},//13
{0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1},//14
}
};
int main(){
initialization();//初始化
while(true){
Super_Mario();//超级马里奥(游戏开始)
}
return 0;
}
bool ok(){
if(map1[d][l+1][r]!=2)return true;
return false;
}
bool success(){
for(int i=(d-1)*14;i<=d*14;i++){
for(int j=(d-1)*19;j<=d*19;j++){
switch(map1[d][i][j]){
case 4:{
return false;
break;
}
}
}
}
return true;
}
bool ko(){
if(map1[d][l+(d-1)*14][r-1]==4||success())return true;
return false;
}
//地图输出
void output(int x,int y,int x1,int y1){
for(int i=x;i<=x1;i++){
for(int j=y;j<=y1;j++){
switch(map1[d][i][j]){
case 0:{
cout<<" ";
break;
}
case 1:{
cout<<"■";
break;
}
case 5:{
cout<<"♀";
l=i;r=j;
break;
}
case 2:{
cout<<"**";
break;
}
case 4:{
cout<<"×";
break;
}
}
}
cout<<endl;
}
}
//清屏函数
//初始化函数初始化输出
void initialization(){
printf("酷町天梯\n");
printf("经典小游戏\n");
printf("C.G出品\n");
//特殊符号┍┑┕┙‖═
printf("操作提示:上(W),下(S),确定(Z)\n");
printf("┍═════════════┑\n");
printf("‖> 开始游戏 ‖\n");
printf("‖ 操作简介 ‖\n");
printf("┕═════════════┙\n");
int flag=0;
while(1){
if(GetAsyncKeyState('W')){
cls();
printf("酷町天梯\n");
printf("经典小游戏\n");
printf("C.G出品\n");
//特殊符号┍┑┕┙‖═
printf("操作提示:上(W),下(S),确定(Z)\n");
printf("┍═════════════┑\n");
printf("‖> 开始游戏 ‖\n");
printf("‖ 操作简介 ‖\n");
printf("┕═════════════┙\n");
flag=0;
}else if(GetAsyncKeyState('S')){
cls();
printf("酷町天梯\n");
printf("经典小游戏\n");
printf("C.G出品\n");
//特殊符号┍┑┕┙‖═
printf("操作提示:上(W),下(S),确定(Z)\n");
printf("┍═════════════┑\n");
printf("‖ 开始游戏 ‖\n");
printf("‖> 操作简介 ‖\n");
printf("┕═════════════┙\n");
flag=1;
}else if(GetAsyncKeyState('Z')){
switch(flag){
case 0:{
return ;
break;
}
case 1:{
Introduction();
return ;
break;
}
}
}
}
}
//操作简介
void Introduction(){
cls();
printf("操作简介\n");
printf("往左移动:A 往右移动:D 跳跃:W\n");
printf("Z.退出");
while(1){
if(GetAsyncKeyState('Z')){
return ;
}
}
}
//超级马里奥函数
void Super_Mario(){
int flag=0;
cls();
output(0+(d-1)*14,0+(d-1)*14,d*14,d*19);
while(ok()){
if(ko()){
cls();
cout<<"过关!";
Sleep(2000);
return ;
}
cls();
output(0+(d-1)*14,0+(d-1)*14,d*14,d*19);
if(GetAsyncKeyState('D')&&map1[d][l][r+1]!=1){
map1[d][l][r]=0;
r++;
map1[d][l][r]=5;
}
if(GetAsyncKeyState('A')&&map1[d][l][r-1]!=1){
map1[d][l][r]=0;
r--;
map1[d][l][r]=5;
}
if(GetAsyncKeyState('W')&&map1[d][l-1][r]!=1&&flag==0){
map1[d][l][r]=0;
l--;
map1[d][l][r]=5;
flag++;
continue;
}
if(flag==1&&map1[d][l-1][r]!=1){
map1[d][l][r]=0;
l--;
map1[d][l][r]=5;
flag++;
continue;
}
if(flag==2&&map1[d][l+1][r]!=1){
map1[d][l][r]=0;
l++;
map1[d][l][r]=5;
flag++;
continue;
}else if(flag==2){
flag++;
}
if(flag==3&&map1[d][l+1][r]!=1){
map1[d][l][r]=0;
l++;
map1[d][l][r]=5;
flag=0;
continue;
}else if(flag==3){
flag=0;
}
while(map1[d][l+1][r]==0&&flag==0){
map1[d][l][r]=0;
l++;
map1[d][l][r]=5;
break;
}
}
cls();
cout<<"Gave Over!!!";
Sleep(2000);
return ;
}
谢谢提醒,作者对代码进行了优化。
不过关卡的问题还是需要作者想一想
陈则霖在2021-11-17 18:49:19追加了内容
//头文件
#include<bits/stdc++.h>
#include<windows.h>
#include<conio.h>
#include<stdio.h>
#include<cstdlib>
#include<winuser.h>
#include<iomanip>
using namespace std;
int l,r,d=1;
//SetPos定义
void SetPos(COORD a) {
HANDLE out=GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(out, a);
}
void SetPos(int i, int j) {
COORD pos={i, j};
SetPos(pos);
}
void cls()//清屏函数,对于推箱子的意义重大,但是也存在问题
{
Sleep(100);
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
COORD coordScreen = { 0, 0 };
SetConsoleCursorPosition( hConsole, coordScreen );
}
//自定义函数
void initialization();//初始化函数初始化输出
void Super_Mario();//超级马里奥(游戏开始)
void output(int x1,int y1,int x,int y);//定点输出
void Introduction();//操作简介
bool ok();//判断是否还能继续
bool ko();//判断是否成功
bool success();//判断终点是否存在
//地图
int map1[100][100][100]={//13行18列
{
// 0 1 2 3 4 5 6 7 8 9 10111213141516171819
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},//0
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},//1
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},//2
{0,1,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1},//3
{0,1,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1},//4
{0,1,4,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1},//5
{0,1,1,1,0,1,0,1,1,1,0,0,0,0,0,0,1,0,0,1},//6
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1},//7
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},//8
{0,1,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,1},//9
{0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1},//10
{0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1},//11
{0,1,5,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1},//12
{0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1},//13
{0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1},//14
},
{
// 0 1 2 3 4 5 6 7 8 9 10111213141516171819
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},//0
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},//1
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},//2
{0,1,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1},//3
{0,1,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1},//4
{0,1,4,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1},//5
{0,1,1,1,0,1,0,1,1,1,0,0,0,0,0,0,1,0,0,1},//6
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1},//7
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},//8
{0,1,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,1},//9
{0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1},//10
{0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1},//11
{0,1,5,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1},//12
{0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1},//13
{0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1},//14
}
};
int main(){
initialization();//初始化
while(true){
Super_Mario();//超级马里奥(游戏开始)
}
return 0;
}
bool ok(){
if(map1[d][l+1][r]!=2)return true;
return false;
}
bool success(){
for(int i=(d-1)*14;i<=d*14;i++){
for(int j=(d-1)*19;j<=d*19;j++){
switch(map1[d][i][j]){
case 4:{
return false;
break;
}
}
}
}
return true;
}
bool ko(){
if(map1[d][l+(d-1)*14][r-1]==4||success())return true;
return false;
}
//地图输出
void output(int x,int y,int x1,int y1){
for(int i=x;i<=x1;i++){
for(int j=y;j<=y1;j++){
switch(map1[d][i][j]){
case 0:{
cout<<" ";
break;
}
case 1:{
cout<<"■";
break;
}
case 5:{
cout<<"♀";
l=i;r=j;
break;
}
case 2:{
cout<<"**";
break;
}
case 4:{
cout<<"×";
break;
}
}
}
cout<<endl;
}
}
//清屏函数
//初始化函数初始化输出
void initialization(){
printf("酷町天梯\n");
printf("经典小游戏\n");
printf("C.G出品\n");
//特殊符号┍┑┕┙‖═
printf("操作提示:上(W),下(S),确定(Z)\n");
printf("┍═════════════┑\n");
printf("‖> 开始游戏 ‖\n");
printf("‖ 操作简介 ‖\n");
printf("┕═════════════┙\n");
int flag=0;
while(1){
if(GetAsyncKeyState('W')){
cls();
printf("酷町天梯\n");
printf("经典小游戏\n");
printf("C.G出品\n");
//特殊符号┍┑┕┙‖═
printf("操作提示:上(W),下(S),确定(Z)\n");
printf("┍═════════════┑\n");
printf("‖> 开始游戏 ‖\n");
printf("‖ 操作简介 ‖\n");
printf("┕═════════════┙\n");
flag=0;
}else if(GetAsyncKeyState('S')){
cls();
printf("酷町天梯\n");
printf("经典小游戏\n");
printf("C.G出品\n");
//特殊符号┍┑┕┙‖═
printf("操作提示:上(W),下(S),确定(Z)\n");
printf("┍═════════════┑\n");
printf("‖ 开始游戏 ‖\n");
printf("‖> 操作简介 ‖\n");
printf("┕═════════════┙\n");
flag=1;
}else if(GetAsyncKeyState('Z')){
switch(flag){
case 0:{
return ;
break;
}
case 1:{
Introduction();
return ;
break;
}
}
}
}
}
//操作简介
void Introduction(){
cls();
printf("操作简介\n");
printf("往左移动:A 往右移动:D 跳跃:W\n");
printf("Z.退出");
while(1){
if(GetAsyncKeyState('Z')){
return ;
}
}
}
//超级马里奥函数
void Super_Mario(){
int flag=0;
cls();
output(0+(d-1)*14,0+(d-1)*14,d*14,d*19);
while(ok()){
if(ko()){
cls();
cout<<"过关!";
Sleep(2000);
return ;
}
cls();
output(0+(d-1)*14,0+(d-1)*14,d*14,d*19);
if(GetAsyncKeyState('D')&&map1[d][l][r+1]!=1){
map1[d][l][r]=0;
r++;
map1[d][l][r]=5;
}
if(GetAsyncKeyState('A')&&map1[d][l][r-1]!=1){
map1[d][l][r]=0;
r--;
map1[d][l][r]=5;
}
if(GetAsyncKeyState('W')&&map1[d][l-1][r]!=1&&flag==0){
map1[d][l][r]=0;
l--;
map1[d][l][r]=5;
flag++;
continue;
}
if(flag==1&&map1[d][l-1][r]!=1){
map1[d][l][r]=0;
l--;
map1[d][l][r]=5;
flag++;
continue;
}
if(flag==2&&map1[d][l+1][r]!=1){
map1[d][l][r]=0;
l++;
map1[d][l][r]=5;
flag++;
continue;
}else if(flag==2){
flag++;
}
if(flag==3&&map1[d][l+1][r]!=1){
map1[d][l][r]=0;
l++;
map1[d][l][r]=5;
flag=0;
continue;
}else if(flag==3){
flag=0;
}
while(map1[d][l+1][r]==0&&flag==0){
map1[d][l][r]=0;
l++;
map1[d][l][r]=5;
break;
}
}
cls();
cout<<"Gave Over!!!";
Sleep(2000);
return ;
}
谢谢提醒,作者对代码进行了优化。
不过关卡的问题还是需要作者想一想
缔造者之神
人都给我闪没了
这里推荐使用:
void clear()//清屏函数,对于推箱子的意义重大,但是也存在问题
{
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
COORD coordScreen = { 0, 0 };
SetConsoleCursorPosition( hConsole, coordScreen );
}
这个函数是用来覆盖的,适合你这种游戏