这是一个Game游戏库,定义了一些适合用来做游戏的函数,原框架来源于C++RPG游戏2.1.01测试版《末日之战1:新生》(by YXCJ_岩心_尘寂的博客-优快云博客中的cj.h库,并且我将部分函数修改了一下,又加了几个函数。下面是源代码,有需要的可以拷走(最近也在编写C++RPG游戏):
// Game.h v1.0(适用于C++97编译环境)(Dev-C++编译环境)
// Dev-C++ 如何使用C++11?点击上面的工具->编译选项->代码生成/优化->代码生成:->语言标准(-std)->ISO C++11
#pragma once
#include <iostream>
#include <string>
#include <cstdlib>
#include <ctime>
#include <windows.h>
#include <conio.h>
using namespace std;
void rect(int left, int top, int right, int bottom, string text);//在屏幕上画出一个矩形,左上角坐标是(left, top),右下角坐标是(right, bottom),矩形填充内容为 text 。
void cursor(SHORT x, SHORT y);//将光标移动到屏幕的(x, y)处。
void color(int color_num);//设置屏幕上文字的颜色。
int random(int min, int max);//生成一个 min 到 max 之间的随机数。
void typeout(string text);//在屏幕上打印字符串 text ,每个字符输出之间间隔为

最低0.47元/天 解锁文章
1793

被折叠的 条评论
为什么被折叠?



