C++控制台編程“坦克大戰”


新手C++ 坦克大戰

本人新手寫的比較雜亂,不喜勿噴,

1、首先,先用圖片介紹下代碼運行邏輯,

代碼邏輯

2、這是控制台的界面,展示一下各個功能的界面

開始界面
菜單
單人模式界面
單人模式
雙人模式界面
雙人模式
自定義地圖
自定義地圖

3、以下是代碼展示

這是菜單類

#include "Menu.h"
#include <windows.h>
#include "Game.h"
//顯示歡迎界面
void Menu::Show_Welcome()
{
	Map::Colors(白色);
	Map::WriteChar(2,8,"I - 2600 HI - 20000");
	Map::Colors(紫色);
	Map::WriteChar(5, 10,   "▓▓▓▓▓ ▓ ▓▓▓▓▓ ▓▓▓▓▓ ▓ ▓▓▓▓▓");
	Sleep(100);
	Map::WriteChar(6, 10,   "▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ");
	Sleep(100);
	Map::WriteChar(7, 10,   "▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ");
	Sleep(100);
	Map::WriteChar(8, 10,   "▓▓▓▓▓ ▓ ▓ ▓ ▓ ▓ ▓▓▓▓▓");
	Sleep(100);
	Map::WriteChar(9, 10,   "▓ ▓ ▓▓▓▓▓▓ ▓ ▓ ▓ ▓ ");
	Sleep(100);
	Map::WriteChar(10, 10,  "▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ");
	Sleep(100);
	Map::WriteChar(11, 10,  "▓▓▓▓▓ ▓ ▓ ▓ ▓ ▓▓▓▓ ▓▓▓▓▓");
	Sleep(100);
	Map::WriteChar(13, 14,  " ▓▓▓▓ ▓▓▓▓▓ ▓▓▓▓▓ ▓ ▓ ");
	Sleep(100);
	Map::WriteChar(14, 14,  " ▓▓ ▓ ▓ ▓ ▓ ▓ ");
	Sleep(100);
	Map::WriteChar(15, 14,  " ▓▓ ▓ ▓ ▓ ▓ ");
	Sleep(100);
	Map::WriteChar(16, 14,  "▓ ▓ ▓ ▓▓▓ ");
	Sleep(100);
	Map::WriteChar(17, 14,  " ▓▓ ▓ ▓ ▓ ");
	Sleep(100);
	Map::WriteChar(18, 14,  " ▓▓ ▓ ▓ ▓ ▓ ");
	Sleep(100);
	Map::WriteChar(19, 14,  " ▓▓▓▓ ▓▓▓▓▓ ▓ ▓ ");
	Sleep(200);
}
//靜態菜單信息
void Menu::Show_Menu()
{
	Map::Colors(白色);	
	Map::WriteChar(38,22, "@ 1990 1980 NAMCO LTD.");
	Map::WriteChar(39,24, "ALL RIGHTS RESERVED");
}
//自定義地圖賦值及打印
int tool::Init_Map[41][41];
void tool::Init_Info()
{
    int i,j;
    for (i = 0; i < HIGHT; i++)
    {
        for (j = 0; j < WIDTH; j++)
        {
            Init_Map[41][41];


            //初始化邊框
            if (Init_Map[i][j] == 邊框)
            {
				SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_GREEN
					| FOREGROUND_RED | FOREGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_BLUE);
                Map::WriteChar(i, j, "■");
            }
            
            if (Init_Map[i][j] == 黃土牆)//被擊中變成紅土牆
            {
                SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_RED | BACKGROUND_GREEN | BACKGROUND_RED);
                Map::WriteChar(i, j, "▓");
            }
            if (Init_Map[i][j] == 紅土牆)
            {
                SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED | BACKGROUND_GREEN | BACKGROUND_RED);
                Map::WriteChar(i, j, "▓");
            }
            if (Init_Map[i][j] == 水流)
            {
                SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | BACKGROUND_BLUE | FOREGROUND_BLUE | FOREGROUND_GREEN);
                Map::WriteChar(i, j, "~");
            }
            if (Init_Map[i][j] == 鋼牆)
            {
                SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_GREEN| FOREGROUND_RED | FOREGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_BLUE);
                Map::WriteChar(i, j, "■");
            }
            if (Init_Map[i][j] == 老家)
            {
                SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_BLUE | FOREGROUND_RED | FOREGROUND_GREEN);
                Map::Map::WriteChar(37, 19, "◣★◢");
                Map::WriteChar(38, 19, "███");
                Map::WriteChar(39, 19, "◢█◣");

            }
            Map::Colors(黑色);
        }
    }
}
void tool::menu()
{
	COORD Coord[3];
	const char mu[3][16] =
	{
		" ",
		 "1 PLAYER",
		 "2 PLAYERS",
	};
	for (int i = 0; i < 3; i++)
	{
		Coord[i].Y = 24;
	}
	Coord[0].X = 23;
	Coord[1].X = 25;
	Coord[2].X = 27;

	for (int i = 0; i < 3; i++)
	{
		Map::WriteChar(Coord[i].X, Coord[i].Y, mu[i]);
	}
	Map::Colors(綠色);
	Map::WriteChar(Coord[1].X, Coord[1].Y, mu[1]);
	int Select = 1;
	while (1)
	{
		if (GetAsyncKeyState('W') & 0x8001)
		{
			Map::Colors(白色);
			Map::WriteChar(Coord[Select].X, Coord[Select].Y, mu[Select]);
			if (Select == 1)
				Select = 2;
			else
				Select--;
			Map::Colors(綠色);
			Map::WriteChar(Coord[Select].X, Coord[Select].Y, mu[Select]);
		}
		else if (GetAsyncKeyState('S') & 0x8001)
		{
			Map::Colors(白色);
			Map::WriteChar(Coord[Select].X, Coord[Select].Y, mu[Select]);
			if (Select == 2)
				Select = 1;
			else
				Select++;
			Map::Colors(綠色);
			Map::WriteChar(Coord[Select].X, Coord[Select].Y, mu[Select]);
		}
		else if (GetAsyncKeyState(0xD) & 0x8001)//回車鍵
		{
			switch (Select)
			{
			case 1:Game::play = 1; break;
			case 2:Game::play = 2; break;
			default:
				break;
			}
			return;
		}
		Sleep(200);
	}
}

坦克類

