本文整理汇总了C++中Sky::whetherIgetDong方法的典型用法代码示例。如果您正苦于以下问题:C++ Sky::whetherIgetDong方法的具体用法?C++ Sky::whetherIgetDong怎么用?C++ Sky::whetherIgetDong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sky
的用法示例。
在下文中一共展示了Sky::whetherIgetDong方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main() {
//Sound::load();
/*sf::Texture DongPoint;
sf::Texture PowerPoint;
DongPoint.loadFromFile("DongPoint.JPG");
PowerPoint.loadFromFile("Ppoint.JPG");
sf::Sprite DongPoint1(DongPoint);
sf::Sprite PowerPoint1(PowerPoint);
DongPoint1.setPosition(sf::Vector2f(1052, 64));
PowerPoint1.setPosition(sf::Vector2f(1052, 164));
*/
Sky* sky = Sky::getInstance();
sf::RenderWindow* window = sky->getWindow();
//Sound::BACK_GROUND.play();
Hero hero;
sky->add(&hero);
int a = 0;
int usebomb = 0;//是否使用炸药
//int stage = 0;//0=小怪,1=boss战
sf::Time t1 = sf::seconds(20);//实验性质[][][]【】【】【】【】【】【】【】【】【】【】【【】【】
sf::Clock clock1;//实验性质[][][]【】【】【】【】【【【】【】【】【】【】【】【】【
window->setFramerateLimit(100);
while (window->isOpen()) {
sf::Event event;
while (window->pollEvent(event)) {
if (event.type == sf::Event::Closed)
{
window->close();
}
if (event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::Q)
{
window->close();
}
}
{//似乎是没有意义的大括号
if (event.type == sf::Event::Closed)
{
window->close();
}
if (event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::Escape)
{
window->close();
}//
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Left))
{
if (sf::Keyboard::isKeyPressed(sf::Keyboard::LShift))
hero.move2leftslow();
else
hero.move2left();
//研究按住与不安住
}
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Right))
{
if (sf::Keyboard::isKeyPressed(sf::Keyboard::LShift))
hero.move2rightslow();
else
hero.move2right();
}
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Up))
{
if (sf::Keyboard::isKeyPressed(sf::Keyboard::LShift))
hero.move2upslow();
else
hero.move2up();
}
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Down))
{
if (sf::Keyboard::isKeyPressed(sf::Keyboard::LShift))
hero.move2downslow();
else
hero.move2down();
}
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Z))
{
hero.fire();
}
if (sf::Keyboard::isKeyPressed(sf::Keyboard::X))
{
if (hero.havebomb()) //boss战不能用
{
sky->bombclear();//改进,添加无敌时间
hero.bomblost();
hero.clockWD.restart();
hero.whetherWD = 1;
}
}
sky->whetherIdied(&hero);
sky->refresh();
sky->whetherIgetDong(&hero);//这句话放哪里比较好?
}
}
return EXIT_SUCCESS;
}