Guest User

Pauza

a guest
Dec 6th, 2019
102
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