📄 character.h
字号:
// Character.h
//
// Base class with common data and behaviour for pacman and ghosts
//
/////////////////////////////////////////////////////////////////////////////
#ifndef _CHARACTER_H_
#define _CHARACTER_H_
#include "../Types.h"
#include "Path.h"
class Character
{
// fields
public:
// position and orientation
Orientation orientation;
int posX, posY;
int tilePosX, tilePosY;
int movOffsX, movOffsY;
// sprite number, color and attributes
int sprite, color;
int priority;
bool flipX, flipY;
// flags
bool hasToChangeOrientation;
// methods
protected:
bool checkWrapAround();
virtual void selectProperAnimation() = 0;
virtual void draw() = 0;
// initialization and cleanup
Character();
virtual ~Character();
virtual void resetState();
virtual void initState(bool special) = 0;
};
#endif // _CHARACTER_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -