主頁 >  其他 > C/C++游戲專案完整教程:《坦克大戰》

C/C++游戲專案完整教程:《坦克大戰》

2021-11-02 11:16:58 其他

《坦克大戰》以二戰坦克為題材,既保留了射擊類游戲的操作性,也改進了射擊類游戲太過于復雜難玩的高門檻特點,集休閑與競技于一身,經典再度襲來,流暢的畫面,瘋狂的戰斗,讓玩家再次進入瘋狂坦克的世界,玩家的目標是控制坦克躲避危險,消滅掉所有的敵人即可進入下一關,

話不多說

我們今天就來創造出屬于我們自己的《坦克大戰》,GOGOGO!!!

直接開始吧

這次的原始碼比較詳細,我分了好幾個cpp檔案,思路更加的清晰,請耐心用心的觀看

首先就是我們載入圖片的函式tupian.cpp

# include "tanke.h"

障礙物
void LaoWang(int * tilex, int * tiley)
{
	IMAGE img;
	loadimage(&img, _T("res\\tile.bmp"));
	
	putimage(*tilex, *tiley, 32 , 32 , &img, 32 * 5, 0 );
	
}
void tileHong(int * tilex, int * tiley)
{
	IMAGE img;
	loadimage(&img, _T("res\\tile.bmp"));
	
	putimage(*tilex, *tiley, 32, 32, &img, 32 * 0,  0 );
	
	return;
	
}

void tileLv(int * tilex, int * tiley)
{
	IMAGE img;
	loadimage(&img, _T("res\\tile.bmp"));
	
	putimage(*tilex, *tiley, 32, 32, &img, 32 * 2, 0 );
	return;
}

void tileBai(int * tilex, int * tiley)
{
	IMAGE img;
	loadimage(&img, _T("res\\tile.bmp"));
	
	putimage(*tilex, *tiley, 32, 32, &img, 32 * 1, 0 );
	return;
}

void tileBlue(int *tilex, int *tiley)
{
	IMAGE img;
	loadimage(&img, _T("res\\tile.bmp"));
	
	putimage(*tilex, *tiley, 32, 32, &img, 32 * 3, 0 );
}
//物品
void FaZhang(int *wupinx, int *wupiny)
{
	IMAGE img;
	loadimage(&img, _T("res\\fazhang.jpg"));
	
	putimage(*wupinx, *wupiny, 24, 24, &img, 0, 0 );
}

void ShouQiang(int *wupinx, int *wupiny)
{
	IMAGE img;
	loadimage(&img, _T("res\\shouqiang.jpg"));
	
	putimage(*wupinx, *wupiny, 24, 24, &img, 0, 0 );
}

void ShangDian(int *wupinx, int *wupiny)
{
	IMAGE img;
	loadimage(&img,_T("res\\shangdian.jpg"));
	
	putimage(*wupinx, *wupiny, 32, 32, &img, 0, 0 );
}

void YaoShui(int *wupinx, int *wupiny)
{
	IMAGE img;
	loadimage(&img, _T("res\\yaoshui.jpg"));

	putimage(*wupinx, *wupiny, 28, 28, &img, 0, 0 );
}

void DunPai(int *wupinx, int *wupiny)
{
	IMAGE img;
	loadimage(&img, _T("res\\dunpai.jpg"));
	
	putimage(*wupinx, *wupiny, 28, 28, &img, 0, 0 );
}

void XieZi(int *wupinx, int *wupiny)
{
	IMAGE img;
	loadimage(&img, _T("res\\xiezi.jpg"));
	
	putimage(*wupinx, *wupiny, 28, 28, &img, 0, 0 );
}

void Boss(int *wupinx, int *wupiny)
{
	IMAGE img;
	loadimage(&img, _T("res\\boss.jpg"));
	
	putimage(*wupinx, *wupiny, 32, 32, &img, 0, 0 );
}

void BigBoss(int *wupinx, int *wupiny)
{
	IMAGE img;
	loadimage(&img, _T("res\\bigboss.jpg"));

	putimage(*wupinx, *wupiny, 32, 32, &img, 0, 0 );
}

接下來是初始化的函式waiyuan.cpp

# include "tanke.h"

/外部
void JShengMing(int *j)
{
	setcolor(GREEN);
	settextstyle(0, 0, ("宋體"));
	char c2[20] = "自己生命值:";
	outtextxy(0, 20, c2);
	
	char c3[10] ;
	sprintf(c3, _T("%.1f"), 100* (60 - *j) / 60.0);
	outtextxy(90, 20, c3);
}

void DShengMing(int * d,int *k)
{
	setcolor(GREEN);
	settextstyle(0, 0, ("宋體"));
	char c2[20] = "敵人生命值:";
	outtextxy(0, 0, c2);
	
	char c3[10] ;
	sprintf(c3, _T("%.1f"), 100* (60 - *d) / 60.0);
	outtextxy(90, 0, c3);

	char c4[40] = "恭喜~! 現在起金幣到2200有驚喜!";//勝利

	if ( *k >= 8000 )
			{
				setcolor(YELLOW);
				settextstyle(30, 0, ("宋體"));

				outtextxy(150, 0, c4);
			}
}

void Gold(int * gold)
{
	setcolor(GREEN);
	settextstyle(0, 0, ("宋體"));
	char c2[20] = "金幣:";
	outtextxy(0, 40, c2);
	
	char c3[10] ;
	sprintf(c3, _T("%d"), *gold);
	outtextxy(40, 40, c3);
}

