wiktortokumpel

choina wektora

Dec 7th, 2021 (edited)
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.70 KB | None | 0 0
  1. #include <SFML/Graphics.hpp>
  2.  
  3. int main()
  4. {
  5.     // create the window
  6.     sf::RenderWindow window(sf::VideoMode(800, 600), "My window");
  7.  
  8.     // run the program as long as the window is open
  9.     while (window.isOpen())
  10.     {
  11.         // check all the window's events that were triggered since the last iteration of the loop
  12.         sf::Event event;
  13.         while (window.pollEvent(event))
  14.         {
  15.             // "close requested" event: we close the window
  16.             if (event.type == sf::Event::Closed)
  17.                 window.close();
  18.         }
  19.  
  20.         // clear the window with black color
  21.         window.clear(sf::Color::Black);
  22.  
  23.         sf::CircleShape shape(20,3);
  24.         shape.setFillColor(sf::Color(255,210,20));
  25.  
  26.         sf::CircleShape choina1(100,3);
  27.         choina1.setFillColor(sf::Color(30,85,0));
  28.         sf::CircleShape choina2(150,3);
  29.         choina2.setFillColor(sf::Color(10,70,0));
  30.         sf::CircleShape choina3(200,3);
  31.         choina3.setFillColor(sf::Color(0,50,0));
  32.  
  33.         sf::CircleShape pien(40,4);
  34.         pien.setFillColor(sf::Color(41,16,0));
  35.  
  36.         sf::CircleShape babka(25,100);
  37.         babka.setFillColor(sf::Color(255,255,255));
  38.  
  39.         sf::CircleShape prezent1(25,4);
  40.         prezent1.setFillColor(sf::Color(81,16,98));
  41.         sf::CircleShape prezent2(30,4);
  42.         prezent2.setFillColor(sf::Color(100,16,160));
  43.         sf::CircleShape prezent3(35,4);
  44.         prezent3.setFillColor(sf::Color(140,10,190));
  45.  
  46.         sf::RectangleShape wstazka(sf::Vector2f(49, 5));
  47.         wstazka.setFillColor(sf::Color(200,140,10));
  48.         sf::RectangleShape wstazka2(sf::Vector2f(34, 5));
  49.         wstazka2.setFillColor(sf::Color(0,50,150));
  50.         sf::RectangleShape wstazka3(sf::Vector2f(34, 5));
  51.         wstazka3.setFillColor(sf::Color(200,140,10));
  52.         sf::RectangleShape wstazka31(sf::Vector2f(34, 5));
  53.         wstazka31.setFillColor(sf::Color(200,140,10));
  54.  
  55.  
  56.         // draw everything here...
  57.         shape.setPosition(380,50);
  58.         shape.setRotation(0);
  59.         window.draw(shape);
  60.         shape.setPosition(420,90);
  61.         shape.setRotation(180);
  62.         window.draw(shape);
  63.  
  64.         choina3.setPosition(200,200);
  65.         window.draw(choina3);
  66.         choina2.setPosition(250,140);
  67.         window.draw(choina2);
  68.         choina1.setPosition(300,80);
  69.         window.draw(choina1);
  70.  
  71.         pien.setPosition(400,472);
  72.         pien.setRotation(45);
  73.         window.draw(pien);
  74.  
  75.         babka.setPosition(250,465);
  76.         window.draw(babka);
  77.         babka.setPosition(450,400);
  78.         window.draw(babka);
  79.  
  80.  
  81.         prezent1.setPosition(525,500);
  82.         prezent1.setRotation(45);
  83.         window.draw(prezent1);
  84.         prezent2.setPosition(460,490);
  85.         prezent2.setRotation(45);
  86.         window.draw(prezent2);
  87.         prezent2.setPosition(480,490);
  88.         prezent2.setRotation(45);
  89.         window.draw(prezent2);
  90.         prezent3.setPosition(320,480);
  91.         prezent3.setRotation(45);
  92.         window.draw(prezent3);
  93.  
  94.         wstazka.setPosition(322,505);
  95.         wstazka.setRotation(90);
  96.         window.draw(wstazka);
  97.         wstazka.setPosition(345,530);
  98.         wstazka.setRotation(180);
  99.         window.draw(wstazka);
  100.         wstazka2.setPosition(526,519);
  101.         wstazka2.setRotation(90);
  102.         window.draw(wstazka2);
  103.         wstazka2.setPosition(542,537);
  104.         wstazka2.setRotation(180);
  105.         window.draw(wstazka2);
  106.         wstazka3.setPosition(480,519);
  107.         wstazka3.setRotation(90);
  108.         window.draw(wstazka3);
  109.         wstazka31.setPosition(480,537);
  110.         wstazka31.setRotation(180);
  111.         window.draw(wstazka31);
  112.  
  113.  
  114.  
  115.         // end the current frame
  116.         window.display();
  117.     }
  118.  
  119.     return 0;
  120. }
Add Comment
Please, Sign In to add comment