行业知识
C++ 小游戏3个 [免费复制源码]
2026-11-06 03:46:26
来源:互联网转载
今天为大家准备了3个C++小游戏,第一次写博文,希望大家多多支持!
1.贪吃蛇
#include #include #include #include #include #include #include using namespace std;HANDLE hout=GetStdHandle(STD_OUTPUT_HANDLE);COORD coord; void locate(int x,int y){ coord.X=y; coord.Y=x; SetConsoleCursorPosition(hout,coord);};void hide(){ CONSOLE_CURSOR_INFO cursor_info={1,0}; SetConsoleCursorInfo(hout, &cursor_info);}double random(double start, double end){ return start+(end-start)*rand()/(RAND_MAX + 1.0);} int m,n; struct node{ int x,y;}snake[1000]; int snake_length,dir;node food;int direct[4][2]={{-1,0},{1,0},{0,-1},{0,1}}; /*** 输出墙 ***/void print_wall(){ cout
上一篇:国际服怎么开启服务器权限?
下一篇:mc服务器怎么创建角色?