void start(void)
{
	initgraph(200, 130);

	TCHAR s1[10]="坦克大戰";
	TCHAR s2[30]="按A 開始游戲  按B 退出游戲";
	TCHAR s3[30]="按W S A D控制方向";
	TCHAR s4[20]="按J 發射子彈";
	TCHAR s5[20]="按C 看攻略";
	
	outtextxy(70, 0, s1);
	outtextxy(0,  110, s2);
	outtextxy(60, 90, s5);
	outtextxy(55, 30, s4);
	outtextxy(35, 60, s3);
	
	while (true)
	{
		Sleep(500);
		if (GetAsyncKeyState('A'))
		{
			BeginBatchDraw();
			closegraph();
			initgraph(640, 480);
			Sleep(200);
			Quit();
			return ;
		}	
		if (GetAsyncKeyState('C'))
		{
			Sleep(200);
			GongLue();
		}
	}
}
void GongLue(void)
{	
	initgraph(450, 300);
	TCHAR s1[20]="游戲攻略:";
	TCHAR s2[50]="再打坦克之前先吃法杖打掉白色磚塊,";
	TCHAR s3[50]="這樣敵坦克打白色就不能回血了,boss更應如此,";
	TCHAR s15[70]="吃盾牌的作用就是可以碾壓對手";
	TCHAR s4[50]="打大坦克的時候,別和它對子彈這樣會吃虧";
	TCHAR s5[70]="可以直接選擇上去碾壓它 注意:當血足夠少的時候走開,";
	TCHAR s6[50]="用子彈打它這樣才能得到錢,";
	TCHAR s7[70]="小boss可以反復刷,雖然掙不到錢,但復活次數更需要,";
	TCHAR s14[70]="吃手槍雖然速度快了但傷害會減少,但打綠boss時傷害反而增加";
	TCHAR s8[70]="血要多吃,肯定劃算,錢少了好掙,復活少了,就難掙了,";
	TCHAR s9[50]="打終極boss時,記得要用大子彈打它傷害才能打出來,";
	TCHAR s10[90]="最后溫馨提示:有塊紅磚比較可疑~";
	TCHAR s11[40]="最后:別想著跑后面去打終極Boss了";
	TCHAR s12[30]="因為你超過它會直接被秒,";
	TCHAR s13[30]="按A 開始游戲";
	
	outtextxy(0, 0,  s1);
	outtextxy(0, 20, s2);
	outtextxy(0, 40, s3);
	outtextxy(0, 60, s15);
	outtextxy(0, 80, s4);
	outtextxy(0, 100, s5);
	outtextxy(0, 120, s6);
	outtextxy(0, 140, s14);
	outtextxy(0, 160, s7);
	outtextxy(0, 180, s8);
	outtextxy(0, 200, s9);
	outtextxy(0, 220, s10);
	outtextxy(0, 240, s11);
	outtextxy(0, 260, s12);
	outtextxy(0, 280, s13);
	
	while (true)
	{
		Sleep(500);
		if (GetAsyncKeyState('A'))
		{
			keybd_event(65,0,0,0);
			keybd_event(65,0,KEYEVENTF_KEYUP,0);
			return ;
		}	
	}
	
}

void MiJi(void)
{		
	closegraph();

	printf("游戲秘籍:\n");
	printf("恭喜你通關了,\n");
	printf("告訴你些游戲作弊方法~!,\n");
	printf("當你一直按住子彈不松的話 ,還有直接控制 子彈功能哦~~\n\n");
	printf("哈哈 另外小技巧,打boss前 先把小坦克都壓了\n");
	printf("只留一個,因為boss出來 基地就危險了\n");
	printf("還有 有的人 覺得花了600塊的大子彈沒傷害沒用\n");
	printf("我只能說他的用法不對 不是一下一下的點,\n\n");
	printf("而是一直按著然后松開 那傷害高到 爆~!終極boss都打一半血!\n\n");
	printf("還有 就是 就算Gameover了 不算輸,我還留了一手\n\n");
	printf("你把所有敵坦克都殺了 再按 Y\n\n");
	printf("這時候你的基地就復活了,\n\n");
	printf("~~噓~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n");
	printf("另外:小坦克靠近基地時按Y它就乖乖回去了\n\n");
	printf("按B 游戲結束\n\n");	
	
	while (true)
	{
		Sleep(500);
		if (GetAsyncKeyState('B'))
		{
			exit(0);
		}	
	}
	
}
void music(void)
{
	mciSendString("open sound\\坦克大戰.mp3 alias mymusic", NULL, 0, NULL);
	mciSendString("play mymusic", NULL, 0, NULL);
	return;
}
void start_(void)
{
	music();
	srand( (unsigned)time( NULL ) );//隨機種子
	setcolor(GREEN);
	setfillcolor(RED);
}
void win(pHongZhuan phongzhuan,bool *live2, bool *live3, bool *live4, bool *live5,bool *live6,bool *live7,
		 bool *exist_laowang, bool *exist1, 
		 bool *wexist1,bool *wexist2,bool *wexist3,bool *wexist8)
{
	char c[10] = "YOU WIN";
	settextcolor(YELLOW);
	settextstyle(80, 0, ("宋體"));
	outtextxy(190, 100, c);
	char c1[20] = "按Y鍵 進入下一關";
	settextstyle(30, 0, ("宋體"));
	outtextxy(230, 200, c1);
	if (GetAsyncKeyState('Y'))
	{
		*live2 = true;
		*live3 = true;
		*live4 = true;
		*live5 = true;
		*live6 = true;
		*live7 = true;
		
		*exist_laowang =true;
		*exist1 = true;
	
		phongzhuan[0].exist = true;
		phongzhuan[1].exist = true;
		*wexist1 = true;
		*wexist2 = true;
		*wexist3 = true;
		*wexist8 = true;
	}
	return ;
}

void lost(bool * live1, int *relive, int *gold)
{
	char c[10] = "YOU LOST";
	settextcolor(YELLOW);
	settextstyle(80, 0, ("宋體"));
	outtextxy(170, 100, c);
	char c1[20] = "按I鍵 復活,金幣-60";
	settextstyle(30, 0, ("宋體"));
	outtextxy(200, 200, c1);
	
	char c2[20] = "剩余復活次數:";
	outtextxy(220, 230, c2);
	
	char c3[10] ;
	sprintf(c3, _T("%d"), 2 - *relive);
	outtextxy(426, 230, c3);
	
	if (GetAsyncKeyState('I'))
	{
		keybd_event(73,0,KEYEVENTF_KEYUP,0);
		
		(*relive)++;
		*gold -= 60;
		
		if (*relive < 3)
			*live1 = true;
	}
	if (*relive >= 3)
		GameOver();
	return ;
}

void GameOver(void)
{
	IMAGE img;
	loadimage(&img,_T("res\\gameover.bmp"));
	
	HDC	dstDC = GetImageHDC();  
	HDC	srcDC = GetImageHDC(&img);

	TransparentBlt(dstDC,200,50, 248, 160, srcDC, 0, 0, 248,  160, RGB(0,0,0));
}

bool Quit(void)
{
	if(GetAsyncKeyState('B'))
	{
		if(MessageBox(NULL, "你確定要退出嗎?",
			"提示", MB_YESNO) == IDYES)
			return true;
		
	}
	return false;
}

再然后是效果函式xiaoguo.cpp

# include "tanke.h"

bool LuoShui( int * x_, int * y_, int * tileBlue_x, int *tileBlue_y, int *d,int *gold)
{
	IMAGE imgBoom;
	loadimage(&imgBoom,_T("res\\explode1.bmp"));
	if (*x_ + 14 <= *tileBlue_x + 32 && *x_ + 14 >= *tileBlue_x && *y_ + 14 <= *tileBlue_y + 32 && *y_ + 14 >= *tileBlue_y)
	{
		putimage(*x_, *y_, 28, 28, &imgBoom,0 ,0 );
		(*d)++;
		*gold -= 2; 
	
		if (*d >= 40)
		{
			*d = 0;
			return false;
		}
	}
	return true;
}

