吃豆人C语言源代码
#include "graphics.h"#include "stdlib.h" #include "dos.h" #include "bios.h"#include "stdio.h"#include "time.h"#include "graphics.h"#include "conio.h"#define LEFT 0x4b00 #define RIGHT 0x4d00 #define DOWN 0x5000 #define UP 0x4800 #define ESC 0x011b #define ENTER 0x1c0d#define SPACE 0x3920 /*游戏中人物的结构体*/ struct play{ int x;int y; }; struct Snow{int x;int y;int speed;}snow[100];intsnownum=0;struct play you,them[5]; void *save;int sum=0;/*统计吃的豆子个数,吃满50颗就算胜利*/int change=10;/*0豆子,1空地2,墙壁,3自己,4敌人*/int a[15][20]={2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,1,1,0,0,0,0,0,1,0,0,0,1,1,1,1,1,1,0,2, 2,1,2,2,2,1,1,2,1,1,0,0,0,1,1,4,1,1,0,2, 2,1,1,0,2,1,1,2,0,1,1,2,2,2,2,2,0,0,0,2, 2,4,1,0,2,1,1,2,1,1,1,0,1,1,1,1,0,1,1,2, 2,1,2,1,2,1,1,2,1,3,2,2,1,1,1,1,2,2,1,2, 2,1,2,1,2,1,1,1,1,1,1,1,1,0,0,0,1,1,1,2, 2,1,2,1,0,1,1,1,1,2,1,0,1,2,2,2,1,1,1,2, 2,1,0,1,0,1,2,1,1,2,1,0,1,2,1,1,4,1,1,2, 2,1,0,2,0,1,2,1,1,2,1,0,1,2,1,1,1,1,1,2, 2,1,0,2,1,1,2,1,1,2,1,0,2,2,1,0,0,0,1,2, 2,1,1,2,1,1,2,1,1,2,1,0,2,1,1,2,2,1,1,2, 2,1,2,2,1,2,2,1,1,1,1,0,1,4,1,2,0,0,1,2, 2,1,0,0,0,0,0,4,0,1,1,0,1,1,1,1,0,0,1,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}; /*数组就是地图( level 1)*/ ;int b[15][20]={2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,1,1,0,0,0,0,0,1,0,0,0,1,1,1,1,1,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