C语言简单可用的贪吃蛇游戏.doc

C语言简单可用的贪吃蛇游戏概要1

// 作者:莫智豪 // 名称:贪吃蛇游戏 // 绝对绚丽、可用的贪吃蛇游戏,欢迎参考和指点 #includeiostream #includegraphics.h #includeconio.h #includetime.h #define UP 1 #define DOWN 2 #define LEFT 3 #define RIGHT 4 //格子类 class Cell { private: short m_x; short m_y; short m_full; //0为空,1为阻挡,2为食物 COLORREF m_color; //格子的颜色 public: friend class GameArea; void setxy(short x,short y) { m_x=x; m_y=y; } void setfull(short full) { m_full=full; } void display(COLORREF color) { m_color=color; setfillstyle(m_color); bar(m_x,m_y,m_x+7,m_y+7); } void laserDisplay() //显示镭射状态的格子 { IMAGE image

文档评论(0)

1亿VIP精品文档

相关文档