bool BossMiaoRen(int *y_,int *y9)
{

	if (*y_ <= *y9 + 67)
	{
		mciSendString("open sound//boom.mp3 alias mymusic_1", NULL, 0, NULL);
		mciSendString("play mymusic_1", NULL, 0, NULL);
		return false;
	}
	return true;
}


bool HuoWu(int *x_, int *y_, int *wupinx, int *wupiny, int *d, int *HWsd)
{
	IMAGE imgXing;
	loadimage(&imgXing, _T("res\\bore.bmp"));
	if (*x_ + 14 <= *wupinx + 32 && *x_ + 14 >= *wupinx && *y_ + 14 <= *wupiny + 32 && *y_ + 14 >= *wupiny)
	{
		putimage(*x_ - 4, *y_ - 4, 32, 32, &imgXing, 32 * 3 ,0 );
		(*d)++;

		if (*d >= *HWsd)
		{
			if (*HWsd != 0)
				printf("\a");
			*d = 0;
			return false;
		}
	}
	return true;
}

之后是關于子彈的函式zidan.cpp

# include "tanke.h"

坦克 子彈
void JBox(int (*x)[2][3],int * x_, int * y_, int * z,int * r, int * sd, int *zhidan,int *color1)
{	
	int h = 0;//圖片的方向
	int k , k1, k2;//k回圈,k1,k2裝有的方向
	IMAGE img;
	loadimage(&img, _T("res\\player1.bmp"));
	if (x[*z + 1][0][1] == 0 &&	x[*z  + 1][0][2] == -1)//w
		h = 0;
	
	if (x[*z + 1][0][1] == 0 &&	x[*z + 1][0][2] ==  1)//s
		h = 2;
	
	if (x[*z + 1][0][1] == -1 && x[*z + 1][0][2] ==  0)//a
		h = 3;
	
	if (x[*z + 1][0][1] == 1 &&	x[*z + 1][0][2] ==  0)//d
		h = 1;
	
	if (GetAsyncKeyState('J'))//發射子彈
	{
		*z = *z + 1;
		
		x[*z + 1][0][1] = x[*z ][0][1] ;//x坐標中的方向
		x[*z + 1][0][2] = x[*z ][0][2] ;//

		if (x[*z][0][1] == 0 &&	x[*z][0][2] == -1)//w
		{
			x[*z][0][0] = *x_ + 34;
			x[*z][1][0] = *y_ + 14;
		}
		if (x[*z][0][1] == 0 &&	x[*z][0][2] ==  1)//s
		{
			x[*z][0][0] = *x_ + 34;
			x[*z][1][0] = *y_ + 48;	
		}
		if (x[*z][0][1] == -1 && x[*z][0][2] ==  0)//a
		{
			x[*z][0][0] = *x_ + 17;
			x[*z][1][0] = *y_ + 33;
		}
		if (x[*z][0][1] == 1 &&	x[*z][0][2] ==  0)//d
		{
			x[*z][0][0] = *x_ + 48;
			x[*z][1][0] = *y_ + 33;
		}
		keybd_event(74,0,KEYEVENTF_KEYUP,0);
	}
	putimage( *x_,  *y_, 28 , 28 , &img, 28 * (*color1) , 28 * h );

	for (k = 0; k<40; k++)
	{		
		k1 = x[k][0][1];
		k2 = x[k][0][2];
		if(*r % *sd == 0)//己方子彈的的速度
		{
			if ( k1 == 1 && k2 == 0 && x[k][0][0] != 0)
				x[k][0][0] = x[k][0][0] + 4;
			
			if ( k1 == 0 && k2 == 1 && x[k][0][0] != 0)
				x[k][1][0] = x[k][1][0] + 4;
			
			if ( k1 == -1 && k2 == 0 && x[k][0][0] != 0)
				x[k][0][0] = x[k][0][0] - 4;
			
			if ( k1 == 0 && k2 == -1 && x[k][0][0] != 0)
				x[k][1][0] = x[k][1][0] - 4;			
		}
		
		if ( (x[k][0][0] -20) >= 640 || (x[k][0][0] - 20)<= 0)
			x[k][0][0] = 0 ;//子彈到邊界 就初始化陣列坐標x為0
		if ( (x[k][1][0] -20) >= 480 || (x[k][1][0] - 20)<= 0)
			x[k][0][0] = 0 ;
		
		solidcircle(x[k][0][0] - 20,  x[k][1][0] - 20, *zhidan);
	}
	
	if (*z >= 38)//陣列 要滿時就回圈
	{
		x[1][0][1] = x[*z ][0][1] ;
		x[1][0][2] = x[*z ][0][2] ;
		x[1][1][1] = x[*z ][1][1] ;
		x[1][1][2] = x[*z ][1][2] ;
		*z = 0;
	}
	
	return ;
}

void DBox(int (*x)[2][3],int * x_, int * y_, int * z, int *r, int * color)
{	
	int h = 0;
	int k , k1, k2;
	IMAGE img;
	loadimage(&img,_T("res\\enemy.bmp"));
	if (x[*z + 1][0][1] == 0 &&	x[*z  + 1][0][2] == -1)//w
		h = 0;
	
	if (x[*z + 1][0][1] == 0 &&	x[*z + 1][0][2] ==  1)//s
		h = 2;
	
	if (x[*z + 1][0][1] == -1 && x[*z + 1][0][2] ==  0)//a
		h = 3;
	
	if (x[*z + 1][0][1] == 1 &&	x[*z + 1][0][2] ==  0)//d
		h = 1;
	if ((*r) % 80 == 0)//敵坦克發子彈頻率
	{
		*z = *z + 1;
		
		x[*z + 1][0][1] = x[*z ][0][1] ;//給方向
		x[*z + 1][0][2] = x[*z ][0][2] ;
		
		if (x[*z][0][1] == 0 &&	x[*z][0][2] == -1)//w
		{
			x[*z][0][0] = *x_ + 34;
			x[*z][1][0] = *y_ + 14;
		}
		if (x[*z][0][1] == 0 &&	x[*z][0][2] ==  1)//s
		{
			x[*z][0][0] = *x_ + 34;
			x[*z][1][0] = *y_ + 48;
			
		}
		if (x[*z][0][1] == -1 && x[*z][0][2] ==  0)//a
		{
			x[*z][0][0] = *x_ + 17;
			x[*z][1][0] = *y_ + 33;
		}
		if (x[*z][0][1] == 1 &&	x[*z][0][2] ==  0)//d
		{
			x[*z][0][0] = *x_ + 48;
			x[*z][1][0] = *y_ + 33;
		}
	}
	
	putimage( *x_,  *y_, 28 , 28 , &img, *color , 28 * h );
	for (k = 0; k<40; k++)
	{		
		k1 = x[k][0][1];
		k2 = x[k][0][2];
		if(*r % 1 == 0)//敵坦克子彈速度
		{
			if ( k1 == 1 && k2 == 0 && x[k][0][0] != 0)
				x[k][0][0] = x[k][0][0] + 2;
			
			if ( k1 == 0 && k2 == 1 && x[k][0][0] != 0)
				x[k][1][0] = x[k][1][0] + 2;
			
			if ( k1 == -1 && k2 == 0 && x[k][0][0] != 0)
				x[k][0][0] = x[k][0][0] - 2;
			
			if ( k1 == 0 && k2 == -1 && x[k][0][0] != 0)
				x[k][1][0] = x[k][1][0] - 2;			
		}
		
		if ( (x[k][0][0] -20) >= 640 || (x[k][0][0] - 20)<= 0)
			x[k][0][0] = 0 ;
		if ( (x[k][1][0] -20) >= 480 || (x[k][1][0] - 20)<= 0)
			x[k][0][0] = 0 ;
		
		fillcircle(x[k][0][0] - 20,  x[k][1][0] - 20, 5);
	}
	
	if (*z >= 38)
	{
		x[1][0][1] = x[*z ][0][1] ;
		x[1][0][2] = x[*z ][0][2] ;
		x[1][1][1] = x[*z ][1][1] ;
		x[1][1][2] = x[*z ][1][2] ;
		*z = 0;
	}
	
	return ;
}

