本文整理汇总了C++中HUD::sendScore方法的典型用法代码示例。如果您正苦于以下问题:C++ HUD::sendScore方法的具体用法?C++ HUD::sendScore怎么用?C++ HUD::sendScore使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HUD
的用法示例。
在下文中一共展示了HUD::sendScore方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GameLoop
void GameLoop( sf::RenderWindow &app, bool &bczyGra, bool &bMenu )
{
ResetGame();
bool pauseGame = false;
sf::Mouse::setPosition( sf::Vector2i( Width / 2, Height / 2 ), app );
app.setMouseCursorVisible( false );
sounds[2].play();
while ( bczyGra )
{
LoopTime = TimeLoop.GetElapsedSeconds();
TimeLoop.Reset();
sf::Event event;
while (app.pollEvent(event))
{
if (event.type == sf::Event::Closed)
{
bczyGra = false;
bMenu = false;
app.close();
}
else if (event.type == sf::Event::Resized)
{
ChangeSize( event.size.width, event.size.height );
}
else if ( ( event.type == sf::Event::KeyReleased ) &&
( event.key.code == sf::Keyboard::Escape ) ){
bczyGra = false;
bMenu = true;
}
if ( ( ( event.type == sf::Event::JoystickButtonReleased ) &&
( event.joystickButton.button == 0 ) ) ||
( event.type == sf::Event::KeyReleased && event.key.code == sf::Keyboard::P ) ){
pauseGame = !pauseGame;
if ( pauseGame == true ) {
app.setMouseCursorVisible( true );
sounds[2].pause();
} else {
sf::Mouse::setPosition( sf::Vector2i( Width / 2, Height / 2 ), app );
app.setMouseCursorVisible( false );
LoopTime = 0.0f;
TimeLoop.Reset();
sounds[2].play();
}
}
}
KeyControl( LoopTime, app );
if ( !pauseGame ) {
MoveMouse( sf::Mouse::getPosition( app ).x, sf::Mouse::getPosition( app ).y, app );
MouseControl( LoopTime );
Joystick( LoopTime, app );
if ( Player.getLife() < 0 ) {
bczyGra = false;
bMenu = true;
}
Logika( LoopTime );
RenderScene();
app.display();
}
}
sounds[2].stop();
hud.sendScore();
}