#include "Tank.h"
#include "Map.h"
#pragma comment(lib,"winmm.lib")
//坦克mode模型的三維數組
const char* tank_figure[6][3][4] =
{
	{
	{"█┃ █", "█┳ █", "███", "███"},
	{"█●█", "█●█", "━ ●┫", "┣ ●━"},
	{"█┻ █", "█┃ █", "███", "███"}
  },
  {
	{"◢┃ ◣", "◢━ ◣", "◢┳ ◣", "◢┳ ◣"},
	{"┣ ●┫", "┣ ●┫", "━ ●┃", "┃ ●━"},
	{"◥━ ◤", "◥┃ ◤", "◥┻ ◤", "◥┻ ◤"}
  },
  {
	{"┏ ┃ ┓", "┏ ┳ ┓", "┏ ┳ ┓", "┏ ┳ ┓"},
	{"┣ ●┫", "┣ ●┫", "━ ●┫", "┣ ●━"},
	{"┗ ┻ ┛", "┗ ┃ ┛", "┗ ┻ ┛", "┗ ┻ ┛"}
  },
  {
	{"┏ ┃ ┓", "◢━ ◣", "┏ ┳ ◣", "◢┳ ┓"},
	{"┣ ●┫", "┣ ●┫", "━ ●┃", "┃ ●━"},
	{"◥━ ◤", "┗ ┃ ┛", "┗ ┻ ◤", "◥┻ ┛"}
  },
  {
	{"╔ ┃ ╗", "╔ ╦ ╗", "╔ ╦ ╗", "╔ ╦ ╗"},
	{"╠ █╣", "╠ █╣", "━ █╣", "╠ █━"},
	{"╚ ╩ ╝", "╚ ┃ ╝", "╚ ╩ ╝", "╚ ╩ ╝"}
  },
 {
	{" ■ ", "■ ■", " ■■", "■■ "},
	{"■●■", "■●■", "■● ", " ●■"},
	{"■ ■", " ▉ ", " ■■", "■■ "}
 }
};
//坦克構造
Tank::Tank(COORD pos, DIR dir,int mode,int team)
{
	//坐標
	this->pos = pos;
	//方向
	this->dir = dir;
	//圖案模型
	this->mode = mode;
	//陣營
	this->team = team;
	//時間坦克移動
	this->CD = 150;
	this->end_time = clock();
	this->music = clock();
	//坦克分數
	this->score = 0;
	//打印坦克
	Show_Tank();
}
//打印坦克
void Tank::Show_Tank()
{
	const char* (*tankModel)[4] = tank_figure[mode];
	for (int i = 0; i < 3; i++)
	{
		//敵方坦克需要彩色,來區別
		if (team == 3)
		{
			Map::Colors(rand()%7+2);
		}
		else
		{
			Map::Colors(紫色);
		}
		Map::WriteChar(pos.X-1+i,pos.Y-1,tankModel[i][dir]);
		Map::dynamic[pos.X - 1 + i][pos.Y - 1] = 坦克;
		Map::dynamic[pos.X - 1 + i][pos.Y ] = 坦克;
		Map::dynamic[pos.X - 1 + i][pos.Y+1] = 坦克;

	}
}
//清理坦克
void Tank::Clear_Tank()
{
	for (int i = 0; i < 3; i++)
	{		
		Map::WriteChar(pos.X - 1 + i, pos.Y - 1, " ");
		Map::dynamic[pos.X - 1 + i][pos.Y - 1] = 空地;
		Map::dynamic[pos.X - 1 + i][pos.Y] = 空地;
		Map::dynamic[pos.X - 1 + i][pos.Y + 1] = 空地;
	}
}
//坦克移動
void Tank::Move_Tank(DIR dir)
{
	//移動坦克之前檢查CD是否冷卻
	if (Check_End_Time())
	{
		//清理坦克
		Clear_Tank();
		//檢查方向是否一致
		if (this->dir != dir)
		{
			this->dir = dir;
			Show_Tank();
			return;
		}
		else
		{
			//檢查是否可以移動
			if (if_Move_Tank())
			{
				switch (dir)
				{
				case:pos.X--;
					break;
				case:pos.X++;
					break;
				case:pos.Y--;
					break;
				case:pos.Y++;
					break;
				default:
					break;
				}
			}
		}
		Show_Tank();
	}
}
//坦克移動判斷
bool Tank::if_Move_Tank()
{
	if (dir ==)
	{
		return Collide_Check({ pos.X - 2,pos.Y - 1 }) && Collide_Check({ pos.X - 2,pos.Y }) && Collide_Check({pos.X-2,pos.Y+1});
	}
	if (dir ==)
	{
		return Collide_Check({ pos.X + 2,pos.Y - 1 }) && Collide_Check({ pos.X + 2,pos.Y }) && Collide_Check({ pos.X + 2,pos.Y + 1 });
	}
	if (dir ==)
	{
		return Collide_Check({ pos.X -1,pos.Y - 2 }) && Collide_Check({ pos.X  ,pos.Y -2}) && Collide_Check({ pos.X + 1,pos.Y - 2 });
	}
	if (dir ==)
	{
		return Collide_Check({ pos.X + 1,pos.Y + 2 }) && Collide_Check({ pos.X,pos.Y + 2}) && Collide_Check({ pos.X - 1,pos.Y + 2 });
	}
	return false;
}
//輔助坦克移動判斷檢測
bool Tank::Collide_Check(COORD pos)
{
	if (Map::static_Map[pos.X][pos.Y] == 空地 && Map::dynamic[pos.X][pos.Y] != 坦克)
	{
		return true;
	}

	return false;
}
//CD檢測
bool Tank::Check_End_Time()
{
	if (clock() - end_time > this->CD)
	{
		end_time = clock();
		return true;
	}
	return false;
}
//坦克開火
void Tank::Play_Bullet(std::vector<Bullet*>& bull)
{
	/*if (pos.X == 2) { return; }*/
	Sleep(100);
	//播放發子彈音樂D:\Project\TEST_ONE\Music
	Bullet* bullet = new Bullet(this->pos,this-> dir,this->team);
	bull.push_back(bullet);
		//PlaySoundA("D:\\Project\\TEST_ONE\\Music\\boom.wav", NULL, SND_ASYNC | SND_FILENAME);
}

子彈類