void DBoxBig(int (*x)[2][3],int * x_, int * y_, int * z, int *r, int * color)
{	
	int h = 0;
	int k , k1, k2;
	IMAGE img;
	loadimage(&img,_T("res\\enemy.bmp"));
	if (x[*z + 1][0][1] == 0 &&	x[*z  + 1][0][2] == -1)//w
		h = 0;
	
	if (x[*z + 1][0][1] == 0 &&	x[*z + 1][0][2] ==  1)//s
		h = 2;
	
	if (x[*z + 1][0][1] == -1 && x[*z + 1][0][2] ==  0)//a
		h = 3;
	
	if (x[*z + 1][0][1] == 1 &&	x[*z + 1][0][2] ==  0)//d
		h = 1;
	if ((*r) % 30 == 0)//敵坦克發子彈頻率
	{
		*z = *z + 1;
		
		x[*z + 1][0][1] = x[*z ][0][1] ;
		x[*z + 1][0][2] = x[*z ][0][2] ;		
		if (x[*z][0][1] == 0 &&	x[*z][0][2] == -1)//w
		{
			x[*z][0][0] = *x_ + 34;
			x[*z][1][0] = *y_ + 14;
		}
		if (x[*z][0][1] == 0 &&	x[*z][0][2] ==  1)//s
		{
			x[*z][0][0] = *x_ + 34;
			x[*z][1][0] = *y_ + 48;
			
		}
		if (x[*z][0][1] == -1 && x[*z][0][2] ==  0)//a
		{
			x[*z][0][0] = *x_ + 17;
			x[*z][1][0] = *y_ + 33;
		}
		if (x[*z][0][1] == 1 &&	x[*z][0][2] ==  0)//d
		{
			x[*z][0][0] = *x_ + 48;
			x[*z][1][0] = *y_ + 33;
		}
		keybd_event(74,0,KEYEVENTF_KEYUP,0);
	}
	
	putimage( *x_,  *y_, 28 , 28 , &img, *color , 112 + (28 * h) );
	for (k = 0; k<40; k++)
	{		
		k1 = x[k][0][1];
		k2 = x[k][0][2];
		if(*r % 2 == 0)//敵坦克子彈速度
		{
			if ( k1 == 1 && k2 == 0 && x[k][0][0] != 0)
				x[k][0][0] = x[k][0][0] + 15;
			
			if ( k1 == 0 && k2 == 1 && x[k][0][0] != 0)
				x[k][1][0] = x[k][1][0] + 15;
			
			if ( k1 == -1 && k2 == 0 && x[k][0][0] != 0)
				x[k][0][0] = x[k][0][0] - 15;
			
			if ( k1 == 0 && k2 == -1 && x[k][0][0] != 0)
				x[k][1][0] = x[k][1][0] - 15;			
		}
		
		if ( (x[k][0][0] -20) >= 640 || (x[k][0][0] - 20)<= 0)
			x[k][0][0] = 0 ;
		if ( (x[k][1][0] -20) >= 480 || (x[k][1][0] - 20)<= 0)
			x[k][0][0] = 0 ;
		
		fillcircle(x[k][0][0] - 20,  x[k][1][0] - 20, 5);
	}
	
	if (*z >= 38)
	{
		x[1][0][1] = x[*z ][0][1] ;
		x[1][0][2] = x[*z ][0][2] ;
		x[1][1][1] = x[*z ][1][1] ;
		x[1][1][2] = x[*z ][1][2] ;
		*z = 0;
	}
	
	return ;
}

void DBoxFeiJi(int (*x_9)[2][3],int (*x_10)[2][3],int (*x_11)[2][3],int * x_, int * y_, int * z, int *r)
{	
	int k;
	IMAGE img;
	loadimage(&img, _T("res\\feiji.jpg"));
	
	HDC	dstDC = GetImageHDC();  
	HDC	srcDC = GetImageHDC(&img);

	TransparentBlt(dstDC,*x_,*y_, 65, 65, srcDC, 0, 0, 65, 65, RGB(0,0,0));//飛機
	
	if ((*r) % 13 == 0)//敵坦克發子彈頻率
	{	
		*z = *z + 1;
		x_9[*z][0][0] = *x_ + 52;
		x_9[*z][1][0] = *y_ + 85;
		
		x_10[*z][0][0] = *x_ + 52;
		x_10[*z][1][0] = *y_ + 85;
		
		x_11[*z][0][0] = *x_ + 52;
		x_11[*z][1][0] = *y_ + 85;
	}
	for (k = 0; k<40; k++)
	{		
		if(*r % 5 == 0 && x_10[k][0][0] != 0)//敵坦克子彈速度
		{	
			x_9[k][1][0] = x_9[k][1][0] + 15;
			
			x_10[k][0][0] = x_10[k][0][0] + 15;
			x_10[k][1][0] = x_10[k][1][0] + 15;
			
			x_11[k][0][0] = x_11[k][0][0] - 15;
			x_11[k][1][0] = x_11[k][1][0] + 15;					
		}
		
		if ( (x_9[k][1][0] -20) >= 480 )
			x_9[k][0][0] = 0 ;
		if ( (x_10[k][1][0] -20) >= 480)
			x_10[k][0][0] = 0 ;
		if ( (x_11[k][1][0] -20) >= 480)
			x_11[k][0][0] = 0 ;

		fillcircle(x_9[k][0][0] - 20,  x_9[k][1][0] - 20, 7);
		fillcircle(x_10[k][0][0] - 20,  x_10[k][1][0] - 20, 7);
		fillcircle(x_11[k][0][0] - 20,  x_11[k][1][0] - 20, 7);
	}	
	
	if (*z >= 38)
		*z = 0;	
	return ;
}


接下來是我們子彈暴炸時的函式boom.cpp


# include "tanke.h"
/效果
bool DBoom(int (*x)[2][3], int * x_, int *y_, int *d,int *gold)
{
	int i;//回圈用
	IMAGE imgBoom;
	loadimage(&imgBoom, _T("res\\explode1.bmp"));
	for (i=1; i<39; i++)//被擊中爆炸
		if (x[i][0][0] <= *x_+48 && x[i][0][0] >= *x_ + 20 && x[i][1][0] <= *y_ + 48 && x[i][1][0] >= *y_ + 20)
		{

			if	 (*d % 10 ==  0)
				x[i][0][0] = 0;

			putimage(*x_, *y_, 28, 28, &imgBoom,0 ,0 );
			(*d)++;
			if (*d >= 60)
			{
				mciSendString("open sound//boom.mp3 alias mymusic_1", NULL, 0, NULL);
				mciSendString("play mymusic_1", NULL, 0, NULL);
		
				*d = 0;
				*gold += 10;
				return false;
			}
			mciSendString("close mymusic_1", NULL, 0, NULL);
		}	
		
		return true;
		
}

bool QZBoom(int (*x)[2][3], int * x_, int *y_)//強制子彈消失,物體爆炸,
{
	int i;//回圈用
	for (i=1; i<39; i++)//被擊中爆炸
		if (x[i][0][0] <= *x_+52 && x[i][0][0] >= *x_ + 20 && x[i][1][0] <= *y_ + 52 && x[i][1][0] >= *y_ + 20)
		{	
			x[i][0][0] = 0;
			
			return false;
		}			
		
		return true;
}


bool DBoomBig(int (*x)[2][3], int * x_, int *y_, int *d)
{
	int i;//回圈用
	IMAGE imgBoom;
	loadimage(&imgBoom,_T("res\\explode2.bmp"));
	for (i=1; i<39; i++)//被擊中爆炸
		if (x[i][0][0] <= *x_+52 && x[i][0][0] >= *x_ + 20 && x[i][1][0] <= *y_ + 52 && x[i][1][0] >= *y_ + 20)
		{
			putimage(*x_ - 18, *y_ -18, 64, 64, &imgBoom,0 ,0 );
			(*d)++;
			
			if	 (*d % 10 ==  0)
				x[i][0][0] = 0;
			
			
		if (*d >= 60)
			{
				mciSendString("open sound//boom.mp3 alias mymusic_1", NULL, 0, NULL);
				mciSendString("play mymusic_1", NULL, 0, NULL);
	
				*d = 0;
				return false;
			}
			mciSendString("close mymusic_1", NULL, 0, NULL);
		}	
		
		return true;
		
}
bool DBossBoomBig(int (*x)[2][3], int * x_, int *y_, int *k, int*zhidan)
{
	int i;//回圈用
	IMAGE imgBoom;
	loadimage(&imgBoom,_T("res\\explode2.bmp"));
	for (i=1; i<39; i++)//被擊中爆炸
		if (x[i][0][0] <= *x_+70 && x[i][0][0] >= *x_ + 20 && x[i][1][0] <= *y_ + 70 && x[i][1][0] >= *y_ + 20)
		{
			putimage(*x_ - 18, *y_ -18, 64, 64, &imgBoom,0 ,0 );
			
			if (*zhidan == 5)
				(*k)++;
			
			if (*zhidan == 15)
				(*k) += 10;
			
			if (*k >= 8000)
			{
				x[i][0][0] = 0;
				
				keybd_event(89,0,0,0);
				keybd_event(89,0,KEYEVENTF_KEYUP,0);

				return false;
			}
			
		}
		setcolor(GREEN);
		settextstyle(0, 0, ("宋體"));
		char c2[20] = "BOSS生命值:";
		outtextxy(220, 0, c2);
		
		char c3[10] ;
		sprintf(c3, _T("%.1f"),1000*(8000 - *k)/8000.0 );
		outtextxy(320, 0, c3);

		return true;

}
bool DBossBoomSmall(int (*x)[2][3], int * x_, int *y_, int *l, int*sd)
{
	int i;//回圈用
	IMAGE imgBoom;
	loadimage(&imgBoom, _T("res\\explode2.bmp"));
	for (i=1; i<39; i++)//被擊中爆炸
		if (x[i][0][0] <= *x_+48 && x[i][0][0] >= *x_ + 20 && x[i][1][0] <= *y_ + 48 && x[i][1][0] >= *y_ + 20)
		{
			putimage(*x_ - 18, *y_ -18, 64, 64, &imgBoom,0 ,0 );
			
			if (*sd == 2)
				(*l)++;
			
			if (*sd == 1)
				(*l) += 10;
			
			if (*l >= 1000)
			{
				x[i][0][0] = 0;
				*l = 0;
				return false;
			}
			
		}
		setcolor(GREEN);
		settextstyle(0, 0, ("宋體"));
		char c2[20] = "BOSS生命值:";
		outtextxy(220, 0, c2);
		
		char c3[10] ;
		sprintf(c3, _T("%.1f"),1000*(1000 - *l)/1000.0 );
		outtextxy(320, 0, c3);
		return true;
}

最后就是我們運行的主函式了main.cpp


# include "tanke.h"

