小游戏的C++代码

来源:百度知道 编辑:UC知道 时间:2024/05/04 11:23:11
需要很小很小的小游戏的C++代码研究下

/*===========================Program Description==========================*/
/*程序名称:game.c */
/*程序目的:打砖块游戏演示 */
/*written by :董大钿 */
/*========================================================================*/

#include "graphics.h"
#include "stdio.h"
#include "conio.h" /*所需的头文件*/

int on; /*声明具有开关作用的全局变量*/
static int score; /*声明静态的记分器变量*/

/* 定义开始界面函数*/

int open()
{
setviewport(100,100,500,380,1); /*设置图形窗口区域*/
setcolor(4); /*设置作图色*/
rectangle(0,0,399,279); /*以矩形填充所设的图形窗口区域*/
setfillstyle(SOLID_FILL,7); /*设置填充方式*/
floodfill(50,50,4); /*设置填充范围*/
setcolor(8);
settextstyle(0,0,9); /*文本字体设置*/
outtextxy(90,80,"BALL"); /*输出文本内容*/
settextstyle(0,0,1);
outtextxy(110,180,"version 1.0");
outtextxy(110,190,"made by ddt");
setcolor(128);
settextstyle(0,0,1);
out