本文整理汇总了C++中Shot::draw方法的典型用法代码示例。如果您正苦于以下问题:C++ Shot::draw方法的具体用法?C++ Shot::draw怎么用?C++ Shot::draw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shot
的用法示例。
在下文中一共展示了Shot::draw方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw
void draw() {
if (transitioning || onStartScreen) {
backgroundImage->draw(0, 0, zBackground);
Gosu::Image& ammoBarImage = *ammoBarAnim.at(20 - player.getAmmo());
ammoBarImage.draw(240, 92, zUI);
Gosu::Image& healthBarImage = *healthBarAnim.at(10 - player.getHealth());
healthBarImage.draw(240, 3, zUI);
scoreLabelImage->draw(5, 215, zUI);
Gosu::Image& scoreDigit3Image = *numbersAnim.at(player.getScore() / 1000 % 10);
scoreDigit3Image.draw(68, 215, zUI);
Gosu::Image& scoreDigit2Image = *numbersAnim.at(player.getScore() / 100 % 10);
scoreDigit2Image.draw(80, 215, zUI);
Gosu::Image& scoreDigit1Image = *numbersAnim.at(player.getScore() / 10 % 10);
scoreDigit1Image.draw(92, 215, zUI);
Gosu::Image& scoreDigit0Image = *numbersAnim.at(player.getScore() % 10);
scoreDigit0Image.draw(104, 215, zUI);
for (std::list<Item>::const_iterator i = items.begin(); i != items.end(); ++i)
{
i->draw();
}
}
else {
player.draw();
shot.draw();
for (std::list<Enemy>::const_iterator i = enemies.begin(); i != enemies.end(); ++i)
{
i->draw();
}
for (std::list<Item>::const_iterator i = items.begin(); i != items.end(); ++i)
{
i->draw();
}
int spotlightRadius;
if (round == 1)
spotlightRadius = 50;
else if (round == 2)
spotlightRadius = 42;
else if (round == 3)
spotlightRadius = 33;
else
spotlightRadius = 25;
spotlight.draw(player, spotlightRadius);
backgroundImage->draw(0, 0, zBackground);
Gosu::Image& ammoBarImage = *ammoBarAnim.at(20 - player.getAmmo());
ammoBarImage.draw(240, 92, zUI);
Gosu::Image& healthBarImage = *healthBarAnim.at(10 - player.getHealth());
healthBarImage.draw(240, 3, zUI);
scoreLabelImage->draw(5, 215, zUI);
Gosu::Image& scoreDigit3Image = *numbersAnim.at(player.getScore() / 1000 % 10);
scoreDigit3Image.draw(68, 215, zUI);
Gosu::Image& scoreDigit2Image = *numbersAnim.at(player.getScore() / 100 % 10);
scoreDigit2Image.draw(80, 215, zUI);
Gosu::Image& scoreDigit1Image = *numbersAnim.at(player.getScore() / 10 % 10);
scoreDigit1Image.draw(92, 215, zUI);
Gosu::Image& scoreDigit0Image = *numbersAnim.at(player.getScore() % 10);
scoreDigit0Image.draw(104, 215, zUI);
}
}