int main(void)
{		
	start();//開始說明
	
	int r = 0;//減速的
	int relive = 0;//復活次數
	int sd = 2;//子彈速度
	int HWsd = 40;
	int gold = 0;//金幣
	int zhidan = 5;//己方坦克子彈大小
	int o = 0; //boss方向儲存
	int ydsd = 2;//移動速度
	
	int j = 0;//爆炸圖片多次,或者生命值
	int d = 0;//爆炸圖片多次
	int k = 0;//boss生命值
	int l = 0;//小boss生命值
	int m = 0;//物品生命值
	
	
	TanKe tanke[7] = {	{0,0, 0, 0,   true, {0}},
						{0,0, 0, 0,   true, {0}},
						{0,0, 0, 56,  true, {0}},
						{0,0, 0, 112, true, {0}},
						{0,0, 0, 168, true, {0}},
						{0,0, 0, 112, true, {0}},
						{0,0, 0, 168, true, {0}}};
	
	pTanKe ptanke = NULL;

	BaiZhuan baizhuan[3] = { {0,0,true},{0,0,true},{0,0,true}};

	pBaiZhuan pbaizhuan = NULL;

	LvZhuan lvzhuan[12];
	pLvZhuan plvzhuan = NULL;

	HongZhuan hongzhuan[2] ={ {0,0,true},{0,0,true}};
	pHongZhuan phongzhuan = NULL;

	
	tanke[0].d[1][0][1] = 0;//初始化己方第一顆子彈方向上
	tanke[0].d[1][0][2] = -1;
	
	tanke[1].d[1][0][1] = 0;//初始化己方第一顆子彈方向上
	tanke[1].d[1][0][2] = -1;
	
	tanke[2].d[1][0][1] = 0;//初始化己方第一顆子彈方向上
	tanke[2].d[1][0][2] = -1;
	
	tanke[3].d[1][0][1] = 0;//初始化己方第一顆子彈方向上
	tanke[3].d[1][0][2] = -1;
	
	tanke[4].d[1][0][1] = 0;//初始化己方第一顆子彈方向上
	tanke[4].d[1][0][2] = -1;
	
	tanke[5].d[1][0][1] = 0;//初始化己方第一顆子彈方向上
	tanke[5].d[1][0][2] = -1;
	
	tanke[6].d[1][0][1] = 0;//初始化己方第一顆子彈方向上
	tanke[6].d[1][0][2] = -1;
	
	
	int z8 = 0;//綠坦克
	int z9 = 0;//飛機
	
	
	int color8 = 0;//綠boss
	
	int x_8[40][2][3] = {0};//綠坦克子彈
	int x_9[40][2][3] = {0};
	int x_10[40][2][3] = {0};//飛機子彈
	int x_11[40][2][3] = {0};//飛機子彈
	
	x_8[1][0][1] = 0;//初始化己方第一顆子彈方向上
	x_8[1][0][2] = -1;
	
	start_();
	
	bool live8 = false;//綠坦克
	bool live9 = false;//飛機
	
	bool exist_laowang  = true;
	bool exist1 = true;	//boss紅磚
	
	bool wexist1 = true;//法杖
	bool wexist2 = true;//槍
	bool wexist3 = true;//商店
	bool wexist4 = true;//藥水
	bool wexist5 = true;//盾牌
	bool wexist8 = true;//鞋子
	bool wexist6 = true;//物品—boss
	bool wexist7 = true;//物品—bigboss
	
	int tilelaowang_x = 304;//老王
	int tilelaowang_y = 448;
	int tileHong_x1 = 304;//老王前障礙物
	int tileHong_y1 = 416;
	
	while(true)
	{
		tanke[0].x = 28 + rand() % 584, tanke[0].y = 400 + rand() % 52;//己方方塊,
		tanke[1].x = 28 + rand() % 584, tanke[1].y = 28 + rand() % 124;//敵方方塊,↓同理
		tanke[2].x = 28 + rand() % 584, tanke[2].y = 28 + rand() % 124;
		tanke[3].x = 28 + rand() % 584, tanke[3].y = 28 + rand() % 124;
		tanke[4].x = 28 + rand() % 584, tanke[4].y = 28 + rand() % 124;
		tanke[5].x = 28 + rand() % 584, tanke[5].y = 28 + rand() % 124;
		tanke[6].x = 28 + rand() % 584, tanke[6].y = 28 + rand() % 124;
		//int x8 = 28 + rand() % 584, y8 = 28 + rand() % 124;//放在下面的
		int x9 = 320, y9 = -80;//大boss
		
		hongzhuan[0].x = 100 + rand() % 376;//紅色磚塊
		hongzhuan[0].y = 200 + rand() % 216;
		hongzhuan[1].x = 32 + rand() % 576;//紅色磚塊
		hongzhuan[1].y = 32 + rand() % 416;
		baizhuan[0].x = 32 + rand() % 576; //白色磚塊
		baizhuan[0].y = 32 + rand() % 416;
		baizhuan[1].x = 32 + rand() % 576; //白色磚塊
		baizhuan[1].y = 32 + rand() % 416;
		baizhuan[2].x = 32 + rand() % 576; //白色磚塊
		baizhuan[2].y = 32 + rand() % 416;
		int tileBai_x4 = -20; //老王前白色磚塊真的打不爛!
		int tileBai_y4 = -20;
		
		lvzhuan[0].x = 32 + rand() % 576; //綠色磚塊
		lvzhuan[0].y = 32 + rand() % 416; 
		lvzhuan[1].x = 32 + rand() % 576; 
		lvzhuan[1].y = 32 + rand() % 416; 
		lvzhuan[2].x = 32 + rand() % 576; 
		lvzhuan[2].y = 32 + rand() % 416;
		lvzhuan[3].x = 32 + rand() % 576; 
		lvzhuan[3].y = 32 + rand() % 416;
		lvzhuan[4].x = 32 + rand() % 576; 
		lvzhuan[4].y = 32 + rand() % 416;
		lvzhuan[5].x = 32 + rand() % 576; 
		lvzhuan[5].y = 32 + rand() % 416;
		lvzhuan[6].x = 32 + rand() % 576; //綠色磚塊
		lvzhuan[6].y = 32 + rand() % 416; 
		lvzhuan[7].x = 32 + rand() % 576; 
		lvzhuan[7].y = 32 + rand() % 416; 
		lvzhuan[8].x = 32 + rand() % 576; 
		lvzhuan[8].y = 32 + rand() % 416;
		lvzhuan[9].x = 32 + rand() % 576; 
		lvzhuan[9].y = 32 + rand() % 416;
		lvzhuan[10].x = 32 + rand() % 576; 
		lvzhuan[10].y = 32 + rand() % 416;
		lvzhuan[11].x = 32 + rand() % 576; 
		lvzhuan[11].y = 32 + rand() % 416;
		int tileBlue_x1 = 32 + rand() % 576; //藍色磚塊
		int tileBlue_y1 = 32 + rand() % 416; 
		int tileBlue_x2 = 32 + rand() % 576; //藍色磚塊
		int tileBlue_y2 = 32 + rand() % 416;
		
		int fazhang_x1 = 32 + rand() % 576; //物品—法杖;
		int fazhang_y1 = 32 + rand() % 416;
		
		int shouqiang_x1 = 32 + rand() % 576; //物品—槍;
		int shouqiang_y1 = 32 + rand() % 416;
		
		int shangdian_x1 = 32 + rand() % 576; //物品—商店;
		int shangdian_y1 = 200 + rand() % 216;
		
		int yaoshui_x1 = 32 + rand() % 576; //物品—藥水;
		int yaoshui_y1 = 32 + rand() % 416;
		
		int dunpai_x1 = 32 + rand() % 576; //物品—盾牌;
		int dunpai_y1 = 32 + rand() % 116;

		int xiezi_x1 = 32 + rand() % 576; //物品—鞋子;
		int xiezi_y1 = 32 + rand() % 116;
		
		int boss_x1 = 100 + rand() % 376; //物品—Boss;
		int boss_y1 = 100 + rand() % 216;
		int x8 = boss_x1 , y8 = boss_y1;
		
		int bigboss_x1 = hongzhuan[0].x ; //物品—bigBoss;
		int bigboss_y1 = hongzhuan[0].y ;
		
		
		while (true)
		{	
			ZhengTiFangXiang(tanke,baizhuan,hongzhuan,x_8,
				&live8,&live9,
				&r,&x8,&y8,&x9,&y9,
				&z8,
				&o,&ydsd);//方向
			
			cleardevice();//清屏
			
			ZhengTiLaoWang(tanke,x_8,x_9,x_10,x_11,
				&exist_laowang,&exist1,&gold,&d,
				&tilelaowang_x,&tilelaowang_y,&tileHong_x1,&tileHong_y1,&tileBai_x4,&tileBai_y4,&live9);//老王
			
			ZhengTiBaiSeZhangAiWu(tanke,x_8,x_9,x_10,x_11,
				&wexist1,
				&d,baizhuan);//白磚
			
			ZhengTiLanSeZhangAiWu(&tileBlue_x1,&tileBlue_y1,&tileBlue_x2,&tileBlue_y2);//藍磚
			
			ZhengTiTanKeBaoZha(tanke,x_8,x_9,x_10,x_11,
				&live8,&live9,
				&r,&x8,&y8,&x9,&y9,
				&sd,&color8,
				&j,&d,&k,&l,&gold,&zhidan,
				&z8,&z9);//坦克 、 爆炸
			
			ZhengTiLuoShui(tanke,&tileBlue_x1,&tileBlue_y1,&tileBlue_x2,&tileBlue_y2,
				&j,&gold,&y9);//落水.boss秒人
			
			ZhengTiLvSeZhangAiWu(lvzhuan);//綠磚
			
			ZhengTiWuPin(tanke,&x8,&y8,
				&live8,&live9,
				&fazhang_x1,&fazhang_y1,
				&shouqiang_x1,&shouqiang_y1,
				&shangdian_x1,&shangdian_y1,
				&yaoshui_x1,&yaoshui_y1,
				&dunpai_x1,&dunpai_y1,
				&xiezi_x1,&xiezi_y1,
				&boss_x1,&boss_y1,
				&bigboss_x1,&bigboss_y1,
				&wexist1, &wexist2,&wexist3,&wexist4,&wexist5,&wexist6,&wexist7,&wexist8,
				&sd,&HWsd,&ydsd, &d,&j,&gold,&zhidan,&relive);//物品

			ZhengTiHongSeZhangAiWu(tanke,x_8,x_9,
				&d,hongzhuan);//紅磚 后藏boss
			
			ZhengTiShengMing(tanke,hongzhuan,
				&exist_laowang,&exist1,&wexist1,&wexist2,&wexist3,&wexist8,
				&relive,&j,&d,&gold,&k);//生命
			
			FlushBatchDraw();
			
			if (GetAsyncKeyState('Y'))
			{break;}
			
			if (Quit())
			{exit(0);}

			if (gold == 2200)
			{
				MiJi();
			}

		}
	}
	EndBatchDraw(); 
	return 0;
}

