#邮件
2026-08-05 13:28:18
发布于:浙江
#include<bits/stdc++.h>
#include<cstdlib>
using namespace std;
long long ms=0;
long long second=0;
long long mini=0;
long long hour=0;
int main(){
while(1){
ms++;
if(ms==635000000){
ms=0;
second++;
system("cls");
cout<<hour<<"小时"<<mini<<"分钟"<<second<<"秒"<<endl;
}
if(second==60){
second=0;
mini++;
}
if(mini==60){
mini=0;
hour++;
}
}
return 0;
}
#include <iostream>
#include <conio.h>
#include <windows.h>
#include <string>
#include <vector>
#include <ctime>
#include <cstdlib>
#include <map>
#include <algorithm>
using namespace std;
// ======================== 颜色控制 ========================
void setColor(int color) {
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hConsole, color);
}
void gotoxy(int x, int y) {
COORD coord;
coord.X = x;
coord.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
}
void hideCursor() {
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_CURSOR_INFO info;
info.dwSize = 100;
info.bVisible = FALSE;
SetConsoleCursorInfo(hConsole, &info);
}
// ======================== 常量 ========================
const int WORLD_SIZE = 1000;
const int CHUNK_SIZE = 100;
const int VIEW_RADIUS = 12;
// 地形类型(全部改用ASCII字符)
enum Terrain {
PLAIN, // 平原 .
FOREST, // 森林 f
MOUNTAIN, // 山地 ^
WATER, // 水域 ~
DESERT, // 沙漠 :
GRASS, // 草地 , (大量)
ROAD // 白色道路 #
};
char getTerrainChar(Terrain t) {
switch(t) {
case PLAIN: return '.';
case FOREST: return 'f';
case MOUNTAIN:return '^';
case WATER: return '~';
case DESERT: return ':';
case GRASS: return ',';
case ROAD: return '#';
default: return ' ';
}
}
int getTerrainColor(Terrain t) {
switch(t) {
case PLAIN: return 8;
case FOREST: return 2;
case MOUNTAIN:return 6;
case WATER: return 9;
case DESERT: return 14;
case GRASS: return 10;
case ROAD: return 7;
default: return 7;
}
}
// ======================== 怪物系统 ========================
enum MonsterType { SLIME, BAT, SKELETON, WOLF, GOBLIN, ORC, TROLL, DRAGON };
struct Monster {
string name;
char symbol;
int hp, maxHp, atk, def, exp;
bool alive;
MonsterType type;
};
Monster createMonster(MonsterType type, int levelScale) {
Monster m;
m.alive = true;
m.type = type;
switch(type) {
case SLIME: m.name="史莱姆"; m.symbol='S'; m.hp=8+levelScale*3; m.atk=2+levelScale; m.def=0+levelScale/2; m.exp=5+levelScale*2; break;
case BAT: m.name="蝙蝠"; m.symbol='B'; m.hp=6+levelScale*2; m.atk=4+levelScale; m.def=1+levelScale/2; m.exp=6+levelScale*2; break;
case SKELETON:m.name="骷髅"; m.symbol='K'; m.hp=12+levelScale*4; m.atk=6+levelScale*2; m.def=2+levelScale; m.exp=10+levelScale*3; break;
case WOLF: m.name="狼"; m.symbol='W'; m.hp=15+levelScale*3; m.atk=7+levelScale; m.def=3+levelScale/2; m.exp=12+levelScale*3; break;
case GOBLIN: m.name="哥布林"; m.symbol='G'; m.hp=10+levelScale*3; m.atk=5+levelScale; m.def=2+levelScale/2; m.exp=8+levelScale*2; break;
case ORC: m.name="兽人"; m.symbol='O'; m.hp=20+levelScale*5; m.atk=8+levelScale*2; m.def=4+levelScale; m.exp=15+levelScale*4; break;
case TROLL: m.name="巨魔"; m.symbol='T'; m.hp=30+levelScale*6; m.atk=10+levelScale*2; m.def=5+levelScale; m.exp=20+levelScale*5; break;
case DRAGON: m.name="龙"; m.symbol='D'; m.hp=50+levelScale*10; m.atk=15+levelScale*3; m.def=8+levelScale*2; m.exp=50+levelScale*10; break;
}
m.maxHp = m.hp;
return m;
}
struct MonsterGroup {
vector<Monster> monsters;
bool hasAlive() const {
for (size_t i=0; i<monsters.size(); ++i)
if (monsters[i].alive) return true;
return false;
}
bool isEmpty() const { return monsters.empty() || !hasAlive(); }
void removeDead() {
vector<Monster> alive;
for (size_t i=0; i<monsters.size(); ++i)
if (monsters[i].alive) alive.push_back(monsters[i]);
monsters = alive;
}
void clearAll() { monsters.clear(); }
};
// ======================== 实体系统 ========================
enum EntityType { ENT_NPC, ENT_SHOP, ENT_CHEST };
struct Entity {
int x, y;
int type;
string name;
bool active;
vector<string> shopItems;
vector<int> shopPrices;
string dialogue;
bool opened;
};
// ======================== 区块 ========================
struct ChunkKey {
int cx, cy;
bool operator<(const ChunkKey& other) const {
if (cx != other.cx) return cx < other.cx;
return cy < other.cy;
}
};
struct Chunk {
Terrain terrain[CHUNK_SIZE][CHUNK_SIZE];
map<int, MonsterGroup> monsterGroups;
vector<Entity> entities;
bool generated;
Chunk() : generated(false) {}
};
map<ChunkKey, Chunk> world;
Terrain getTerrainAt(int wx, int wy) {
if (wx<0 || wx>=WORLD_SIZE || wy<0 || wy>=WORLD_SIZE) return GRASS;
int cx = wx / CHUNK_SIZE, cy = wy / CHUNK_SIZE;
int lx = wx % CHUNK_SIZE, ly = wy % CHUNK_SIZE;
ChunkKey key; key.cx=cx; key.cy=cy;
map<ChunkKey, Chunk>::iterator it = world.find(key);
if (it == world.end()) return GRASS;
return it->second.terrain[lx][ly];
}
Entity* getEntityAt(int wx, int wy) {
if (wx<0 || wx>=WORLD_SIZE || wy<0 || wy>=WORLD_SIZE) return NULL;
int cx = wx / CHUNK_SIZE, cy = wy / CHUNK_SIZE;
int lx = wx % CHUNK_SIZE, ly = wy % CHUNK_SIZE;
ChunkKey key; key.cx=cx; key.cy=cy;
map<ChunkKey, Chunk>::iterator it = world.find(key);
if (it == world.end()) return NULL;
vector<Entity>& ents = it->second.entities;
for (size_t i=0; i<ents.size(); ++i) {
if (ents[i].active && ents[i].x == wx && ents[i].y == wy)
return &ents[i];
}
return NULL;
}
MonsterGroup* getMonsterGroupAt(int wx, int wy) {
if (wx<0 || wx>=WORLD_SIZE || wy<0 || wy>=WORLD_SIZE) return NULL;
int cx = wx / CHUNK_SIZE, cy = wy / CHUNK_SIZE;
int lx = wx % CHUNK_SIZE, ly = wy % CHUNK_SIZE;
ChunkKey key; key.cx=cx; key.cy=cy;
map<ChunkKey, Chunk>::iterator it = world.find(key);
if (it == world.end()) return NULL;
int code = lx * CHUNK_SIZE + ly;
map<int, MonsterGroup>::iterator git = it->second.monsterGroups.find(code);
if (git == it->second.monsterGroups.end()) return NULL;
return &(git->second);
}
// ======================== 生成区块 ========================
void generateChunk(int cx, int cy) {
ChunkKey key; key.cx=cx; key.cy=cy;
if (world.find(key) != world.end()) return;
Chunk chunk;
chunk.generated = true;
unsigned int seed = cx * 10007 + cy * 10009;
srand(seed);
// 地形生成(大量草地,少量森林、山地、道路)
for (int x=0; x<CHUNK_SIZE; ++x) {
for (int y=0; y<CHUNK_SIZE; ++y) {
int wx = cx*CHUNK_SIZE + x;
int wy = cy*CHUNK_SIZE + y;
unsigned int h = (wx * 73856093) ^ (wy * 19349663);
h = h ^ (h >> 16);
int val = h % 100;
Terrain t = GRASS;
if (val < 65) t = GRASS;
else if (val < 82) t = FOREST;
else if (val < 92) t = MOUNTAIN;
else if (val < 96) t = PLAIN;
else if (val < 99) t = ROAD;
else t = WATER;
chunk.terrain[x][y] = t;
}
}
// 怪物群
int groupCount = 3 + (rand() % 7);
for (int g=0; g<groupCount; ++g) {
int lx = rand() % CHUNK_SIZE;
int ly = rand() % CHUNK_SIZE;
if (chunk.terrain[lx][ly] == WATER) continue;
int code = lx * CHUNK_SIZE + ly;
if (chunk.monsterGroups.find(code) != chunk.monsterGroups.end()) continue;
int count = 1 + (rand() % 4);
MonsterGroup group;
Terrain t = chunk.terrain[lx][ly];
int levelScale = 1 + (abs(cx) + abs(cy)) / 5;
for (int i=0; i<count; ++i) {
MonsterType type;
int r = rand() % 100;
if (t == FOREST) {
if (r<40) type=WOLF; else if (r<70) type=BAT; else type=SLIME;
} else if (t == MOUNTAIN) {
if (r<30) type=TROLL; else if (r<60) type=ORC; else type=SKELETON;
} else if (t == GRASS || t == PLAIN) {
if (r<40) type=SLIME; else if (r<70) type=GOBLIN; else type=WOLF;
} else {
if (r<30) type=SLIME; else if (r<60) type=BAT; else type=SKELETON;
}
group.monsters.push_back(createMonster(type, levelScale));
}
chunk.monsterGroups[code] = group;
}
// 实体:NPC(?), 商店($), 宝箱(?)
int entityCount = 1 + (rand() % 4);
for (int e=0; e<entityCount; ++e) {
int lx = rand() % CHUNK_SIZE;
int ly = rand() % CHUNK_SIZE;
if (chunk.terrain[lx][ly] == WATER) continue;
int code = lx * CHUNK_SIZE + ly;
if (chunk.monsterGroups.find(code) != chunk.monsterGroups.end()) continue;
Entity ent;
ent.x = cx*CHUNK_SIZE + lx;
ent.y = cy*CHUNK_SIZE + ly;
ent.active = true;
ent.opened = false;
int typeRand = rand() % 10;
if (typeRand < 5) {
ent.type = ENT_CHEST;
ent.name = "宝箱";
} else if (typeRand < 8) {
ent.type = ENT_NPC;
ent.name = "旅行者";
string dialogues[] = {"你好!", "前方有怪物。", "附近有宝箱。", "探索愉快。"};
ent.dialogue = dialogues[rand() % 4];
} else {
ent.type = ENT_SHOP;
ent.name = "商人";
ent.dialogue = "来买卖吧!";
ent.shopItems.push_back("小红瓶");
ent.shopPrices.push_back(10);
ent.shopItems.push_back("大药水");
ent.shopPrices.push_back(30);
ent.shopItems.push_back("攻击卷轴");
ent.shopPrices.push_back(50);
ent.shopItems.push_back("防御护符");
ent.shopPrices.push_back(40);
}
chunk.entities.push_back(ent);
}
world[key] = chunk;
}
void ensureChunksAround(int wx, int wy) {
int cx = wx / CHUNK_SIZE, cy = wy / CHUNK_SIZE;
for (int dx=-2; dx<=2; ++dx)
for (int dy=-2; dy<=2; ++dy)
if (world.find(ChunkKey{cx+dx, cy+dy}) == world.end())
generateChunk(cx+dx, cy+dy);
}
// ======================== 玩家 ========================
struct Player {
int x, y;
int hp, maxHp;
int atk, def;
int level, exp, maxExp;
int gold;
string name;
vector<string> inventory;
int weaponBonus, armorBonus;
Player() : x(WORLD_SIZE/2), y(WORLD_SIZE/2), hp(30), maxHp(30),
atk(4), def(2), level(1), exp(0), maxExp(10),
gold(20), name("勇者"), weaponBonus(0), armorBonus(0) {}
};
Player player;
// ======================== 战斗系统 ========================
void battleMonsterGroup(MonsterGroup* group) {
if (!group) return;
group->removeDead();
if (group->monsters.empty()) return;
vector<Monster> monsters = group->monsters;
system("cls");
setColor(12);
cout << "?? 遭遇怪物群!共 " << monsters.size() << " 只! ??" << endl;
setColor(7);
cout << "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" << endl;
while (player.hp > 0) {
for (size_t i=0; i<monsters.size(); ++i) {
if (monsters[i].alive) {
setColor(12);
cout << "[" << i+1 << "] ";
setColor(7);
cout << monsters[i].name << " HP:" << monsters[i].hp << "/" << monsters[i].maxHp << endl;
}
}
setColor(10);
cout << "你的 HP: " << player.hp << "/" << player.maxHp << " 金币: " << player.gold << endl;
setColor(7);
cout << "[1]攻击 [2]防御 [3]物品 [4]逃跑" << endl;
char choice = _getch();
cout << choice << endl;
if (choice == '4') {
if (rand()%2==0) { setColor(10); cout<<"成功逃跑!"<<endl; setColor(7); _getch(); return; }
else { setColor(12); cout<<"逃跑失败!"<<endl; setColor(7); }
}
if (choice == '1') {
setColor(10); cout<<"选择目标: "; setColor(7);
char tc = _getch(); cout<<tc<<endl;
int idx = tc - '1';
if (idx>=0 && idx<(int)monsters.size() && monsters[idx].alive) {
int damage = player.atk + player.weaponBonus + rand()%3 - monsters[idx].def;
if (damage<1) damage=1;
monsters[idx].hp -= damage;
setColor(11); cout<<"对 "<<monsters[idx].name<<" 造成 "<<damage<<" 伤害!"<<endl; setColor(7);
if (monsters[idx].hp <= 0) {
monsters[idx].alive = false;
setColor(14); cout<<"击败 "<<monsters[idx].name<<"!获得 "<<monsters[idx].exp<<" 经验"<<endl; setColor(7);
player.exp += monsters[idx].exp;
int goldDrop = 2 + rand() % 6;
player.gold += goldDrop;
setColor(11); cout<<"获得 "<<goldDrop<<" 金币"<<endl; setColor(7);
while (player.exp >= player.maxExp) {
player.exp -= player.maxExp;
player.level++;
player.maxExp = player.level*10 + 5;
player.maxHp += 5;
player.hp = player.maxHp;
player.atk += 2;
player.def += 1;
setColor(13); cout<<"? 升级!等级 "<<player.level<<"!"<<endl; setColor(7);
}
}
} else { setColor(14); cout<<"无效目标!"<<endl; setColor(7); continue; }
} else if (choice == '2') {
int heal = 2 + rand()%4;
player.hp += heal;
if (player.hp>player.maxHp) player.hp=player.maxHp;
setColor(11); cout<<"防御恢复 "<<heal<<" HP"<<endl; setColor(7);
} else if (choice == '3') {
if (player.inventory.empty()) { setColor(14); cout<<"背包空"<<endl; setColor(7); continue; }
setColor(10); cout<<"物品: ";
for (size_t i=0; i<player.inventory.size(); ++i) cout<<"["<<i+1<<"]"<<player.inventory[i]<<" ";
cout<<endl; setColor(7);
cout<<"选择 (0取消): ";
char ic = _getch(); cout<<ic<<endl;
int idx = ic - '1';
if (idx>=0 && idx<(int)player.inventory.size()) {
string item = player.inventory[idx];
if (item=="小红瓶") { player.hp+=15; if(player.hp>player.maxHp) player.hp=player.maxHp; setColor(11); cout<<"使用小红瓶,+15HP"<<endl; setColor(7); player.inventory.erase(player.inventory.begin()+idx); }
else if (item=="大药水") { player.hp+=30; if(player.hp>player.maxHp) player.hp=player.maxHp; setColor(11); cout<<"使用大药水,+30HP"<<endl; setColor(7); player.inventory.erase(player.inventory.begin()+idx); }
else if (item=="攻击卷轴") { player.weaponBonus += 2; setColor(11); cout<<"攻击永久+2"<<endl; setColor(7); player.inventory.erase(player.inventory.begin()+idx); }
else if (item=="防御护符") { player.armorBonus += 2; setColor(11); cout<<"防御永久+2"<<endl; setColor(7); player.inventory.erase(player.inventory.begin()+idx); }
else { setColor(14); cout<<"无法使用"<<endl; setColor(7); }
}
}
// 怪物反击
for (size_t i=0; i<monsters.size(); ++i) {
if (!monsters[i].alive) continue;
int damage = monsters[i].atk + rand()%3 - player.def - player.armorBonus;
if (damage<1) damage=1;
player.hp -= damage;
setColor(12); cout<<monsters[i].name<<" 反击造成 "<<damage<<" 伤害!"<<endl; setColor(7);
if (player.hp <= 0) { setColor(12); cout<<"?? 你死了..."<<endl; setColor(7); _getch(); return; }
}
bool allDead=true;
for (size_t i=0; i<monsters.size(); ++i) if(monsters[i].alive) { allDead=false; break; }
if (allDead) {
setColor(14); cout<<"?? 战斗胜利!"<<endl; setColor(7);
group->clearAll();
_getch(); return;
}
cout<<"━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"<<endl;
}
}
// ======================== 交互系统 ========================
void interactWithEntity(Entity* ent) {
if (!ent || !ent->active) return;
system("cls");
if (ent->type == ENT_NPC) {
setColor(13);
cout << "?? " << ent->name << " 说: " << ent->dialogue << endl;
setColor(7);
cout << "按任意键继续..." << endl;
_getch();
} else if (ent->type == ENT_SHOP) {
setColor(14);
cout << "?? " << ent->name << " 的商店" << endl;
setColor(7);
cout << "你的金币: " << player.gold << endl;
cout << "商品列表:" << endl;
for (size_t i=0; i<ent->shopItems.size(); ++i) {
cout << " [" << i+1 << "] " << ent->shopItems[i] << " - " << ent->shopPrices[i] << " 金币" << endl;
}
cout << " [0] 离开" << endl;
cout << "选择: ";
char c = _getch(); cout << c << endl;
int idx = c - '1';
if (idx >= 0 && idx < (int)ent->shopItems.size()) {
if (player.gold >= ent->shopPrices[idx]) {
player.gold -= ent->shopPrices[idx];
player.inventory.push_back(ent->shopItems[idx]);
setColor(11);
cout << "购买了 " << ent->shopItems[idx] << "!" << endl;
setColor(7);
} else {
setColor(12);
cout << "金币不足!" << endl;
setColor(7);
}
}
cout << "按任意键继续..." << endl;
_getch();
} else if (ent->type == ENT_CHEST) {
if (ent->opened) {
setColor(14);
cout << "宝箱已经空了。" << endl;
setColor(7);
_getch();
return;
}
setColor(14);
cout << "?? 打开宝箱!" << endl;
ent->opened = true;
int reward = rand() % 100;
if (reward < 50) {
int gold = 10 + rand() % 30;
player.gold += gold;
setColor(11);
cout << "获得 " << gold << " 金币!" << endl;
} else if (reward < 80) {
player.inventory.push_back("小红瓶");
setColor(11);
cout << "获得 小红瓶!" << endl;
} else {
player.inventory.push_back("大药水");
setColor(11);
cout << "获得 大药水!" << endl;
}
setColor(7);
_getch();
}
}
// ======================== 渲染 ========================
void render() {
system("cls");
setColor(14);
cout << "=== 大世界探索 ===";
setColor(10);
cout << " Lv." << player.level << " HP:" << player.hp << "/" << player.maxHp;
setColor(13);
cout << " 经验:" << player.exp << "/" << player.maxExp;
setColor(11);
cout << " 金币:" << player.gold;
setColor(7);
cout << " (" << player.x << "," << player.y << ")" << endl;
setColor(8);
cout << "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" << endl;
int startX = player.x - VIEW_RADIUS;
int startY = player.y - VIEW_RADIUS;
for (int wy = startY; wy <= player.y + VIEW_RADIUS; ++wy) {
for (int wx = startX; wx <= player.x + VIEW_RADIUS; ++wx) {
if (wx<0 || wx>=WORLD_SIZE || wy<0 || wy>=WORLD_SIZE) {
setColor(8); cout << ' ';
continue;
}
if (wx == player.x && wy == player.y) {
setColor(11); cout << '@';
continue;
}
// 实体优先显示(符号全ASCII)
Entity* ent = getEntityAt(wx, wy);
if (ent && ent->active) {
if (ent->type == ENT_NPC) { setColor(13); cout << 'N'; }
else if (ent->type == ENT_SHOP) { setColor(14); cout << '$'; }
else if (ent->type == ENT_CHEST) {
if (ent->opened) { setColor(8); cout << '?'; }
else { setColor(15); cout << '?'; }
}
continue;
}
MonsterGroup* mg = getMonsterGroupAt(wx, wy);
if (mg && mg->hasAlive()) {
setColor(12);
cout << mg->monsters[0].symbol;
continue;
}
Terrain t = getTerrainAt(wx, wy);
setColor(getTerrainColor(t));
cout << getTerrainChar(t);
}
cout << endl;
}
setColor(7);
cout << "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" << endl;
setColor(10);
cout << "WASD移动 | E交互 | I背包 | Q退出" << endl;
setColor(7);
}
// ======================== 背包 ========================
void showInventory() {
system("cls");
setColor(14);
cout << "=== 背包 ===" << endl;
setColor(7);
cout << "HP:" << player.hp << "/" << player.maxHp
<< " 攻击:" << player.atk+player.weaponBonus
<< " 防御:" << player.def+player.armorBonus << endl;
cout << "金币:" << player.gold << " 等级:" << player.level << endl;
setColor(10);
cout << "物品 (" << player.inventory.size() << "):" << endl;
setColor(7);
if (player.inventory.empty()) cout << " (空)" << endl;
else for (size_t i=0; i<player.inventory.size(); ++i)
cout << " " << i+1 << ". " << player.inventory[i] << endl;
setColor(14);
cout << "按任意键返回..." << endl;
setColor(7);
_getch();
}
// ======================== 主循环 ========================
void gameLoop() {
char key;
while (player.hp > 0) {
ensureChunksAround(player.x, player.y);
render();
key = _getch();
int dx=0, dy=0, move=0;
switch(key) {
case 'w': case 'W': dy=-1; move=1; break;
case 's': case 'S': dy=1; move=1; break;
case 'a': case 'A': dx=-1; move=1; break;
case 'd': case 'D': dx=1; move=1; break;
case 'e': case 'E': {
Entity* ent = getEntityAt(player.x, player.y);
if (ent) interactWithEntity(ent);
else { setColor(14); gotoxy(0, VIEW_RADIUS*2+2); cout<<"这里没有可交互的东西。"; setColor(7); Sleep(500); }
break;
}
case 'i': case 'I': showInventory(); break;
case 'q': case 'Q': return;
default: break;
}
if (move) {
int nx = player.x + dx;
int ny = player.y + dy;
if (nx<0 || nx>=WORLD_SIZE || ny<0 || ny>=WORLD_SIZE) {
setColor(14); gotoxy(0, VIEW_RADIUS*2+2); cout<<"边界!"; setColor(7); Sleep(300);
continue;
}
Terrain t = getTerrainAt(nx, ny);
if (t == WATER) {
setColor(14); gotoxy(0, VIEW_RADIUS*2+2); cout<<"不能进入水域!"; setColor(7); Sleep(300);
continue;
}
MonsterGroup* mg = getMonsterGroupAt(nx, ny);
if (mg && mg->hasAlive()) {
battleMonsterGroup(mg);
if (player.hp <= 0) { setColor(12); cout<<"\n游戏结束!"; setColor(7); _getch(); return; }
player.x = nx; player.y = ny;
} else {
player.x = nx; player.y = ny;
}
}
}
}
// ======================== 菜单 ========================
void showMenu() {
system("cls");
setColor(14);
cout << "╔═══════════════════════════════════╗" << endl;
cout << "║ ?? 大世界探索游戏 ║" << endl;
cout << "║ (1000x1000 开放世界) ║" << endl;
cout << "║ NPC(N) · 商店($) · 宝箱(?) ║" << endl;
cout << "╚═══════════════════════════════════╝" << endl;
setColor(7);
cout << "[1] 开始游戏" << endl;
cout << "[2] 退出" << endl;
cout << "选择: ";
char c = _getch();
if (c == '1') {
player = Player();
ensureChunksAround(player.x, player.y);
gameLoop();
} else exit(0);
}
// ======================== main ========================
int main() {
srand((unsigned)time(0));
hideCursor();
showMenu();
return 0;
}
这里空空如也




















有帮助,赞一个