c语言编写贪吃蛇

时间:2017-03-17 10:57:24
【文件属性】:
文件名称:c语言编写贪吃蛇
文件大小:546KB
文件格式:DOC
更新时间:2017-03-17 10:57:24
贪吃蛇 c语言 用c语言开发贪吃蛇小游戏的源代码 #include #include #include #include #include /*蛇的最大节数*/ #define MAX 200 #define LEFT 10 #define TOP 2 #define RIGHT 50 #define BOTTOM 23 #define TIME 0x1c /*时钟中断点*/ #define VK_UP 0x4800 #define VK_DOWN 0x5000 #define VK_LEFT 0x4b00 #define VK_RIGHT 0x4d00 #define ESC 0x11b #define randx() (rand()%(RIGHT-LEFT-1))+LEFT+1 #define randy() (rand()%(BOTTOM-TOP-1))+TOP+1 int iScore=0; /*分数*/ int iTimeCount=0;/*记录时钟中断*/ /*定义蛇节的结构*/ struct snakenode { int x; int y; };

网友评论