character.cpp
来自「VIGASOCO (VIdeo GAmes SOurce COde) Windo」· C++ 代码 · 共 56 行
CPP
56 行
// Character.cpp
//
/////////////////////////////////////////////////////////////////////////////
#include "Character.h"
/////////////////////////////////////////////////////////////////////////////
// initialization and cleanup
/////////////////////////////////////////////////////////////////////////////
Character::Character()
{
}
Character::~Character()
{
}
void Character::resetState()
{
orientation = (Orientation)0;
posX = posY = 0;
tilePosX = tilePosY = 0;
movOffsX = movOffsY = 0;
sprite = color = priority = 0;
flipX = flipY = false;
}
/////////////////////////////////////////////////////////////////////////////
// methods
/////////////////////////////////////////////////////////////////////////////
// processes wraparound cases and return true if it has happened or it's close to happen
bool Character::checkWrapAround()
{
// check if wraparound is going to happen on the right side
if (tilePosX == 0x1d){
tilePosX = 0x3d;
return true;
}
// check if wraparound is going to happen on the left side
if (tilePosX == 0x3e){
tilePosX = 0x1e;
return true;
}
// if the position is near the sides, return true
if ((tilePosX < 0x21) || (tilePosX >= 0x3b)){
return true;
}
return false;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?