gameui C++的代碼

?

?gameui C++的代碼

#include <graphics.h>
#include "gameboard.h"
const int WIDTH = 560;
const int HEIGHT = 780;
const int GRID_SIZE = 120;
class GameUi {
private:   public:GameUi(GameBoard& gb) {// 初始化圖形窗口initgraph(WIDTH, HEIGHT);// 設置背景色setbkcolor(0xCCCCCC);cleardevice();// 繪制游戲背景和網格//setlinecolor(WHITE);//setlinestyle(PS_SOLID, 5);for (int i = 1; i < 4; ++i) {//line(i * GRID_SIZE, 0, i * GRID_SIZE, HEIGHT);//line(0, i * GRID_SIZE, WIDTH, i * GRID_SIZE);}DrawBlocks(gb);}void DrawBlocks(GameBoard& gb) {int c=0;int i;int j;int x;int y;for (i = 0; i < 4; ++i) {for (j = 0; j < 4; ++j) {if (gb.get_ij(i,j) != 0) {// 根據數字大小設置顏色和繪制位置x = j * GRID_SIZE + GRID_SIZE / 2;y = i * GRID_SIZE + GRID_SIZE / 2;x += 30;switch (gb.get_ij(i, j)){case 2:c = 0x99FFFF;break;case 4:c = 0x99FFCC;break;case 8:c = 0x99FF99;break;case 16:c = 0x99FF66;break;case 32:c = 0x99FF33;break;case 64:c = 0x99FF00;break;case 128:c = 0x99CCFF;break;case 128*2:c = 0x99CCCC;break;case 128 * 4:c = 0x99CC99;break;case 128 * 8:c = 0x99CC66;break;case 128 * 16:c = 0x99CC33;break;default:break;}setfillcolor(0xCCCCCC);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 - 5, y + GRID_SIZE / 2 - 5);// 繪制數字settextcolor(c);// 設置背景色setbkcolor(0xCCCCCC);settextstyle(40, 0, _T("Arial"));    char str[10];sprintf(str, "%d", gb.get_ij(i, j));outtextxy(x - 15, y - 15, str);}else {// 根據數字大小設置顏色和繪制位置x = j * GRID_SIZE + GRID_SIZE / 2;y = i * GRID_SIZE + GRID_SIZE / 2;x += 30;setfillcolor(0xCCCCCC);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 - 5, y + GRID_SIZE / 2 - 5);}}}//雙for結束x = 0 * GRID_SIZE + GRID_SIZE / 2;y = i * GRID_SIZE + GRID_SIZE / 2;x += 30;y += 20;setfillcolor(0xCCCCCC);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 - 5, y + GRID_SIZE / 2 - 5);// 繪制數字settextcolor(0xFF9966);settextstyle(40, 0, _T("Arial"));char str[100];sprintf(str, "%d", gb.getSum());outtextxy(x - 15, y - 15, str);x += 1*GRID_SIZE + GRID_SIZE / 2;setfillcolor(0xCCCCCC);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 + 155, y + GRID_SIZE / 2 - 5);// 繪制數字settextcolor(0xFF9966);settextstyle(40, 0, _T("Arial"));sprintf(str, "BEST:%d", gb.getHistoricalMaxScore());outtextxy(x - 15, y - 15, str);y += 1 * GRID_SIZE + GRID_SIZE / 2;x = 130;setfillcolor(0xCCCCCC);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 + 255, y + GRID_SIZE / 2 - 5);settextcolor(0xFF9966);settextstyle(40, 0, _T("Arial"));sprintf(str, "ESC:reset p:PAUSE");outtextxy(x - 15, y - 15, str);}void DrawBlocks1(GameBoard& gb) {int c = 0;int i;int j;int x;int y;for (i = 0; i < 4; ++i) {for (j = 0; j < 4; ++j) {if (gb.get_ij(i, j) != 0) {// 根據數字大小設置顏色和繪制位置x = j * GRID_SIZE + GRID_SIZE / 2;y = i * GRID_SIZE + GRID_SIZE / 2;x += 30;switch (gb.get_ij(i, j)){case 2:c = 0x11FFFF;break;case 4:c = 0x11FFCC;break;case 8:c = 0x11FF99;break;case 16:c = 0x11FF66;break;case 32:c = 0x11FF33;break;case 64:c = 0x11FF00;break;case 128:c = 0x11CCFF;break;case 128 * 2:c = 0x11CCCC;break;case 128 * 4:c = 0x11CC99;break;case 128 * 8:c = 0x11CC66;break;case 128 * 16:c = 0x11CC33;break;default:break;}setfillcolor(0xCCCCCC);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 - 5, y + GRID_SIZE / 2 - 5);// 繪制數字settextcolor(c);settextstyle(40, 0, _T("Arial"));char str[10];sprintf(str, "%d", gb.get_ij(i, j));outtextxy(x - 15, y - 15, str);}else {// 根據數字大小設置顏色和繪制位置x = j * GRID_SIZE + GRID_SIZE / 2;y = i * GRID_SIZE + GRID_SIZE / 2;x += 30;setfillcolor(0xAAAAAA);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 - 5, y + GRID_SIZE / 2 - 5);}}}//雙for結束x = 0 * GRID_SIZE + GRID_SIZE / 2;y = i * GRID_SIZE + GRID_SIZE / 2;x += 30;y += 20;setfillcolor(0xCCCCCC);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 - 5, y + GRID_SIZE / 2 - 5);// 繪制數字settextcolor(0xFF9966);settextstyle(40, 0, _T("Arial"));char str[100];sprintf(str, "%d", gb.getSum());outtextxy(x - 15, y - 15, str);x += 1 * GRID_SIZE + GRID_SIZE / 2;setfillcolor(0xCCCCCC);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 + 155, y + GRID_SIZE / 2 - 5);// 繪制數字settextcolor(0xFF9966);settextstyle(40, 0, _T("Arial"));sprintf(str, "BEST:%d", gb.getHistoricalMaxScore());outtextxy(x - 15, y - 15, str);y += 1 * GRID_SIZE + GRID_SIZE / 2;x = 130;setfillcolor(0xCCCCCC);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 + 255, y + GRID_SIZE / 2 - 5);settextcolor(0xFF9966);settextstyle(40, 0, _T("Arial"));sprintf(str, "ESC:reset p:PAUSE");outtextxy(x - 15, y - 15, str);}void DrawBlocks2(GameBoard& gb) {int c = 0;int i;int j;int x;int y;for (i = 0; i < 4; ++i) {for (j = 0; j < 4; ++j) {if (gb.get_ij(i, j) != 0) {// 根據數字大小設置顏色和繪制位置x = j * GRID_SIZE + GRID_SIZE / 2;y = i * GRID_SIZE + GRID_SIZE / 2;x += 30;switch (gb.get_ij(i, j)){case 2:c = 0x22FFFF;break;case 4:c = 0x22FFCC;break;case 8:c = 0x22FF99;break;case 16:c = 0x22FF66;break;case 32:c = 0x22FF33;break;case 64:c = 0x22FF00;break;case 128:c = 0x22CCFF;break;case 128 * 2:c = 0x22CCCC;break;case 128 * 4:c = 0x22CC99;break;case 128 * 8:c = 0x22CC66;break;case 128 * 16:c = 0x22CC33;break;default:break;}setfillcolor(0xCCCCCC);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 - 5, y + GRID_SIZE / 2 - 5);// 繪制數字settextcolor(c);settextstyle(40, 0, _T("Arial"));char str[10];sprintf(str, "%d", gb.get_ij(i, j));outtextxy(x - 15, y - 15, str);}else {// 根據數字大小設置顏色和繪制位置x = j * GRID_SIZE + GRID_SIZE / 2;y = i * GRID_SIZE + GRID_SIZE / 2;x += 30;setfillcolor(0xBBBBBB);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 - 5, y + GRID_SIZE / 2 - 5);}}}//雙for結束x = 0 * GRID_SIZE + GRID_SIZE / 2;y = i * GRID_SIZE + GRID_SIZE / 2;x += 30;y += 20;setfillcolor(0xCCCCCC);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 - 5, y + GRID_SIZE / 2 - 5);// 繪制數字settextcolor(0xFF9966);settextstyle(40, 0, _T("Arial"));char str[100];sprintf(str, "%d", gb.getSum());outtextxy(x - 15, y - 15, str);x += 1 * GRID_SIZE + GRID_SIZE / 2;setfillcolor(0xCCCCCC);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 + 155, y + GRID_SIZE / 2 - 5);// 繪制數字settextcolor(0xFF9966);settextstyle(40, 0, _T("Arial"));sprintf(str, "BEST:%d", gb.getHistoricalMaxScore());outtextxy(x - 15, y - 15, str);y += 1 * GRID_SIZE + GRID_SIZE / 2;x = 130;setfillcolor(0xCCCCCC);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 + 255, y + GRID_SIZE / 2 - 5);settextcolor(0xFF9966);settextstyle(40, 0, _T("Arial"));sprintf(str, "ESC:reset p:PAUSE");outtextxy(x - 15, y - 15, str);}void DrawBlocks3(GameBoard& gb) {int c = 0;int i;int j;int x;int y;for (i = 0; i < 4; ++i) {for (j = 0; j < 4; ++j) {if (gb.get_ij(i, j) != 0) {// 根據數字大小設置顏色和繪制位置x = j * GRID_SIZE + GRID_SIZE / 2;y = i * GRID_SIZE + GRID_SIZE / 2;x += 30;switch (gb.get_ij(i, j)){case 2:c = 0x900FFF;break;case 4:c = 0x300FCC;break;case 8:c = 0x300F99;break;case 16:c = 0x300F66;break;case 32:c = 0x300F33;break;case 64:c = 0x300F00;break;case 128:c = 0x300CFF;break;case 128 * 2:c = 0x300CCC;break;case 128 * 4:c = 0x300C99;break;case 128 * 8:c = 0x300C66;break;case 128 * 16:c = 0x300C33;break;default:break;}setfillcolor(0xCCCCCC);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 - 5, y + GRID_SIZE / 2 - 5);// 繪制數字settextcolor(c);settextstyle(40, 0, _T("Arial"));char str[10];sprintf(str, "%d", gb.get_ij(i, j));outtextxy(x - 15, y - 15, str);}else {// 根據數字大小設置顏色和繪制位置x = j * GRID_SIZE + GRID_SIZE / 2;y = i * GRID_SIZE + GRID_SIZE / 2;x += 30;setfillcolor(0xDDDDDD);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 - 5, y + GRID_SIZE / 2 - 5);}}}//雙for結束x = 0 * GRID_SIZE + GRID_SIZE / 2;y = i * GRID_SIZE + GRID_SIZE / 2;x += 30;y += 20;setfillcolor(0xCCCCCC);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 - 5, y + GRID_SIZE / 2 - 5);// 繪制數字settextcolor(0xFF9966);settextstyle(40, 0, _T("Arial"));char str[100];sprintf(str, "%d", gb.getSum());outtextxy(x - 15, y - 15, str);x += 1 * GRID_SIZE + GRID_SIZE / 2;setfillcolor(0xCCCCCC);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 + 155, y + GRID_SIZE / 2 - 5);// 繪制數字settextcolor(0xFF9966);settextstyle(40, 0, _T("Arial"));sprintf(str, "BEST:%d", gb.getHistoricalMaxScore());outtextxy(x - 15, y - 15, str);y += 1 * GRID_SIZE + GRID_SIZE / 2;x = 130;setfillcolor(0xCCCCCC);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 + 255, y + GRID_SIZE / 2 - 5);settextcolor(0xFF9966);settextstyle(40, 0, _T("Arial"));sprintf(str, "ESC:reset p:PAUSE");outtextxy(x - 15, y - 15, str);}void DrawBlocks4(GameBoard& gb) {int c = 0;int i;int j;int x;int y;for (i = 0; i < 4; ++i) {for (j = 0; j < 4; ++j) {if (gb.get_ij(i, j) != 0) {// 根據數字大小設置顏色和繪制位置x = j * GRID_SIZE + GRID_SIZE / 2;y = i * GRID_SIZE + GRID_SIZE / 2;x += 30;switch (gb.get_ij(i, j)){case 2:c = 0x44FFFF;break;case 4:c = 0x44FFCC;break;case 8:c = 0x44FF99;break;case 16:c = 0x44FF66;break;case 32:c = 0x44FF33;break;case 64:c = 0x44FF00;break;case 128:c = 0x44CCFF;break;case 128 * 2:c = 0x44CCCC;break;case 128 * 4:c = 0x44CC99;break;case 128 * 8:c = 0x44CC66;break;case 128 * 16:c = 0x44CC33;break;default:break;}setfillcolor(0xCCCCCC);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 - 5, y + GRID_SIZE / 2 - 5);// 繪制數字settextcolor(c);settextstyle(40, 0, _T("Arial"));char str[10];sprintf(str, "%d", gb.get_ij(i, j));outtextxy(x - 15, y - 15, str);}else {// 根據數字大小設置顏色和繪制位置x = j * GRID_SIZE + GRID_SIZE / 2;y = i * GRID_SIZE + GRID_SIZE / 2;x += 30;setfillcolor(0xCCCCCC);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 - 5, y + GRID_SIZE / 2 - 5);}}}//雙for結束x = 0 * GRID_SIZE + GRID_SIZE / 2;y = i * GRID_SIZE + GRID_SIZE / 2;x += 30;y += 20;setfillcolor(0xCCCCCC);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 - 5, y + GRID_SIZE / 2 - 5);// 繪制數字settextcolor(0xFF9966);settextstyle(40, 0, _T("Arial"));char str[100];sprintf(str, "%d", gb.getSum());outtextxy(x - 15, y - 15, str);x += 1 * GRID_SIZE + GRID_SIZE / 2;setfillcolor(0xCCCCCC);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 + 155, y + GRID_SIZE / 2 - 5);// 繪制數字settextcolor(0xFF9966);settextstyle(40, 0, _T("Arial"));sprintf(str, "BEST:%d", gb.getHistoricalMaxScore());outtextxy(x - 15, y - 15, str);y += 1 * GRID_SIZE + GRID_SIZE / 2;x = 130;setfillcolor(0xCCCCCC);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 + 255, y + GRID_SIZE / 2 - 5);settextcolor(0xFF9966);settextstyle(40, 0, _T("Arial"));sprintf(str, "ESC:reset p:PAUSE");outtextxy(x - 15, y - 15, str);}void DrawBlocks5(GameBoard& gb) {int c = 0;int i;int j;int x;int y;for (i = 0; i < 4; ++i) {for (j = 0; j < 4; ++j) {if (gb.get_ij(i, j) != 0) {// 根據數字大小設置顏色和繪制位置x = j * GRID_SIZE + GRID_SIZE / 2;y = i * GRID_SIZE + GRID_SIZE / 2;x += 30;switch (gb.get_ij(i, j)){case 2:c = 0x55FFFF;break;case 4:c = 0x55FFCC;break;case 8:c = 0x55FF99;break;case 16:c = 0x55FF66;break;case 32:c = 0x55FF33;break;case 64:c = 0x55FF00;break;case 128:c = 0x55CCFF;break;case 128 * 2:c = 0x55CCCC;break;case 128 * 4:c = 0x55CC99;break;case 128 * 8:c = 0x55CC66;break;case 128 * 16:c = 0x55CC33;break;default:break;}setfillcolor(0xCCCCCC);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 - 5, y + GRID_SIZE / 2 - 5);// 繪制數字settextcolor(c);settextstyle(40, 0, _T("Arial"));char str[10];sprintf(str, "%d", gb.get_ij(i, j));outtextxy(x - 15, y - 15, str);}else {// 根據數字大小設置顏色和繪制位置x = j * GRID_SIZE + GRID_SIZE / 2;y = i * GRID_SIZE + GRID_SIZE / 2;x += 30;setfillcolor(0xCCCCCC);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 - 5, y + GRID_SIZE / 2 - 5);}}}//雙for結束x = 0 * GRID_SIZE + GRID_SIZE / 2;y = i * GRID_SIZE + GRID_SIZE / 2;x += 30;y += 20;setfillcolor(0xCCCCCC);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 - 5, y + GRID_SIZE / 2 - 5);// 繪制數字settextcolor(0xFF9966);settextstyle(40, 0, _T("Arial"));char str[100];sprintf(str, "%d", gb.getSum());outtextxy(x - 15, y - 15, str);x += 1 * GRID_SIZE + GRID_SIZE / 2;setfillcolor(0xCCCCCC);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 + 155, y + GRID_SIZE / 2 - 5);// 繪制數字settextcolor(0xFF9966);settextstyle(40, 0, _T("Arial"));sprintf(str, "BEST:%d", gb.getHistoricalMaxScore());outtextxy(x - 15, y - 15, str);y += 1 * GRID_SIZE + GRID_SIZE / 2;x = 130;setfillcolor(0xCCCCCC);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 + 255, y + GRID_SIZE / 2 - 5);settextcolor(0xFF9966);settextstyle(40, 0, _T("Arial"));sprintf(str, "ESC:reset p:PAUSE");outtextxy(x - 15, y - 15, str);}void DrawBlocks6(GameBoard& gb) {int c = 0;int i;int j;int x;int y;for (i = 0; i < 4; ++i) {for (j = 0; j < 4; ++j) {if (gb.get_ij(i, j) != 0) {// 根據數字大小設置顏色和繪制位置x = j * GRID_SIZE + GRID_SIZE / 2;y = i * GRID_SIZE + GRID_SIZE / 2;x += 30;switch (gb.get_ij(i, j)){case 2:c = 0x66F0FF;break;case 4:c = 0x66F0CC;break;case 8:c = 0x66F099;break;case 16:c = 0x66F066;break;case 32:c = 0x66F033;break;case 64:c = 0x66F000;break;case 128:c = 0x66C0FF;break;case 128 * 2:c = 0x66C0CC;break;case 128 * 4:c = 0x66CC99;break;case 128 * 8:c = 0x66CC66;break;case 128 * 16:c = 0x66CC33;break;default:break;}setfillcolor(0xCCCCCC);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 - 5, y + GRID_SIZE / 2 - 5);// 繪制數字settextcolor(c);settextstyle(40, 0, _T("Arial"));char str[10];sprintf(str, "%d", gb.get_ij(i, j));outtextxy(x - 15, y - 15, str);}else {// 根據數字大小設置顏色和繪制位置x = j * GRID_SIZE + GRID_SIZE / 2;y = i * GRID_SIZE + GRID_SIZE / 2;x += 30;setfillcolor(0xCCCCCC);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 - 5, y + GRID_SIZE / 2 - 5);}}}//雙for結束x = 0 * GRID_SIZE + GRID_SIZE / 2;y = i * GRID_SIZE + GRID_SIZE / 2;x += 30;y += 20;setfillcolor(0xCCCCCC);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 - 5, y + GRID_SIZE / 2 - 5);// 繪制數字settextcolor(0xFF9966);settextstyle(40, 0, _T("Arial"));char str[100];sprintf(str, "%d", gb.getSum());outtextxy(x - 15, y - 15, str);x += 1 * GRID_SIZE + GRID_SIZE / 2;setfillcolor(0xCCCCCC);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 + 155, y + GRID_SIZE / 2 - 5);// 繪制數字settextcolor(0xFF9966);settextstyle(40, 0, _T("Arial"));sprintf(str, "BEST:%d", gb.getHistoricalMaxScore());outtextxy(x - 15, y - 15, str);y += 1 * GRID_SIZE + GRID_SIZE / 2;x = 130;setfillcolor(0xCCCCCC);fillrectangle(x - GRID_SIZE / 2 + 5, y - GRID_SIZE / 2 + 5, x + GRID_SIZE / 2 + 255, y + GRID_SIZE / 2 - 5);settextcolor(0xFF9966);settextstyle(40, 0, _T("Arial"));sprintf(str, "ESC:reset p:PAUSE");outtextxy(x - 15, y - 15, str);}void Update(GameBoard& gb,int type) {cleardevice();if (type == 0) {DrawBlocks(gb);}if (type == 1) {DrawBlocks1(gb);}if (type == 2) {DrawBlocks2(gb);}if (type == 3) {DrawBlocks3(gb);}if (type == 4) {DrawBlocks4(gb);}if (type == 5) {DrawBlocks5(gb);}if (type == 6) {DrawBlocks6(gb);}Sleep(10);  // 控制幀率}void GameOver() {settextcolor(RED);settextstyle(64, 0, _T("Consolas"));outtextxy(WIDTH / 2 - 150, HEIGHT / 2 - 50, _T("Game Over"));        }void GamePause() {settextcolor(RED);settextstyle(64, 0, _T("Consolas"));outtextxy(WIDTH / 2 - 150, HEIGHT / 2 - 50, _T("Game Pause~!"));}~GameUi() {closegraph();}
};

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/diannao/39495.shtml
繁體地址,請注明出處:http://hk.pswp.cn/diannao/39495.shtml
英文地址,請注明出處:http://en.pswp.cn/diannao/39495.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

小米內推官

小米硬件提前批開始啦&#xff01;&#xff01;&#xff01;&#xff01; 請使用小米公司內推碼: Q9BN21S 招聘對象&#xff1a;25屆秋招 中國內地:畢業時間2025.01-2025.12 中國港澳臺及海外:畢業時間2025.07-2025.12 工作地點&#xff1a;北京、南京、武漢、深圳、上海等…

C++中Ranges庫的基本用法,如何簡化和增強對集合的操作。

Ranges庫的基本用法 什么是Ranges庫&#xff1f; C20引入的Ranges庫&#xff08;<ranges>&#xff09;是一個強大的工具集&#xff0c;旨在簡化和增強對集合&#xff08;如數組、向量等序列容器&#xff09;的操作。它提供了一套用于操作序列的功能性接口&#xff0c;使…

獨立站新風口:TikTok達人帶貨背后的雙贏合作之道

TikTok以其龐大的用戶基礎、高度互動性和創新的內容形式&#xff0c;為獨立站帶來了前所未有的發展機遇。獨立站與TikTok達人的合作&#xff0c;不僅能夠幫助獨立站快速提升品牌知名度和銷售額&#xff0c;還能為TikTok達人帶來更多商業機會和影響力。本文Nox聚星將和大家探討獨…

Android sdk 安裝已經環境配置

&#x1f34e;個人博客&#xff1a;個人主頁 &#x1f3c6;個人專欄&#xff1a;Android ?? 功不唐捐&#xff0c;玉汝于成 目錄 正文 一、下載 二、安裝 三、環境配置 我的其他博客 正文 一、下載 1、大家可去官網下載 因為需要魔法 所以就不展示了 2、去下面這…

經典shell運維實用腳本~

以下腳本可謂日常工作常用到的經典腳本案例。希望可以幫助大家提升提升自動化能力&#xff01; 1、監控100臺服務器磁盤利用率腳本 #!/bin/bashHOST_INFOhost.infofor IP in $(awk /^[^#]/{print $1} $HOST_INFO); do USER$(awk -v ip$IP ip$1{print $2} $HOST_INFO) P…

【JS】純web端使用ffmpeg實現的視頻編輯器-視頻合并

純前端實現的視頻合并 接上篇ffmpeg文章 【JS】純web端使用ffmpeg實現的視頻編輯器 這次主要添加了一個函數&#xff0c;實現了視頻合并的操作。 static mergeArgs(timelineList) {const cmd []console.log(時間軸數據,timelineList)console.log("文件1",this.readD…

常用目標檢測的格式轉換腳本文件txt,json等

常用目標檢測的格式轉換腳本文件txt,json等 文章目錄 常用目標檢測的格式轉換腳本文件txt,json等前言一、json格式轉yolo的txt格式二、yolov8的關鍵點labelme打的標簽json格式轉可訓練的txt格式三、yolo的目標檢測txt格式轉coco數據集標簽的json格式四、根據yolo的目標檢測訓練…

Vue+ElementUi實現錄音播放上傳及處理getUserMedia報錯問題

1.Vue安裝插件 npm install --registryhttps://registry.npmmirror.com 2.Vue頁面使用 <template><div class"app-container"><!-- header --><el-header class"procedureHeader" style"height: 20px;"><el-divid…

vue2 接口文檔

const assetmanagementIndex (params) > getAction("/asset/assetmanagementsystem/page", params); //資產管理制度表分頁列表 const assetmanagementPost (params) > postAction("/asset/assetmanagementsystem", params); //資產管理制度表新增…

維護Nginx千字經驗總結

Hello , 我是恒 。 維護putty和nginx兩個項目好久了&#xff0c;用面向底層的思路去接觸 在nginx社區的收獲不少&#xff0c;在這里談談我的感悟 Nginx的奪冠不是偶然 高速:一方面&#xff0c;在正常情況下&#xff0c;單次請求會得到更快的響應&#xff1b;另一方面&#xff0…

從零開始學量化~Ptrade使用教程——安裝與登錄

PTrade交易系統是一款高凈值和機構投資者專業投資軟件&#xff0c;為用戶提供普通交易、籃子交易、日內回轉交易、算法交易、量化投研/回測/實盤等各種交易工具&#xff0c;滿足用戶的各種交易需求和交易場景&#xff0c;幫助用戶提高交易效率。 運行環境及安裝 操作系統&…

昇思25天學習打卡營第3天 | 數據集 Dataset

數據是深度學習的基礎&#xff0c;高質量的數據輸入將在整個深度神經網絡中起到積極作用。MindSpore提供基于Pipeline的數據引擎&#xff0c;通過數據集&#xff08;Dataset&#xff09;和數據變換&#xff08;Transforms&#xff09;實現高效的數據預處理。其中Dataset是Pipel…

將數據切分成N份,采用NCCL異步通信,讓all_gather+matmul盡量Overlap

將數據切分成N份,采用NCCL異步通信,讓all_gathermatmul盡量Overlap 一.測試數據二.測試環境三.普通實現四.分塊實現 本文演示了如何將數據切分成N份,采用NCCL異步通信,讓all_gathermatmul盡量Overlap 一.測試數據 1.測試規模:8192*8192 world_size22.單算子:all_gather:0.035…

代理IP的10大誤區:區分事實與虛構

在當今的數字時代&#xff0c;代理已成為在線環境不可或缺的一部分。它們的用途廣泛&#xff0c;從增強在線隱私到繞過地理限制。然而&#xff0c;盡管代理無處不在&#xff0c;但仍存在許多圍繞代理的誤解。在本博客中&#xff0c;我們將探討和消除一些最常見的代理誤解&#…

人腦網絡的多層建模與分析

摘要 了解人類大腦的結構及其與功能的關系&#xff0c;對于各種應用至關重要&#xff0c;包括但不限于預防、處理和治療腦部疾病(如阿爾茨海默病或帕金森病)&#xff0c;以及精神疾病(如精神分裂癥)的新方法。結構和功能神經影像學方面的最新進展&#xff0c;以及計算機科學等…

OBS 免費的錄屏軟件

一、下載 obs 【OBS】OBS Studio 的安裝、參數設置和錄屏、攝像頭使用教程-CSDN博客 二、使用 obs & 輸出無黑屏 【OBS任意指定區域錄屏的方法-嗶哩嗶哩】 https://b23.tv/aM0hj8A OBS任意指定區域錄屏的方法_嗶哩嗶哩_bilibili 步驟&#xff1a; 1&#xff09;獲取區域…

012-GeoGebra基礎篇-構造圓的切線

前邊文章對于基礎內容已經悉數覆蓋了&#xff0c;這一篇我就不放具體的細節&#xff0c;若有需要可以復刻一下 目錄 一、成品展示二、算式內容三、正確性檢查五、文章最后 一、成品展示 二、算式內容 A(0,0) B(3,0) c: Circle(A,B) C(5,4) sSegment(A,C) DMidpoint(s) d: Circ…

k8s部署單節點redis

一、configmap # cat redis-configmap.yaml apiVersion: v1 kind: ConfigMap metadata:name: redis-single-confignamespace: redis data:redis.conf: |daemonize nobind 0.0.0.0port 6379tcp-backlog 511timeout 0tcp-keepalive 300pidfile /data/redis-server.pidlogfile /d…

全網小視頻去水印接口使用說明

一、請求地址&#xff1a; https://www.lytcreate.com/api/qsy/ 二、請求方式&#xff1a;POST 三、請求體&#xff1a;JSON body {"token": "個人中心的token","url": "視頻分享地址"} token獲取地址&#xff0c;訪問&#xff…

uniapp微信小程序使用xr加載模型

1.在根目錄與pages同級創建如下目錄結構和文件&#xff1a; // index.js Component({properties: {modelPath: { // vue頁面傳過來的模型type: String,value: }},data: {},methods: {} }) { // index.json"component": true,"renderer": "xr-frame&q…