#include "Bullet.h"
#include "Game.h"
#include <conio.h>
#pragma comment(lib,"winmm.lib")
//如果子彈遇到水流后loc=1,
int loc;
//子彈類構造函數
Bullet::Bullet(COORD pos,DIR dir,int team)
{
	//子彈坐標初始化
	this->pos = pos;
	//子彈方向初始化
	this->dir = dir;
	//子彈存活
	this->alive = true;

	//子彈陣營
	this->team = team;

	//檢查子彈賦值前的地方是否為邊框

		if (dir ==)
		{
			if (Map::static_Map[this->pos.X - 2][this->pos.Y] == 邊框)
			{

				alive = false;
			}
		}
		else if (dir ==)
		{
			if (Map::static_Map[this->pos.X + 2][this->pos.Y] == 邊框)
			{

				alive = false;
			}
		}
		else if (dir ==)
		{
			if (Map::static_Map[this->pos.X][this->pos.Y - 2] == 邊框)
			{

				alive = false;

			}
		}
		else if (dir ==)
		{
			if (Map::static_Map[this->pos.X][this->pos.Y + 2] == 邊框)
			{

				alive = false;
			}
		}
		if (alive == true)
		{
			if (Gps_Bullet_1())
			{
				switch (dir)
				{
				case:this->pos.X -= 2;
					break;
				case:this->pos.X += 2;
					break;
				case:this->pos.Y -= 2;
					break;
				case:this->pos.Y += 2;
					break;
				default:
					break;
				}
				//Show_bullet();
			}

		}
	
}
//子彈移動
void Bullet::Move()
{	//清理子彈
		Clear_Bullet();
		//檢測能否移動
		if (Gps_Bullet())
		{//如果經過水流
			if (loc >= 1)
			{
				for (int x = 0; x < 41; x++)
				{
					for (size_t i = 0; i < 41; i++)
					{
						if (Map::static_Map[x][i] == 水流)
						{
							SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | BACKGROUND_BLUE | FOREGROUND_BLUE | FOREGROUND_GREEN);
							Map::WriteChar(x, i, "~");
						}
					}
				}
				loc--;
			}
			switch (dir)
			{
			case:this->pos.X -= 1;
				break;
			case:this->pos.X += 1;
				break;
			case:this->pos.Y -= 1;
				break;
			case:this->pos.Y += 1;
				break;
			default:
				break;
			}
			Show_bullet();
		}
		else
		{
			alive = false;
		}
}
//子彈坐標設置
bool Bullet::Gps_Bullet_1()
{
	if (dir ==)
	{
		return check({ this->pos.X - 2,this->pos.Y });
	}
	if (dir ==)
	{
		return check({ this->pos.X + 2,this->pos.Y });
	}
	if (dir ==)
	{
		return check({ this->pos.X ,this->pos.Y - 2 });
	}
	if (dir ==)
	{
		return check({ this->pos.X ,this->pos.Y + 2 });
	}
	return false;
}
bool Bullet::Gps_Bullet()
{
	if (dir ==)
	{
		return check({ this->pos.X - 1,this->pos.Y });
	}
	if (dir ==)
	{
		return check({ this->pos.X + 1,this->pos.Y });
	}
	if (dir ==)
	{
		return check({ this->pos.X ,this->pos.Y - 1 });
	}
	if (dir ==)
	{
		return check({ this->pos.X ,this->pos.Y + 1 });
	}
	return false;
}
//碰撞檢測
bool Bullet::check(COORD pos)
{
	////播放發子彈音樂D:\Project\TEST_ONE\Music
	//PlaySoundA("D:\\Project\\TEST_ONE\\Music\\hit.wav", NULL, SND_ASYNC |SND_NODEFAULT);
	if (Map::static_Map[pos.X][pos.Y] == 老家)
	{
		SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_INTENSITY);
		Map::WriteChar(37, 19, "◢ ◣");
		Map::WriteChar(38, 19, " █ ");
		Map::WriteChar(39, 19, "◥ ◤");
		Sleep(1000);
		//清理地圖
		Map::Clear_Map();
		//改變標記
		this->Home = false;
		//將標記傳入輸贏檢測
		vin(this->Home);
		//輸出老家被毀
		Map::Clear_Map();
		Map::Colors(紅色);
		Map::WriteChar(20, 20, "老家被毀");
		Sleep(1000);
		return false;
	}
	if (Map::static_Map[pos.X][pos.Y] == 邊框)
	{
		return false;
	}
	if (Map::dynamic[pos.X][pos.Y] == 坦克)
	{	
		//由於判斷體較長,所以封裝陳函數
		Over_Tank({pos.X,pos.Y});
		//檢測輸入,看哪一方先死全
		vin();
		return false;
	}
	if (Map::dynamic[pos.X][pos.Y] == 子彈)
	{
		for (int x = 0; x < Game::bull.size(); x++)
		{
			if (Game::bull[x]->pos.X == pos.X && Game::bull[x]->pos.Y == pos.Y)
			{
				Game::bull[x]->Clear_Bullet();
				Game::bull[x]->alive = false;
			}
		}
		return false;
	}
	if (Map::static_Map[pos.X][pos.Y] == 空地 && Map::dynamic[pos.X][pos.Y] == 空地)
	{
		return true;
	}
	else if (Map::static_Map[pos.X][pos.Y] == 黃土牆)
	{
		Map::static_Map[pos.X][pos.Y] = 紅土牆;
		SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED | BACKGROUND_GREEN | BACKGROUND_RED);
		Map:: WriteChar(pos.X, pos.Y, "▓");
		return false;
	}
	else if (Map::static_Map[pos.X][pos.Y] == 水流)
	{
		loc = 2;
		return true;
	}
	else if (Map::static_Map[pos.X][pos.Y] == 紅土牆)
	{
		if (dir ==|| dir ==)
		{
			if (Map::static_Map[pos.X - 1][pos.Y] == 紅土牆)
			{
				Map::static_Map[pos.X - 1][pos.Y] = 空地;
				Map::WriteChar(pos.X - 1, pos.Y, " ");
			}
			if (Map::static_Map[pos.X + 1][pos.Y] == 紅土牆)
			{
				Map::static_Map[pos.X + 1][pos.Y] = 空地;
				Map::WriteChar(pos.X + 1, pos.Y, " ");
			}
			Map::static_Map[pos.X][pos.Y] = 空地;
			Map::WriteChar(pos.X, pos.Y, " ");
		}
		if (dir ==|| dir ==)
		{
			if (Map::static_Map[pos.X][pos.Y - 1] == 紅土牆)
			{
				Map::static_Map[pos.X][pos.Y - 1] = 空地;
				Map::WriteChar(pos.X, pos.Y - 1, " ");
			}
			if (Map::static_Map[pos.X][pos.Y + 1] == 紅土牆) {
				Map::static_Map[pos.X][pos.Y + 1] = 空地;
				Map::WriteChar(pos.X, pos.Y + 1, " ");
			}
			Map::static_Map[pos.X][pos.Y] = 空地;
			Map::WriteChar(pos.X, pos.Y, " ");
		}		
		return false;
	}
	return false;
}
//打印子彈
void Bullet::Show_bullet()
{
	Map::Colors(綠色);
	Map::WriteChar(pos.X, pos.Y, "⊙");
	Map::dynamic[pos.X][pos.Y] = 子彈;
}
//清理子彈
void Bullet::Clear_Bullet()
{
	Sleep(30);
	Map::WriteChar(pos.X,pos.Y," ");
	Map::dynamic[pos.X][pos.Y] = 空地;
}
//清理坦克(死亡)
void Bullet::Clear_Tank(COORD pos)
{
	for (int i = 0; i < 3; i++)
	{
		Map::WriteChar(pos.X - 1 + i, pos.Y - 1, " ");
		Map::WriteChar(pos.X - 1 + i, pos.Y , " ");
		Map::WriteChar(pos.X - 1 + i, pos.Y + 1, " ");

		Map::dynamic[pos.X - 1 + i][pos.Y - 1] = 空地;
		Map::dynamic[pos.X - 1 + i][pos.Y] = 空地;
		Map::dynamic[pos.X - 1 + i][pos.Y + 1] = 空地;
	}
}
//坦克得分
void Bullet::Show_Score(int n1,int n2)
{
	if (n1 == 0 && n1 ==0)
	{
		if (team == 1)
		{
			Game::user1->score += 100;
			Map::WriteInt(7, 52, Game::user1->score);
		}
		if (team == 2)
		{
			Game::user2->score += 100;
			Map::WriteInt(10, 52, Game::user2->score);
		}
	}
	if(n1 != 0||n2 !=0)
	{
		system("cls");
		if (Game::play == 1)
		{		
			Map::WriteChar(20, 22, "1P 總得分:");
			Map::WriteInt(20, 28, n1);
			system("pause");
		}
		if (Game::play==2)
		{
			Map::WriteChar(20,22,"1P 總得分:");
			Map::WriteChar(22, 22, "2P 總得分:");
			Map::WriteInt(20, 28, n1);
			Map::WriteInt(22, 28,n2);
			system("pause");
		}
	}
}
//剩余坦克復活次數
void Bullet::Show_Revive()
{
	if (Game::play == 1)
	{
		Map::WriteInt(8, 52, Game::Revive_User1);
	}
	else if (Game::play == 2)
	{
		Map::WriteInt(8, 52, Game::Revive_User1);
		Map::WriteInt(11, 52, Game::Revive_User2);
	}
}
//坦克死亡
bool Bullet::Over_Tank(COORD pos)
{	
	//判斷子彈碰到的坦克是AI1,AI2,AI3,user1,user2
	for (int i = 0; i < 3; i++)
	{
		//判斷克能AI剩余數為0,對象是否被銷毀
		if (Game::AI1 != nullptr)
		{
			if (//如果是AI1
				pos.X == Game::AI1->pos.X - 1 + i && pos.Y == Game::AI1->pos.Y - 1 ||
				pos.X == Game::AI1->pos.X - 1 + i && pos.Y == Game::AI1->pos.Y ||
				pos.X == Game::AI1->pos.X - 1 + i && pos.Y == Game::AI1->pos.Y + 1
				)
			{		//判斷擊中AI1的子彈是不是同一個陣營
				if (team == Game::AI1->team)
				{//如果是,則直接返回
					return false;
				}
				else
				{//如果不是就在屏幕上擦除
					Clear_Tank({ Game::AI1->pos.X, Game::AI1->pos.Y });

					//讓AI1回到起始位置
					if (Game::AI_Tank_Num > 0)
					{
						Show_Score();
						Game::AI1->mode = rand() % 4 + 2;
						Game::AI1->pos = { 2,2 };
						Game::AI_Tank_Num--;
						Map::WriteChar(5, 51, " ");
						Map::WriteInt(5, 52, Game::AI_Tank_Num);
					}
					else
					{
						Show_Score();
						delete Game::AI1;
						Game::AI1 = nullptr;
					}
				}
			}
		}
		//判斷克能AI剩余數為0,對象是否被銷毀
		if (Game::AI2 != nullptr)
		{
			if (
				pos.X == Game::AI2->pos.X - 1 + i && pos.Y == Game::AI2->pos.Y - 1 ||
				pos.X == Game::AI2->pos.X - 1 + i && pos.Y == Game::AI2->pos.Y ||
				pos.X == Game::AI2->pos.X - 1 + i && pos.Y == Game::AI2->pos.Y + 1
				)
			{
				if (team == Game::AI2->team)
				{
					return false;
				}
				else
				{
					Clear_Tank({ Game::AI2->pos.X, Game::AI2->pos.Y });

					if (Game::AI_Tank_Num > 0)
					{
						Show_Score();
						Game::AI2->mode = rand() % 4 + 2;
						Game::AI2->pos.X = 2;
						Game::AI2->pos.Y = 20;
						Game::AI_Tank_Num--;
						Map::WriteChar(5, 52, " ");
						Map::WriteInt(5, 52, Game::AI_Tank_Num);
					}
					else
					{
						Show_Score();
						delete Game::AI2;
						Game::AI2 = nullptr;
					}
				}
			}
		}
		//判斷克能AI剩余數為0,對象是否被銷毀
		if (Game::AI3 != nullptr)
		{
			if (
				pos.X == Game::AI3->pos.X - 1 + i && pos.Y == Game::AI3->pos.Y - 1 ||
				pos.X == Game::AI3->pos.X - 1 + i && pos.Y == Game::AI3->pos.Y ||
				pos.X == Game::AI3->pos.X - 1 + i && pos.Y == Game::AI3->pos.Y + 1
				)
			{
				if (team == Game::AI3->team)
				{
					return false;
				}
				else
				{
					Clear_Tank({ Game::AI3->pos.X, Game::AI3->pos.Y });

					if (Game::AI_Tank_Num > 0)
					{
						Show_Score();
						Game::AI2->mode = rand() % 4 + 2;
						Game::AI3->pos.X = 2;
						Game::AI3->pos.Y = 38;
						Game::AI_Tank_Num--;
						Map::WriteChar(5, 52, " ");
						Map::WriteInt(50, 52, Game::AI_Tank_Num);
					}
					else
					{
						Show_Score();
						delete Game::AI3;
						Game::AI3 = nullptr;
					}
				}
			}
		}
		if (Game::user1 != nullptr)
		{
			if (//如果是user1
				pos.X == Game::user1->pos.X - 1 + i && pos.Y == Game::user1->pos.Y - 1 ||
				pos.X == Game::user1->pos.X - 1 + i && pos.Y == Game::user1->pos.Y ||
				pos.X == Game::user1->pos.X - 1 + i && pos.Y == Game::user1->pos.Y + 1
				)
			{		//判斷擊中AI1的子彈是不是同一個陣營
				if (team == Game::user1->team)
				{//如果是,則直接返回
					return false;
				}
				else
				{//如果是就在屏幕上擦除
					Clear_Tank({ Game::user1->pos.X, Game::user1->pos.Y });
					if (Game::Revive_User1 == 0)
					{
						//Show_Score(Game::user1->score);
						delete Game::user1;
						Game::user1 = nullptr;
					}
					else
					{
						Show_Revive();
						//玩家1復活次數減1
						Game::Revive_User1--;
						Show_Revive();
						//讓user1回到起始位置
						Game::user1->pos = { 38,14 };
						for (int i = 0; i < 3; i++)
						{
							Map::Colors(紫色);
							Map::WriteChar(37 + i, 13, Map::tank_user1[i]);
						}
					}

				}

		}
}
		if (Game::play == 2)
		{
			if (Game::user2 != nullptr)
			{
				if (//如果是user2
					pos.X == Game::user2->pos.X - 1 + i && pos.Y == Game::user2->pos.Y - 1 ||
					pos.X == Game::user2->pos.X - 1 + i && pos.Y == Game::user2->pos.Y ||
					pos.X == Game::user2->pos.X - 1 + i && pos.Y == Game::user2->pos.Y + 1
					)
				{		//判斷擊中user2的子彈是不是同一個陣營
					//由於可能出現玩家死亡,所以不能使用空指針,直接使用值1
					if (team == Game::user2->team || team==1)
					{//如果是,則直接返回
						return false;
					}
					else
					{
						//如果是就在屏幕上擦除
						Clear_Tank({ Game::user2->pos.X, Game::user2->pos.Y });
						if (Game::Revive_User2 == 0)
						{
							delete Game::user2;
							Game::user2 = nullptr;
						}
						else
						{
							//玩家2復活次數減1
							Game::Revive_User2--;
							Show_Revive();
							//讓user2回到起始位置
							Game::user2->pos = { 38,26 };
							for (int i = 0; i < 3; i++)
							{
								Map::Colors(紫色);
								Map::WriteChar(37 + i, 25, Map::tank_user2[i]);
							}
						}
					}
				}
			}			
		}
	}
	
}
//檢測輸贏
void Bullet::vin(bool Home)
{
	if (Game::AI1 == nullptr && Game::AI2 == nullptr && Game::AI3 == nullptr)
	{
		Map::Clear_Map();
		//說明全部通關
		if (Map::Level == 8)
		{
			Map::WriteChar(20, 15, "恭喜,全部通關\n");
			Sleep(3000);
		}
		else
		{
			Map::WriteChar(20, 15, "玩家勝利,即將進入下一關卡\n");
			Map::dynamic[41][41] = { 0 };
			Game::Level_Loc = true;
			if (Game::play == 1)
			{
				Clear_Tank({ Game::user1->pos.X, Game::user1->pos.Y });
			}
			else
			{
				Clear_Tank({ Game::user1->pos.X, Game::user1->pos.Y });
				Clear_Tank({ Game::user2->pos.X, Game::user2->pos.Y });
			}
			Sleep(1500);
		}
		
	}
	if (Game::play == 2)
	{			//如果都等於空,說明玩家死亡,游戲結束 
		if (Game::user1 == nullptr && Game::user2 == nullptr|| Home==false)
		{
			//所有數據清空,並返回主菜單
			//需要重新進入歡迎界面標記
			Game::Over = true;
			//如果有AI沒死,我們就讓他死掉重新初始化
			if (Game::AI1 != nullptr)
			{
				delete Game::AI1;
				Game::AI1 = nullptr;
			}
			if (Game::AI2 != nullptr)
			{
				delete Game::AI2;
				Game::AI2 = nullptr;
			}
			if (Game::AI3 != nullptr)
			{
				delete Game::AI3;
				Game::AI3 = nullptr;
			}
			//把動態地圖清空
			for (int x = 0; x < 41; x++)
			{
				for (int i = 0; i < 41; i++)
				{
					Map::dynamic[x][i] = 0;
				}
			}
		}
	}
	else if (Game::play == 1)
	{
		if (Game::user1 == nullptr || Home == false)
		{
			//所有數據清空,並返回主菜單
			Game::Over = true;
			if (Game::AI1 != nullptr)
			{
				delete Game::AI1;
				Game::AI1 = nullptr;
			}
			if (Game::AI2 != nullptr)
			{
				delete Game::AI2;
				Game::AI2 = nullptr;
			}
			if (Game::AI3 != nullptr)
			{
				delete Game::AI3;
				Game::AI3 = nullptr;
			}
			for (int x = 0; x < 41; x++)
			{
				for (int i = 0; i < 41; i++)
				{
					Map::dynamic[x][i] = 0;
				}
			}
		}
	}
}

