连连看c语言源程序,连连看C语言源代码(国外英语资料).doc

连连看C语言源代码(国外英语资料)

连连看C语言源代码

/ *

* 连连看游戏c语言源代码

* /

# stdio.h > in <

# graphics.h > in <

# stdlib.h > in <

# math.h > in <

# dos.h > in <

# define true 1

# define false 0

/ * --------------------- 全局变量 ------------------------------------ * /

int bkgndcolor = black;

int bordercolor = lightgray;

int linecolor = lightblue 消除一对方块时时候的连线颜色; / * * /

/ * pb progressbar * /

int pbcolor = lightgreen;

int pby = 4;

int pbheight = 4;

int pbvalue; / * 进度条百分比, 初始值为100. * /

long starttime; / * 开始时间的秒数, 只统计分钟, 秒 * /

long totaltime; / * 游戏总共的最大秒数! * /

/ * boarddatas: small size board * /

/ * board [x] [s] [0] - 0: empty, 1) * /

/ * board [x] [s] [1] - cell's key; * /

unsigned char board [10] [10] [2];

int cellsize = 30;

int boardx = 20;

int boards = 60;

int boardwidth = 10;

int boardheight = 10;

int cellcolor = white;

int selcolor = blue; / * selcell's border rect color * /

int curcolor = red; / * curcell's border rect color * /

int eracolor = cyan; / * 用于擦除cell的颜色! * /

int pairscount; / * how much english we have put on board * /

/ * 用于存储逻辑坐标 (索引) * /

typedef struct _ tagcell

{

char x;

char y;

} cell;

cell selcell, curcell; / * 缓存前一个被选中的位置以及当前所处位置! * /

/ * scan codes define * /

keycodes enum

{

to _ esc = 0x011b,

to _ up = 0x4800, / * upward arrow * /

to _ left = 0x4b00,

to _ down = 0x5000,

to _ right = 0x4d00,

to _ space = 0x3920,

to _ p = 0x1970,

to _ return = 0x1c0d, / * and * /

};

/ * --------------------- 函数列表 ------------------------------------ * /

void initgame (char * bgipath);

playgame (void);

quitgame (void);

initprogressbar (void);

void updateprogressbar (int percent);

void drawcell (int key, int x, int y, int color);

void erasecell (int x, int y);

void drawborderrect (cell * c, int color);

void drawgameover (char * info);

int getkeycode ();

int findpath (cell * c1, cell * c2);

/ * 绘制消除方块时候的连接路径, 用指定颜色! * /

void drawpath (int x1, y1, x2 (int, int, int y2, int x, int y3 x4, int, int y4, int color);

/ * movie 函数实现 ----------------------------------- * /

/ * movie [核心算法] ----------------------

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值