daily pastebin goal
10%
SHARE
TWEET

Untitled

a guest Mar 13th, 2018 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<SFML\Graphics.hpp>
  2. #include<iostream>
  3. #include<iterator>
  4. #include<map>
  5. #include<set>
  6. #include<queue>
  7. #include<string>
  8. #include<fstream>
  9. using namespace sf;
  10. using namespace std;
  11.  
  12. void mainmenu(RenderWindow &w , CircleShape menu)
  13. {
  14.     menu.setPosition(Vector2f(200.0f,250.0f));
  15.     menu.setFillColor(Color::Yellow);
  16.     w.draw(menu);
  17.     w.display();
  18.     w.clear();
  19. }
  20. void gameplay(RenderWindow &w , CircleShape map1)
  21. {
  22.     map1.setPosition(Vector2f(250.0f,250.0f));
  23.     map1.setFillColor(Color::Blue);
  24.     w.draw(map1);
  25.     w.display();
  26.     w.clear();
  27. }
  28.  
  29.  
  30. int main()
  31. {
  32.     RenderWindow gamewindows(VideoMode(700,900), "test", Style::Default);
  33.  
  34. bool shifted=false;
  35. //player
  36.     CircleShape player (15.0f);
  37.  
  38.     // new player
  39.     CircleShape newplayer (15.0f);
  40.     newplayer.setPosition(Vector2f(250.0f,250.0f));
  41.     newplayer.setFillColor(Color::Green);
  42.  
  43.     while (gamewindows.isOpen() )
  44.     {
  45.  
  46.  
  47.         Event e;
  48.         while (gamewindows.pollEvent(e))
  49.             if (e.type == e.Closed)
  50.                 gamewindows.close();
  51.             if(!shifted)
  52.             {
  53.                mainmenu(gamewindows,player);
  54.             }
  55.             else{
  56.  
  57.                 gameplay(gamewindows,newplayer);
  58.             }
  59.             if(Keyboard::isKeyPressed(Keyboard::Return) )shifted=true;
  60.  
  61.  
  62.     }
  63.  
  64.  
  65.     return 0;
  66. }
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