地圖類(略長)

#include "Map.h"
#include "Game.h"
int Map::static_Map[HIGHT][HIGHT] = {};
int Map::dynamic[HIGHT][WIDTH] = {};
char Map::Type;
//關卡地圖初始化
int Map::Level = 1;
//用於副屏幕模型顯示
const char* Map::tank_user1[3] =
{
     { "█┃ █"},
     { "█●█"},
     { "█┻ █"}
};
const char* Map::tank_user2[3]{
    {"◢┃ ◣" },
    {"┣ ●┫"},
    {"◥━ ◤" }
};
void Map::Init_Map()
{
    int i, j;
    int Map[9][41][41] =
    {
         {//鋼牆白色■值為6,,土牆黃色▓值為2 ,土牆紅▓值為1,海藍色~值為5 ,普通白(老家)值為9
    {4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4},
    {4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4},
    {4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4},
    {4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4},
    {4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4},
    {4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4},
    {4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4},
    {4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4},
    {4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4},
    {4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,0,0,0,0,0,0,0,4},
    {4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4},
    {4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4},
    {4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4},
    {4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,9,9,9,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4},
    {4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,9,9,9,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4},
    {4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,9,9,9,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4},
    {4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4}
    },
    {//鋼牆白色■值為6,,土牆黃色▓值為2 ,土牆紅▓值為1,海藍色~值為5 ,普通白(老家)值為9
    {4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4},
    {4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4},
    {4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4},
    {4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4},
    {4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,5,5,5,5,5,0,0,0,4},
    {4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,5,5,5,5,0,0,0,0,0,0,5,5,5,5,5,5,0,0,0,4},
    {4,0,0,0,0,0,0,0,0,0,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,5,5,5,5,0,0,0,4},
    {4,0,0,0,0,0,0,0,0,0,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,5,5,5,5,0,0,0,4},
    {4,0,0,0,0,0,0,0,0,0,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,5,5,5,5,0,0,0,4},
    {4,0,0,0,0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4},
    {4,0,0,0,0,0,0,1,1,1,0,0,0,1,1,1,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4},
    {4,0,0,0,0,0,0,1,1,1,0,0,0,1,1,1,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4},
    {4,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,9,9,9,1,1,0,0,0,0,0,0,0,1,1,1,6,6,6,0,0,0,4},
    {4,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,9,9,9,1,1,0,0,0,0,0,0,0,1,1,1,6,6,6,0,0,0,4},
    {4,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,9,9,9,1,1,0,0,0,0,0,0,0,1,1,1,6,6,6,0,0,0,4},
    {4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4}
    },
    };
 
    for (i = 0; i < HIGHT; i++)
    {
        for (j = 0; j < WIDTH; j++)
        {
            static_Map[i][j] = Map[Level][i][j];


            //初始化邊框
            if (static_Map[i][j] == 邊框)
            {
                SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_GREEN| FOREGROUND_RED | FOREGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_BLUE);
                WriteChar(i, j, "■");
            }
            Colors(綠色);
            if (static_Map[i][j] == 黃土牆)//被擊中變成紅土牆
            {
                SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_RED | BACKGROUND_GREEN | BACKGROUND_RED);
                WriteChar(i, j, "▓");
            }
            if (static_Map[i][j] == 紅土牆)
            {
                SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED | BACKGROUND_GREEN | BACKGROUND_RED);
                WriteChar(i, j, "▓");
            }
            if (static_Map[i][j] == 水流)
            {
                SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | BACKGROUND_BLUE | FOREGROUND_BLUE | FOREGROUND_GREEN);
                WriteChar(i, j, "~");
            }
            if (static_Map[i][j] == 鋼牆)
            {
                SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_GREEN| FOREGROUND_RED | FOREGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_BLUE);
                WriteChar(i, j, "■");
            }
            if (static_Map[i][j] == 老家)
            {
                SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_BLUE | FOREGROUND_RED | FOREGROUND_GREEN);
                WriteChar(37,19,"◣★◢");
                WriteChar(38, 19, "███");
                WriteChar(39, 19, "◢█◣");

            }
            Colors(黑色);
        }
    }
}
//在屏幕輸出字符
void Map::WriteChar(short x, short y, const char* chr)
{
	//獲取屏幕輸出句柄
	HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
	//獲取輸出坐標
	SetConsoleCursorPosition(hOut, { y * 2  , x } );
	
	//輸出相應的字符
	printf(chr);
}
//在屏幕輸出變量
void Map::WriteInt(short x, short y, int i)
{
    //獲取屏幕輸出句柄
    HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
    //獲取輸出坐標
    SetConsoleCursorPosition(hOut, { y * 2  , x });

    //輸出相應的字符
    printf("%d",i);
}
//顏色選擇函數
void Map::Colors(int color)  
{
    switch (color)
    {
    case 1:               //天藍色(我的坦克顏色)
        SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_BLUE);
        break;
    case 2:               //綠色
        SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_GREEN);

        break;
    case 3:               //黃色
        SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN);
        break;
    case 4:               //紅色
        SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED);
        break;
    case 5:               //紫色
        SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_BLUE);
        break;
    case 6:               //白色
        SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN);
        break;
    case 7:               //深藍色(∵顏色深難與黑色背景辨識度不高 ∴坦克顏色不選用此顏色),只用在字體顏色閃爍中
        SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_BLUE);
        break;
    }
}
//副屏幕顯示信息
void Map::Init_Info()
{
    Colors(白色);
    //關卡
    WriteChar(2, 46, " ◣");
    WriteChar(3,44,"關卡 |");
    if(Level !=0)
    WriteInt(3,50,Level);
    else{WriteChar(3, 50, "自定義地圖 "); }
    WriteChar(5, 44, "剩余敵方坦克: ");  
    WriteInt(5,52,Game::AI_Tank_Num);
    if (Game::play == 1)
    {
        WriteChar(7,44,"1P PLAY 得分: 0");
        WriteChar(8,44,"生命數: ");
        WriteInt(8, 52, Game::Revive_User1);
        WriteChar(26, 44, "模式:單人模式");
        WriteChar(28, 44, "1P PLAY");
        WriteChar(30, 44, "游戲鍵位");
        WriteChar(33, 46, "W");
        WriteChar(34, 44, "A S D J");
    }
    else
    {
        WriteChar(7, 44, "1P PLAY 得分: 0");
        WriteChar(10, 44, "2P PLAY 得分: 0");
        WriteChar(8, 44, "生命數:");
        WriteInt(8, 52, Game::Revive_User1);
        WriteChar(11, 44, "生命數:");
        WriteInt(11, 52, Game::Revive_User2);
        WriteChar(25, 44, "游戲鍵位");
        WriteChar(23, 44, "模式:雙人模式");
        WriteChar(27, 44, "1P PLAY");
        WriteChar(30, 46, "W");
        WriteChar(31, 44, "A S D J");
        WriteChar(33, 44, "2P PLAY");
        WriteChar(36, 45, " ↑");
        WriteChar(37, 43, "← ↓ → Insert");
    }
    for (int i = 0; i < 3; i++)
    {
        Colors(紫色);
        if (Game::play == 1)
            WriteChar(28 + i, 50, tank_user1[i]);
        else if (Game::play == 2)
        {
            WriteChar( 27+ i, 50, tank_user1[i]);
            WriteChar(33 + i, 50, tank_user2[i]);
        }
    }
    WriteChar(17, 44, "正在游戲中。。。");
    WriteChar(19, 44, "SPACE空格暫停");
}
//選擇坦克模型與顏色
void Map::print_Tank_Mode()
{
    for (int i = 0; i < 3; i++)
    {
        
        Colors(紫色);
        if (Game::play == 1)
            WriteChar(37 + i, 13, tank_user1[i]);
        else if (Game::play == 2)
        {
            WriteChar(37 + i, 13, tank_user1[i]);
            WriteChar(37 + i, 25, tank_user2[i]);
        }
    }
}
//自己寫一個清理主地圖函數
void Map::Clear_Map()
{
    for (int x=1;x<41;x++)
    {
        for (int i = 0; i < 41; i++)
        {
            WriteChar(x,i," ");
        }
    }
    
}
//打印副屏幕框架
void Map::fu_map()
{
    SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_GREEN
        | FOREGROUND_RED | FOREGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_BLUE);
    
    WriteChar(0,42,"■■■■■■■■■■■■■");
    WriteChar(13, 42, "■■■■■■■■■■■■■");
    WriteChar(21, 42, "■■■■■■■■■■■■■");
    WriteChar(40, 42, "■■■■■■■■■■■■■");
    for (int x=0;x<41;x++)
    {
        WriteChar( x,41, "■");
        WriteChar( x,55, "■");
    }
}
//自定義地圖信息顯示
void Map::Show_Diy_Info()
{
    Colors(白色);
    WriteChar(2, 47, "紅土牆");
    WriteChar(8, 47, "黃土牆");
    WriteChar(14, 47, "鋼牆");
    WriteChar(20, 47, "水流");
    WriteChar(26, 46, "空地/刪除");
    WriteChar(34, 44, "保存地圖並開始游戲");
    SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED | BACKGROUND_GREEN | BACKGROUND_RED);
    WriteChar(3,44,"▓▓▓▓▓▓▓▓▓");
    WriteChar(4, 44, "▓▓▓▓▓▓▓▓▓");
    WriteChar(5, 44, "▓▓▓▓▓▓▓▓▓");
    SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_RED | BACKGROUND_GREEN | BACKGROUND_RED);
    WriteChar(9, 44, "▓▓▓▓▓▓▓▓▓");
    WriteChar(10, 44, "▓▓▓▓▓▓▓▓▓");
    WriteChar(11, 44, "▓▓▓▓▓▓▓▓▓");
    SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_GREEN
        | FOREGROUND_RED | FOREGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_BLUE);
    WriteChar(15, 44, "■■■■■■■■■");
    WriteChar(16, 44, "■■■■■■■■■");
    WriteChar(17, 44, "■■■■■■■■■");
    SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | BACKGROUND_BLUE | FOREGROUND_BLUE | FOREGROUND_GREEN);
    WriteChar(21, 44, "~~~~~~~~~");
    WriteChar(22, 44, "~~~~~~~~~");
    WriteChar(23, 44, "~~~~~~~~~");

    Colors(綠色);
    WriteChar(27, 44, "------------------");
    WriteChar(28, 44, "| |");
    WriteChar(29, 44, "| |");
    WriteChar(30, 44, "------------------");
    
    WriteChar(39, 44, "注意:‘右擊模塊選擇’");
    WriteChar(40, 44, " ‘左擊釋放’");
    Colors(白色);
    WriteChar(35, 44, "■■■■■■■■■");
    WriteChar(36, 44, "■■■■■■■■■");
    WriteChar(37, 44, "■■■■■■■■■");
}

