本文整理汇总了C++中Missile::checkDamages方法的典型用法代码示例。如果您正苦于以下问题:C++ Missile::checkDamages方法的具体用法?C++ Missile::checkDamages怎么用?C++ Missile::checkDamages使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Missile
的用法示例。
在下文中一共展示了Missile::checkDamages方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EnnemyHorde
void play(int i, Window& win)
{
nodelay(stdscr, TRUE);
i = get_difficult(i);
Player p(win);
EnnemyHorde n = EnnemyHorde(i, "^v^");
Missile miss = Missile(10, "|");
Rocket rock = Rocket(2, "[]");
n.randomPOP(win);
int input = 0;
p.setScoreZero();
while (input != KEY_ECHAP && p.getHP() > 0)
{
clear();
miss.print_score(win);
win.takeSize();
win.printBorder();
input = getch();
miss.activate(p.getX(), p.getY(), input);
rock.activate(p.getX(), p.getY(), input);
miss.checkDamages(n.getHorde(), n.getNumber(), win);
rock.checkDamages(n.getHorde(), n.getNumber(), win);
p.checkEnemies(n.getHorde(), n.getNumber(), win);
p.print_life(win);
miss.print_chargeur(win);
rock.print_chargeur(win);
if (p.getHP() > 0)
{
n.printit(win);
miss.move(win);
rock.move(win);
miss.printit(win);
rock.printit(win);
p.printit(win);
p.inputDirection(input);
wrefresh(win.getWin());
p.move(win);
p.printit(win);
n.move(win);
}
while(getch() != ERR);
usleep(60000);
}
if (p.getHP() <= 0)
{
clear();
print_die(win, p);
}
if (p.getScore() > hight_score)
hight_score = p.getScore();
}