SHARE
TWEET

Pauza

a guest Dec 6th, 2019 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. bool isPause=false;
  2.  
  3.  
  4. if((event.type == sf::Event::KeyReleased)&&(event.key.code == sf::Keyboard::P))
  5.         {
  6.             isPause=true;
  7.         }
  8.         if((event.type == sf::Event::KeyReleased)&&(event.key.code == sf::Keyboard::K))
  9.         {
  10.             isPause=false;
  11.         }
  12.  
  13.  
  14. void SFMLHandling::handleTime(int time_,bool isPause)
  15. {
  16.     if(isPause==false)
  17.         if(cl.getElapsedTime().asMilliseconds()>=time_)
  18.         {
  19.             nextState();
  20.             cl.restart();
  21.         }
  22.     if(isPause==true)
  23.         if(!cl.getElapsedTime().asMilliseconds())
  24.         {
  25.             nextState();
  26.         }
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top