這樣一個《坦克大戰》就完成了,快去自己動手嘗試一下叭!!!

代碼很長,希望看完了的同學可以獲得自己想要的知識,也感謝大家的耐心觀看,在這里想得到大家一波關注,后續UP主還會發布更多的專案原始碼以及學習資料,有什么問題可以回帖留言,我盡量回答,想要C/C++學習資料以及其他專案的原始碼的可以加群【1083227756】了解,想要對程式員的未來發展有興趣的也可加群閑聊,也可以關注微信公眾號:【狐貍的編碼時光】,希望和大家一起學習進步!!!

???|???¥???? ???¥???????¤???o???¤???¨???????|???¥???|???|???¤???¨???????| ???|???¥???|???1???¨???·???ˉ???§???o???????????¥???????|???|???2????

轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/344392.html

標籤:其他

上一篇:【C#】簡易人機對抗“石頭剪刀布”游戲

下一篇:2021-11-01

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • 網閘典型架構簡述

    網閘架構一般分為兩種:三主機的三系統架構網閘和雙主機的2+1架構網閘。 三主機架構分別為內端機、外端機和仲裁機。三機無論從軟體和硬體上均各自獨立。首先從硬體上來看,三機都用各自獨立的主板、記憶體及存盤設備。從軟體上來看,三機有各自獨立的作業系統。這樣能達到完全的三機獨立。對于“2+1”系統,“2”分為 ......

    uj5u.com 2020-09-10 02:00:44 more
  • 如何從xshell上傳檔案到centos linux虛擬機里

    如何從xshell上傳檔案到centos linux虛擬機里及:虛擬機CentOs下執行 yum -y install lrzsz命令,出現錯誤:鏡像無法找到軟體包 前言 一、安裝lrzsz步驟 二、上傳檔案 三、遇到的問題及解決方案 總結 前言 提示:其實很簡單,往虛擬機上安裝一個上傳檔案的工具 ......

    uj5u.com 2020-09-10 02:00:47 more
  • 一、SQLMAP入門

    一、SQLMAP入門 1、判斷是否存在注入 sqlmap.py -u 網址/id=1 id=1不可缺少。當注入點后面的引數大于兩個時。需要加雙引號, sqlmap.py -u "網址/id=1&uid=1" 2、判斷文本中的請求是否存在注入 從文本中加載http請求,SQLMAP可以從一個文本檔案中 ......

    uj5u.com 2020-09-10 02:00:50 more
  • Metasploit 簡單使用教程

    metasploit 簡單使用教程 浩先生, 2020-08-28 16:18:25 分類專欄: kail 網路安全 linux 文章標簽: linux資訊安全 編輯 著作權 metasploit 使用教程 前言 一、Metasploit是什么? 二、準備作業 三、具體步驟 前言 Msfconsole ......

    uj5u.com 2020-09-10 02:00:53 more
  • 游戲逆向之驅動層與用戶層通訊

    驅動層代碼: #pragma once #include <ntifs.h> #define add_code CTL_CODE(FILE_DEVICE_UNKNOWN,0x800,METHOD_BUFFERED,FILE_ANY_ACCESS) /* 更多游戲逆向視頻www.yxfzedu.com ......

    uj5u.com 2020-09-10 02:00:56 more
  • 北斗電力時鐘(北斗授時服務器)讓網路資料更精準

    北斗電力時鐘(北斗授時服務器)讓網路資料更精準 北斗電力時鐘(北斗授時服務器)讓網路資料更精準 京準電子科技官微——ahjzsz 近幾年,資訊技術的得了快速發展,互聯網在逐漸普及,其在人們生活和生產中都得到了廣泛應用,并且取得了不錯的應用效果。計算機網路資訊在電力系統中的應用,一方面使電力系統的運行 ......

    uj5u.com 2020-09-10 02:01:03 more
  • 【CTF】CTFHub 技能樹 彩蛋 writeup

    ?碎碎念 CTFHub:https://www.ctfhub.com/ 筆者入門CTF時時剛開始刷的是bugku的舊平臺,后來才有了CTFHub。 感覺不論是網頁UI設計,還是題目質量,賽事跟蹤,工具軟體都做得很不錯。 而且因為獨到的金幣制度的確讓人有一種想去刷題賺金幣的感覺。 個人還是非常喜歡這個 ......

    uj5u.com 2020-09-10 02:04:05 more
  • 02windows基礎操作

    我學到了一下幾點 Windows系統目錄結構與滲透的作用 常見Windows的服務詳解 Windows埠詳解 常用的Windows注冊表詳解 hacker DOS命令詳解(net user / type /md /rd/ dir /cd /net use copy、批處理 等) 利用dos命令制作 ......

    uj5u.com 2020-09-10 02:04:18 more
  • 03.Linux基礎操作

    我學到了以下幾點 01Linux系統介紹02系統安裝,密碼啊破解03Linux常用命令04LAMP 01LINUX windows: win03 8 12 16 19 配置不繁瑣 Linux:redhat,centos(紅帽社區版),Ubuntu server,suse unix:金融機構,證券,銀 ......

    uj5u.com 2020-09-10 02:04:30 more
  • 05HTML

    01HTML介紹 02頭部標簽講解03基礎標簽講解04表單標簽講解 HTML前段語言 js1.了解代碼2.根據代碼 懂得挖掘漏洞 (POST注入/XSS漏洞上傳)3.黑帽seo 白帽seo 客戶網站被黑帽植入劫持代碼如何處理4.熟悉html表單 <html><head><title>TDK標題,描述 ......

    uj5u.com 2020-09-10 02:04:36 more
