C语语言言实实现现宾宾果果消消消消乐乐
本文实例为大家分享了C语言宾果消消乐的具体代码,供大家参考,具体内容如下
```c
#include
#include
#include
#include
#include
#include
#define MAPSIZ 10
int map[MAPSIZ ][MAPSIZ ];
int map2[MAPSIZ ][MAPSIZ ];
bool state[MAPSIZ ][MAPSIZ ];
bool state1[MAPSIZ ][MAPSIZ ];
typedef struct game
{
int game_state;
int counts;
int score;
int targets;
int level;
int state;
int level_state;
int tool_number;
int tool_state;
int start_state;
PIMAG img[21];
} Game;
Game game;
int high=0;
void init_img()
{
int i;
for(i=0; i<21; i++)
game.img[i]=newimage();
getimage(game.img[0],"game\\underground.jpg");
getimage(game.img[1],"game\\red.jpg");
getimage(game.img[2],"game\\green.jpg");
getimage(game.img[3],"game\\blue.jpg");
getimage(game.img[4],"game\\orange.jpg");
getimage(game.img[5],"game\\purple.jpg");
getimage(game.img[6],"game\\brown.jpg");
getimage(game.img[7],"game\\123.jpg");
getimage(game.img[8],"game\\end.jpg");
getimage(game.img[9],"game\\bomb.jpg");
getimage(game.img[10],"game\\win.png");
getimage(game.img[11],"game\\hon.jpg");
getimage(game.img[12],"game\\lu.jpg");
getimage(game.img[13],"game\\lan.jpg");
getimage(game.img[14],"game\\cheng.jpg");
getimage(game.img[15],"game\\zi.jpg");
getimage(game.img[16],"game\\hui.jpg");
getimage(game.img[17],"game\\receive.png");
getimage(game.img[18],"game\\in.jpg");
getimage(game.img[19],"game\\black.jpg");
getimage(game.img[20],"game\\start.jpg");
}
void init_map()
{
int i,j;
srand(time(0));
for (i=0; i
for (j=0; j
{