游戲控制類Game(巨長)

#include "Game.h"
std::vector<Bullet*>Game::bull;

Tank* Game::user1;
Tank* Game::user2;
Tank* Game::AI1;
Tank* Game::AI2;
Tank* Game::AI3;
//用於區別單人模式和雙人模式做一個記號,值為1代表單人,2為雙人
int Game::play;
//是否進入下一關卡
bool Game::Level_Loc=false;
//剩余敵方坦克數量,總值為20,因首次初始化敵方坦克數量3
int  Game::AI_Tank_Num=0;
//玩家剩余復活次數2次
int Game::Revive_User1=2;
int Game::Revive_User2=2;
//游戲結束標記
bool Game::Over=false;
//結束鼠標接收標記
bool Game::end = true;
//檢測輸入,AI隨機
void Game::Input()
{
/*---------------------------------------------------------------------*/
	////100分之30的幾率改變,不能太頻繁,否則AI跟瘋了是的,也會造成負荷
	
		if (AI1 != nullptr)
		{
			//4/10幾率改變
			AI1->dir = (DIR)(rand() % 7);
			switch (AI1->dir)
			{
			case 0:AI1->Move_Tank(); break;
			case 1:case 4:case 5:case 6:AI1->Move_Tank(); break;
			case 2:AI1->Move_Tank(); break;
			case 3:AI1->Move_Tank(); break;
			default:
				break;
			}
			//地方坦克開火有20分之1的幾率開炮,測試了幾次開炮不能過於頻繁
			if (AI1->frie = rand() % 25 == 1)
			{
				AI1->Play_Bullet(bull);
			}
		}	

		if (AI2 != nullptr)
		{
			AI2->dir = (DIR)(rand() % 7);
			switch (AI2->dir)
			{
			case 0:AI2->Move_Tank(); break;
			case 1:case 4:case 5:case 6:AI2->Move_Tank(); break;//增大向下走的概率
			case 2:AI2->Move_Tank(); break;
			case 3:AI2->Move_Tank(); break;
			default:
				break;
			}
			if (AI2->frie = rand() % 25 == 1)
			{
				AI2->Play_Bullet(bull);
			}
		}
		
		if (AI3 != nullptr)
		{
			AI3->dir = (DIR)(rand() % 7);
			switch (AI3->dir)
			{
			case 0:AI3->Move_Tank(); break;
			case 1:case 4:case 5:case 6:AI3->Move_Tank(); break;
			case 2:AI3->Move_Tank(); break;
			case 3:AI3->Move_Tank(); break;
			default:
				break;
			}
			if (AI3->frie = rand() % 25 == 1)
			{
				AI3->Play_Bullet(bull);
			}
		}	

	if (play == 1)
	{
		if (user1 != nullptr)
		{
			if (GetAsyncKeyState('W') & 0x8001)
				user1->Move_Tank();
			if (GetAsyncKeyState('S') & 0x8001)
				user1->Move_Tank();
			if (GetAsyncKeyState('A') & 0x8001)
				user1->Move_Tank();
			if (GetAsyncKeyState('D') & 0x8001)
				user1->Move_Tank();
			if (GetAsyncKeyState('J') & 0x8001)
				user1->Play_Bullet(bull);
			if (GetAsyncKeyState(VK_SPACE) & 0x8000)
				Game_Stop();

		}
	}

	else if(play==2)
	{
		if (user1 != nullptr)
		{ 
			if (GetAsyncKeyState('W') & 0x8001)
				user1->Move_Tank();
			if (GetAsyncKeyState('S') & 0x8001)
				user1->Move_Tank();
			if (GetAsyncKeyState('A') & 0x8001)
				user1->Move_Tank();
			if (GetAsyncKeyState('D') & 0x8001)
				user1->Move_Tank();
			if (GetAsyncKeyState('J') & 0x8001)
				user1->Play_Bullet(bull);
			if (GetAsyncKeyState(VK_SPACE) & 0x8001)
				Game_Stop();
		}
			
		if (user2 != nullptr)
		{
			if (GetAsyncKeyState(VK_UP) & 0x8001)
				user2->Move_Tank();
			if (GetAsyncKeyState(VK_DOWN) & 0x8001)
				user2->Move_Tank();
			if (GetAsyncKeyState(VK_LEFT) & 0x8001)
				user2->Move_Tank();
			if (GetAsyncKeyState(VK_RIGHT) & 0x8001)
				user2->Move_Tank();
			if (GetAsyncKeyState(VK_INSERT) & 0x8001)
				user2->Play_Bullet(bull);
		}			
	}
}
//調用子彈移動,且存儲子彈和刪除
void Game::Move_Bullet()
{
	for (unsigned int i = 0; i < bull.size(); i++)
	{
		if (bull[i]->alive == true)
		{
			bull[i]->Move();		
		}
		else
		{
			bull.erase(bull.begin()+i);
			i--;
		}
	}
}
//菜單輸出控制
void Game::Input_Menu()
{
	for (int i = 0; i < 6; i++)
	{
		menu.Coord[i].Y = 24;
	}
	menu.Coord[0].X = 23;
	menu.Coord[1].X = 25;
	menu.Coord[2].X=  27;
	menu.Coord[3].X = 29;
	menu.Coord[4].X = 31;
	menu.Coord[5].X = 33;
	menu.Show_Menu();
	for (int i = 0; i < 6; i++)
	{
		Map::WriteChar(menu.Coord[i].X, menu.Coord[i].Y, menu.mu[i]);
	}
	Map::Colors(綠色);
	Map::WriteChar( menu.Coord[1].X,menu.Coord[1].Y, menu.mu[1]);
	int Select = 1;
	while (1)
	{
		if (GetAsyncKeyState('W') & 0x8001)
		{
			Map::Colors(白色);
			Map::WriteChar( menu.Coord[Select].X,menu.Coord[Select].Y, menu.mu[Select]);
			if (Select == 1)
				Select = 5;
			else
			{
				Select--;////播放發子彈音樂D:\Project\TEST_ONE\Music
				PlaySoundA("D:\\Project\\TEST_ONE\\Music\\hit.wav", NULL, SND_ASYNC | SND_NODEFAULT);
			}	
			Map::Colors(綠色);
			Map::WriteChar(menu.Coord[Select].X,  menu.Coord[Select].Y,menu.mu[Select]);
		}
		else if (GetAsyncKeyState('S') & 0x8001)
		{
			Map::Colors(白色);
			Map::WriteChar(menu.Coord[Select].X, menu.Coord[Select].Y, menu.mu[Select]);
			if (Select == 5)
				Select = 1;
			else
			{
				Select++;////播放發子彈音樂D:\Project\TEST_ONE\Music
				PlaySoundA("D:\\Project\\TEST_ONE\\Music\\hit.wav", NULL, SND_ASYNC | SND_NODEFAULT);
			}
			Map::Colors(綠色);
			Map::WriteChar( menu.Coord[Select].X,menu.Coord[Select].Y, menu.mu[Select]);
		}
		else if (GetAsyncKeyState(0xD) & 0x8001)//回車鍵
		{
			
			switch (Select)
			{
			case 1:start_user1(); break;
			case 2:start_user2(); break;
			case 3:Load_Game(); break;
			case 4:Diy_Map(); break;
			case 5:exit(0); break;
			default:
				break;
			}
		}
		Sleep(200);
	}
}
//隱藏光標
void Game::HIdeCur()
{
	CONSOLE_CURSOR_INFO cci;
	cci.bVisible = false;
	cci.dwSize = 1;
	SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE),&cci);
}
//下一關初始化
void Game::Pass()
{
	Sleep(1000);
	//清理地圖
	Map::Clear_Map();
	////播放發子彈音樂D:\Project\TEST_ONE\Music
	PlaySoundA("D:\\Project\\TEST_ONE\\Music\\background.wav", NULL, SND_ASYNC | SND_NODEFAULT);
	//關閉進入下一關標記
	Level_Loc = false;
	//地圖升級
	Map::Level ++;
	//在副屏幕打印關卡等級
	Map::WriteInt(3, 50, Map::Level);
	//初始化剩余坦克數量
	AI_Tank_Num = 17;
	//顯示剩余坦克數量
	Map::WriteInt(5, 52, AI_Tank_Num);
	//創建敵方坦克
	AI1 = new Tank({ 2,2 },, rand() % 4 + 2, 3);
	AI2 = new Tank({ 2,20 },, rand() % 4 + 2, 3);
	AI3 = new Tank({ 2,38 },, rand() % 4 + 2, 3);
	//如果當前為單人模式
	if(play==1)
	user1->pos = { 38,14 };
	else//否則雙人模式
	{
		user1->pos = { 38,14 };
		user2->pos = { 38,26 };
	}
	Map::print_Tank_Mode();//打印坦克
	Map::Init_Map();//初始化地圖
}

