本文实例为大家分享了C语言宾果消消乐的具体代码,供大家参考,具体内容如下
' ' ' c # include# include # include # include & lt; conio.h> # include # include #定义MAPSIZE 10 int地图[MAPSIZE] [MAPSIZE]; int map2 [MAPSIZE] [MAPSIZE]; bool状态[MAPSIZE] [MAPSIZE]; bool state1 [MAPSIZE] [MAPSIZE]; typedef结构游戏 { int game_state; int数; int分数; int目标; 智力水平; int状态; int level_state; int tool_number; int tool_state; int start_state; PIMAGE img [21]; }游戏; 游戏游戏; int高=0; 空白init_img () { int我; (我=0;i<21;我+ +) game.img[我]=newimage (); getimage (game.img[0],“游戏\ \ underground.jpg”); getimage (game.img[1],“游戏\ \ red.jpg”); getimage (game.img[2],“游戏\ \ green.jpg”); getimage (game.img[3],“游戏\ \ blue.jpg”); getimage (game.img[4],“游戏\ \ orange.jpg”); getimage (game.img[5],“游戏\ \ purple.jpg”); getimage (game.img[6],“游戏\ \ brown.jpg”); getimage (game.img[7],“游戏\ \ 123. jpg”); getimage (game.img[8],“游戏\ \ end.jpg”); getimage (game.img[9],“游戏\ \ bomb.jpg”); getimage (game.img[10],“游戏\ \ win.png”); getimage (game.img[11],“游戏\ \ hon.jpg”); getimage (game.img[12],“游戏\ \ lu.jpg”); getimage (game.img[13],“游戏\ \ lan.jpg”); getimage (game.img[14],“游戏\ \ cheng.jpg”); getimage (game.img[15],“游戏\ \ zi.jpg”); getimage (game.img[16],“游戏\ \ hui.jpg”); getimage (game.img[17],“游戏\ \ receive.png”); getimage (game.img[18],“游戏\ \ in.jpg”); getimage (game.img[19],“游戏\ \ black.jpg”); getimage (game.img[20],“游戏\ \ start.jpg”); } 空白init_map () { int i, j。 将srand(时间(0)); (我=0;i 高) { 高=game.score; 保存(和高); } putimage (0, 0, game.img [0]); setfont(30 0“隶书”); 改变颜色(EGERGB (250、210、0)); setbkmode(透明); outtextxy(10、15,“最高记录:”); 现年55岁的outtextxy(10“关卡:”); outtextxy(150年,55岁,“目标分:”); sprintf (str,“% 4 d”, game.level); sprintf (str1“% 4 d”,高); sprintf (“% 4 d”, str2 game.targets); sprintf(分数,“% 4 d”, game.score); sprintf (str3“% d”, game.tool_number); 改变颜色(EGERGB (255、255、255)); 现年55岁的outtextxy (60 str); str1 outtextxy(150年,15日); outtextxy(260年,55岁,str2); outtextxy(205、102、分数); setfont(25日0时,“隶书”); outtextxy (410、1、str3); } 空白show_map () { 如果(game.level_state==1) show_level (); show_word (); int i, j。 (我=0;i C语言实现宾果消消乐