最新发布
  • 2023年最新微信小程式抓包教程

    01 開門見山 隔一個月發一篇文章,不過分。 首先回顧一下《微信系結手機號資料庫被脫庫事件》,我也是第一時間得知了這個訊息,然后跟蹤了整件事情的經過。下面是這起事件的相關截圖以及近日流出的一萬條資料樣本: 個人認為這件事也沒什么,還不如關注一下之前45億快遞資料查詢渠道疑似在近日復活的訊息。 訊息是 ......

    uj5u.com 2023-04-20 08:48:24 more
  • web3 產品介紹:metamask 錢包 使用最多的瀏覽器插件錢包

    Metamask錢包是一種基于區塊鏈技術的數字貨幣錢包,它允許用戶在安全、便捷的環境下管理自己的加密資產。Metamask錢包是以太坊生態系統中最流行的錢包之一,它具有易于使用、安全性高和功能強大等優點。 本文將詳細介紹Metamask錢包的功能和使用方法。 一、 Metamask錢包的功能 數字資 ......

    uj5u.com 2023-04-20 08:47:46 more
  • vulnhub_Earth

    前言 靶機地址->>>vulnhub_Earth 攻擊機ip:192.168.20.121 靶機ip:192.168.20.122 參考文章 https://www.cnblogs.com/Jing-X/archive/2022/04/03/16097695.html https://www.cnb ......

    uj5u.com 2023-04-20 07:46:20 more
  • 從4k到42k,軟體測驗工程師的漲薪史,給我看哭了

    清明節一過,盲猜大家已經無心上班,在數著日子準備過五一,但一想到銀行卡里的余額……瞬間心情就不美麗了。最近,2023年高校畢業生就業調查顯示,本科畢業月平均起薪為5825元。調查一出,便有很多同學表示自己又被平均了。看著這一資料,不免讓人想到前不久中國青年報的一項調查:近六成大學生認為畢業10年內會 ......

    uj5u.com 2023-04-20 07:44:00 more
  • 最新版本 Stable Diffusion 開源 AI 繪畫工具之中文自動提詞篇

    🎈 標簽生成器 由于輸入正向提示詞 prompt 和反向提示詞 negative prompt 都是使用英文,所以對學習母語的我們非常不友好 使用網址:https://tinygeeker.github.io/p/ai-prompt-generator 這個網址是為了讓大家在使用 AI 繪畫的時候 ......

    uj5u.com 2023-04-20 07:43:36 more
  • 漫談前端自動化測驗演進之路及測驗工具分析

    隨著前端技術的不斷發展和應用程式的日益復雜,前端自動化測驗也在不斷演進。隨著 Web 應用程式變得越來越復雜,自動化測驗的需求也越來越高。如今,自動化測驗已經成為 Web 應用程式開發程序中不可或缺的一部分,它們可以幫助開發人員更快地發現和修復錯誤,提高應用程式的性能和可靠性。 ......

    uj5u.com 2023-04-20 07:43:16 more
  • CANN開發實踐:4個DVPP記憶體問題的典型案例解讀

    摘要:由于DVPP媒體資料處理功能對存放輸入、輸出資料的記憶體有更高的要求(例如,記憶體首地址128位元組對齊),因此需呼叫專用的記憶體申請介面,那么本期就分享幾個關于DVPP記憶體問題的典型案例,并給出原因分析及解決方法。 本文分享自華為云社區《FAQ_DVPP記憶體問題案例》,作者:昇騰CANN。 DVPP ......

    uj5u.com 2023-04-20 07:43:03 more
  • msf學習

    msf學習 以kali自帶的msf為例 一、msf核心模塊與功能 msf模塊都放在/usr/share/metasploit-framework/modules目錄下 1、auxiliary 輔助模塊,輔助滲透(埠掃描、登錄密碼爆破、漏洞驗證等) 2、encoders 編碼器模塊,主要包含各種編碼 ......

    uj5u.com 2023-04-20 07:42:59 more
  • Halcon軟體安裝與界面簡介

    1. 下載Halcon17版本到到本地 2. 雙擊安裝包后 3. 步驟如下 1.2 Halcon軟體安裝 界面分為四大塊 1. Halcon的五個助手 1) 影像采集助手:與相機連接,設定相機引數,采集影像 2) 標定助手:九點標定或是其它的標定,生成標定檔案及內參外參,可以將像素單位轉換為長度單位 ......

    uj5u.com 2023-04-20 07:42:17 more
  • 在MacOS下使用Unity3D開發游戲

    第一次發博客,先發一下我的游戲開發環境吧。 去年2月份買了一臺MacBookPro2021 M1pro(以下簡稱mbp),這一年來一直在用mbp開發游戲。我大致分享一下我的開發工具以及使用體驗。 1、Unity 官網鏈接: https://unity.cn/releases 我一般使用的Apple ......

    uj5u.com 2023-04-20 07:40:19 more