//游戲暫停
void Game::Game_Stop()
{
	while (true)
	{
//打印位置11-23之間,我們還需要一個框架所以最少前后空出1
		Map::Colors(白色);
		Map::WriteChar(16,44,"游戲暫停中。。。");
		Map::WriteChar(17, 44, "輸入BACK繼續游戲");
		Map::WriteChar(18, 44, "輸入Esc返回菜單");
		Map::WriteChar(19, 44, "回車保存並退出");
		//Map::WriteChar(20, 44, "SPACE關閉游戲");
		if (GetAsyncKeyState(VK_BACK) & 0x8001)//空格VK_BACK 
		{
			Map::WriteChar(16,44,"正在游戲中。。。");
			Map::WriteChar(17, 44, " ");
			Map::WriteChar(18, 44, " ");
			Map::WriteChar(19, 44, "SPACE空格暫停");
		// Map::WriteChar(20, 44, " ");
			break;
		}
		else if(GetAsyncKeyState(VK_RETURN) & 0x8001)//VK_SPACE
		{
			SaveInfo();
			Init_Null();
			Sleep(1000);
			main();
		}
		else if(GetAsyncKeyState(0x1B) & 0x8001)//esc鍵
		{
			Init_Null();
			main();
		}
		//else if (GetAsyncKeyState(VK_SPACE) & 0x8001)//空格鍵
		//{
		// exit(0);
		// Sleep(200);
		//}
	}
}
//當游戲結束,所有值清空
void Game::Init_Null()
{
	if (Game::play == 2)
	{		
		if (Game::user1 != nullptr)
		{
			delete Game::user1;
			Game::user1 = nullptr;
		}
		if (Game::user2 != nullptr)
		{
			delete Game::user2;
			Game::user2 = nullptr;
		}
		if (Game::AI3 != nullptr)
		{
			delete Game::AI3;
			Game::AI3 = nullptr;
		}
		if (Game::AI2 != nullptr)
		{
			delete Game::AI2;
			Game::AI2 = nullptr;
		}
		if (Game::AI3 != nullptr)
		{
			delete Game::AI3;
			Game::AI3 = nullptr;
		}
		//把動態地圖清空
		for (int x = 0; x < 41; x++)
		{
			for (int i = 0; i < 41; i++)
			{
				Map::dynamic[x][i] = 0;
			}
		}
		//關卡置0
		Map::Level = 1;
		//敵方坦克復活
		AI_Tank_Num = 17;
		Revive_User1 = 2;
		Revive_User2 = 2;
	}
	else if (Game::play == 1)
	{	
		if (Game::user1 != nullptr)
		{
			delete Game::user1;
			Game::user1 = nullptr;
		}
		if (Game::AI3 != nullptr)
		{
			delete Game::AI3;
			Game::AI3 = nullptr;
		}
		if (Game::AI2 != nullptr)
		{
			delete Game::AI2;
			Game::AI2 = nullptr;
		}
		if (Game::AI3 != nullptr)
		{
			delete Game::AI3;
			Game::AI3 = nullptr;
		}
		for (int x = 0; x < 41; x++)
		{
			for (int i = 0; i < 41; i++)
			{
				Map::dynamic[x][i] = 0;
			}
		}
		//關卡置0
		Map::Level = 1;
		//敵方坦克復活
		AI_Tank_Num = 17;
		Revive_User1 = 2;
	}
}
//鼠標事件
void Game::Mouse(MOUSE_EVENT_RECORD event, std::vector<COORD>& pos)
{
	//鼠標事件類型
	switch (event.dwEventFlags)
	{
	case 0:
		//如果按鍵的類型為左鍵被按下
		if (event.dwButtonState == FROM_LEFT_1ST_BUTTON_PRESSED)
		{
			COORD temp = {event.dwMousePosition.X/2,event.dwMousePosition.Y };
			pos.push_back(temp);
			Map::WriteChar( temp.Y, temp.X, "■");
		}
		break;
	case DOUBLE_CLICK:
	default:
		break;
	}
}
//自定義地圖,接受鼠標事件
void Game::DIY_Map(//std::vector<COORD>& pos
)
{
	system("cls");
	//進入自定義地圖的模式
	//打印地圖邊框及說明
	Map::Level = 0;
	Map::Init_Map();
	Map::Show_Diy_Info();
	int type_mode=0;
	//接收用戶自定義事件
	INPUT_RECORD in = {};//定義事件結構體
	DWORD read = 0;//存儲讀取記錄
	COORD pos = {};//存儲鼠標位置
	MOUSE_EVENT_RECORD mer;//鼠標事件
	HANDLE hOut = GetStdHandle(STD_INPUT_HANDLE);
	SetConsoleMode(hOut,ENABLE_MOUSE_INPUT|ENABLE_WINDOW_INPUT);
	while (end)
	{
		//等待事件
		ReadConsoleInput(hOut, &in, 1, &read);		
			//如果是鼠標事件
		if (in.EventType == MOUSE_EVENT)
		{
			//Mouse(in.Event.MouseEvent,pos);
			mer = in.Event.MouseEvent;
			//鼠標左單擊
			if (mer.dwButtonState == FROM_LEFT_1ST_BUTTON_PRESSED)
			{
				if (mer.dwMousePosition.X >= 2 && mer.dwMousePosition.X <= 78 && mer.dwMousePosition.Y >= 1 && mer.dwMousePosition.Y <= 39)
				{
					switch (type_mode)
					{
					case 紅土牆:
						SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED | BACKGROUND_GREEN | BACKGROUND_RED);
						Map::WriteChar(mer.dwMousePosition.Y, mer.dwMousePosition.X / 2, "▓"); break;
					case 黃土牆:
						SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_RED | BACKGROUND_GREEN | BACKGROUND_RED);
						Map::WriteChar(mer.dwMousePosition.Y, mer.dwMousePosition.X / 2, "▓"); break;
					case 鋼牆:
						SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_GREEN
							| FOREGROUND_RED | FOREGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_BLUE);
						Map::WriteChar(mer.dwMousePosition.Y, mer.dwMousePosition.X / 2, "■"); break;
					case 空地:
						Map::Colors(白色);
						Map::WriteChar(mer.dwMousePosition.Y, mer.dwMousePosition.X / 2, " "); break;
					case 水流:
						SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | BACKGROUND_BLUE | FOREGROUND_BLUE | FOREGROUND_GREEN);
						Map::WriteChar(mer.dwMousePosition.Y, mer.dwMousePosition.X / 2, "~"); break;
					default:
						break;
					}
					Map::static_Map[mer.dwMousePosition.Y][mer.dwMousePosition.X / 2] = type_mode;
					for (int x = 0; x < 41; x++)
					{
						for (int i = 0; i < 41; i++)
						{
							tool::Init_Map[x][i] = Map::static_Map[x][i];
						}
					}
				}
			}
			//鼠標右擊
			else if (mer.dwButtonState == RIGHTMOST_BUTTON_PRESSED)
			{
				if (mer.dwMousePosition.X >= 44*2&& mer.dwMousePosition.X <= 51 * 2, mer.dwMousePosition.Y >= 3&& mer.dwMousePosition.Y <= 5)
				{
					
					type_mode = 紅土牆;
				}
				else if( mer.dwMousePosition.X >=44*2&& mer.dwMousePosition.X <= 51 * 2, mer.dwMousePosition.Y >=9&& mer.dwMousePosition.Y <= 11)
				{
					type_mode = 黃土牆;
				}
				else if(mer.dwMousePosition.X >= 44*2&& mer.dwMousePosition.X <= 51 * 2, mer.dwMousePosition.Y >= 15&& mer.dwMousePosition.Y <= 17)
				{
					type_mode = 鋼牆;
				}
				else if (mer.dwMousePosition.X >= 44*2&& mer.dwMousePosition.X == 51 * 2, mer.dwMousePosition.Y >= 21&& mer.dwMousePosition.Y <= 23)
				{
					type_mode = 水流;
				}
				else if (mer.dwMousePosition.X >= 44 * 2 && mer.dwMousePosition.X == 51 * 2, mer.dwMousePosition.Y >= 27 && mer.dwMousePosition.Y <= 30)
				{
					type_mode = 空地;
				}
				else if (mer.dwMousePosition.X >= 44 * 2 && mer.dwMousePosition.X == 51 * 2, mer.dwMousePosition.Y >= 35&& mer.dwMousePosition.Y <= 37)
				{
					//由於用戶需要選擇單雙人模式
					return;
				}
				//printf("%d %d\n", mer.dwMousePosition.X, mer.dwMousePosition.Y);
			}
		}
	}
	CloseHandle(hOut);
}

有什么寫的不好的地方,請大家鍵盤留情。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM