📄 snakemodel.h
字号:
// SnakeModel.h: interface for the CSnakeModel class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_SNAKEMODEL_H__28F79033_A4D9_4C68_8CD4_FBEA000AB0BF__INCLUDED_)
#define AFX_SNAKEMODEL_H__28F79033_A4D9_4C68_8CD4_FBEA000AB0BF__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define FRMWIDTH 20
#define FRMHEIGHT 8
#define BODYWIDTH 10
#define MAXLEN 400
#define MAX 20
#define INITLAN 6
#define UP 2
#define DOWN 4
#define LEFT 1
#define RIGHT 3
class CSnakeModel
{
public:
CSnakeModel();
virtual ~CSnakeModel();
int moveOn();
int eatFood();
int eatMovFood();
int eatExtFood();
void reset();
void changeDirection(int newDirection);
void addBody();
void moveBody();
void setMazes();
void setMazes(int num);
void setSpeed();
void setSpeed(int num);
void noMazes();
void box();
void tunnel();
void spiral();
void blockade();
void twisted();
void initSnake();
void levelUp();
void movMovFood();
bool isBody(int x,int y);
POINT createFood();
POINT createExtFood();
POINT createStone();
POINT createMovFood();
POINT body[MAXLEN];
POINT food;
POINT extFood;
POINT stone;
POINT movFood;
bool matrix[MAX][MAX];
bool canChangeDirection;
bool hasTongue;
int snakeLan;
int direction;
int score;
int numFood;
int speed;
int extModeLevel;
int mfDirection;
int efType;
int step;
};
#endif // !defined(AFX_SNAKEMODEL_H__28F79033_A4D9_4C68_8CD4_FBEA000AB0BF__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -