本文整理汇总了C++中Character::GetSpeed方法的典型用法代码示例。如果您正苦于以下问题:C++ Character::GetSpeed方法的具体用法?C++ Character::GetSpeed怎么用?C++ Character::GetSpeed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Character
的用法示例。
在下文中一共展示了Character::GetSpeed方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GeradMoveLeft
bool GeradMoveLeft(float &x, float &y)
{
x -= Gerad.GetSpeed();
if(Timer->elapsed(walkTimer, STOPTIME))
{
Gerad.Setxy(x, y);
walkTimer = Timer->time();
}
for(int i = 0;i < currentLocation->ObjectNum;i++)
{
if(currentLocation->objects[i].IsWithin(x, y))
{
x += Gerad.GetSpeed();
Gerad.SetStopStatus();
Gerad.Setxy(x, y);
return true;
}
}
if(x <= 0)
if(currentLocation->left != NULL)
{
currentLocation = currentLocation->left;
x = 462;
background.load(currentLocation->getName());
background.loadGLTextures();
}
else {x = 0; Gerad.SetStopStatus();}
if(Timer->elapsed(walkTimer, STOPTIME))
{
Gerad.Setxy(x, y);
walkTimer = Timer->time();
}
return true;
}
示例2: GeradMoveBack
bool GeradMoveBack(float &x, float &y)
{
y -= Gerad.GetSpeed();
if(Timer->elapsed(walkTimer, STOPTIME))
{
Gerad.Setxy(x, y);
walkTimer = Timer->time();
}
for(int i = 0;i < currentLocation->ObjectNum;i++)
{
if(currentLocation->objects[i].IsWithin(x, y))
{
y += Gerad.GetSpeed();
Gerad.SetStopStatus();
Gerad.Setxy(x, y);
return true;
}
}
if(y <= 0)
{
if(currentLocation->top != NULL)
{
currentLocation = currentLocation->top;
if(topInterior)InInterior = true;
y = 462;
background.load(currentLocation->getName());
background.loadGLTextures();
}
else
{
y = 0;
Gerad.SetStopStatus();
}
}
if(Timer->elapsed(walkTimer, STOPTIME))
{
Gerad.Setxy(x, y);
walkTimer = Timer->time();
}
return true;
}