本文整理汇总了C++中Display::getTileRefAt方法的典型用法代码示例。如果您正苦于以下问题:C++ Display::getTileRefAt方法的具体用法?C++ Display::getTileRefAt怎么用?C++ Display::getTileRefAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Display
的用法示例。
在下文中一共展示了Display::getTileRefAt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LOGIC
void LOGIC(Timer& InputCoolDown, Display& game)
{
Player& player = game::pHandler.getLocalPlayer();
HANDLE h = GetActiveWindow();
HANDLE focus = GetFocus();
//if (h != focus) { return; }
if(InputCoolDown.Update()==true)
{
/* Movement */
////////////////////////////////////////////////
/*if(GetAsyncKeyState('W'))
{
game::player.moveHandUp(game);
InputCoolDown.StartNewTimer(0.075);
}else if(GetAsyncKeyState('S'))
{
game::player.moveHandDown(game);
InputCoolDown.StartNewTimer(0.075);
}else if(GetAsyncKeyState('A'))
{
game::player.moveHandLeft(game);
InputCoolDown.StartNewTimer(0.075);
}else if(GetAsyncKeyState('D'))
{
game::player.moveHandRight(game);
InputCoolDown.StartNewTimer(0.075);
}*/
for (int x = 0; x < 3; x++)
{
if (kbhit())
{
int key = getch();
if (key == 224)
key = getch();
switch (key)
{
case 'w':player.moveHandUp(game); InputCoolDown.StartNewTimer(0.075); break;
case 's':player.moveHandDown(game); InputCoolDown.StartNewTimer(0.075); break;
case 'a':player.moveHandLeft(game); InputCoolDown.StartNewTimer(0.075); break;
case 'd':player.moveHandRight(game); InputCoolDown.StartNewTimer(0.075); break;
case 'j':game::SlideUI.addSlide("Testing"); InputCoolDown.StartNewTimer(0.075); break;
case 'y':player.spawnTurret(Position(10, 10)); InputCoolDown.StartNewTimer(0.075); break;
case 't':InputCoolDown.StartNewTimer(0.075); break;
case 'm':game::server.SendLiteral("12\n9\nTesting"); InputCoolDown.StartNewTimer(0.075); break;
case 'c':player.purchaseTurret(); InputCoolDown.StartNewTimer(0.075); break;
case 72:player.mineUp(game); InputCoolDown.StartNewTimer(0.075); break;
case 80:player.mineDown(game); InputCoolDown.StartNewTimer(0.075); break;
case 75:player.mineLeft(game); InputCoolDown.StartNewTimer(0.075); break;
case 77:player.mineRight(game); InputCoolDown.StartNewTimer(0.075); break;
default: break;
}
}
else
x = 3;
}
////////////////////////////////////////////////
/* Mining */
////////////////////////////////////////////////
/*if (GetAsyncKeyState(VK_UP))
{
game::player.mineUp(game);
InputCoolDown.StartNewTimer(0.075);
}else if (GetAsyncKeyState(VK_DOWN))
{
game::player.mineDown(game);
InputCoolDown.StartNewTimer(0.075);
}else if (GetAsyncKeyState(VK_LEFT))
{
game::player.mineLeft(game);
InputCoolDown.StartNewTimer(0.075);
}else if (GetAsyncKeyState(VK_RIGHT))
{
game::player.mineRight(game);
InputCoolDown.StartNewTimer(0.075);
}*/
////////////////////////////////////////////////
Position pos = player.getHandPosition();
if(GetAsyncKeyState('F'))
{
game.getTileRefAt(pos).isFortified(true);
InputCoolDown.StartNewTimer(0.075);
}
if(GetAsyncKeyState(VK_SPACE))
{
if (game.isWalkableTileNear(pos))
{
game.getTileRefAt(pos).mine(10, player);
InputCoolDown.StartNewTimer(0.075);
}
}
if(GetAsyncKeyState('V'))
{
player.claimOnHand();
InputCoolDown.StartNewTimer(0.075);
}
}
}