wiktortokumpel

choinawroniona

Dec 7th, 2021 (edited)
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.43 KB | None | 0 0
  1. #include <iostream>
  2. #include <SFML/Graphics.hpp>
  3.  
  4. int main()
  5. {
  6. // create the window
  7. sf::RenderWindow window(sf::VideoMode(800, 600), "My window");
  8. sf::CircleShape shape(30,3);
  9. shape.setFillColor(sf::Color(255, 255, 0));
  10. sf::CircleShape liscie(100,3);
  11. liscie.setFillColor(sf::Color(51, 102, 0));
  12. sf::CircleShape liscie2(130,3);
  13. liscie2.setFillColor(sf::Color(0, 102, 0));
  14. sf::CircleShape liscie3(160,3);
  15. liscie3.setFillColor(sf::Color(51, 102, 0));
  16. sf::CircleShape liscie4(190,3);
  17. liscie4.setFillColor(sf::Color(0, 102, 0));
  18. sf::CircleShape pien(30,4);
  19. pien.setFillColor(sf::Color(125, 80, 0));
  20. sf::CircleShape babka(20);
  21. babka.setFillColor(sf::Color(255, 255, 51));
  22. sf::CircleShape bialababka(25);
  23. sf::RectangleShape podloga(sf::Vector2f(8000, 20));
  24. podloga.setFillColor(sf::Color(102,51,0));
  25. sf::RectangleShape prezent1(sf::Vector2f(70, 40));
  26. prezent1.setFillColor(sf::Color(255,0,0));
  27. sf::RectangleShape prezent2(sf::Vector2f(90, 60));
  28. prezent2.setFillColor(sf::Color(172,0,203));
  29. sf::RectangleShape lancuch(sf::Vector2f(280, 9));
  30. lancuch.setFillColor(sf::Color(239,55,33));
  31. sf::RectangleShape lancuch2(sf::Vector2f(200, 9));
  32. lancuch2.setFillColor(sf::Color(239,55,33));
  33. sf::RectangleShape wstazka2(sf::Vector2f(40, 10));
  34. wstazka2.setFillColor(sf::Color(255,255,0));
  35. sf::RectangleShape wstazka3(sf::Vector2f(60, 8));
  36. wstazka3.setFillColor(sf::Color(255,255,0));
  37. sf::RectangleShape wstazka4(sf::Vector2f(90, 10));
  38. wstazka4.setFillColor(sf::Color(255,255,0));
  39.  
  40. // run the program as long as the window is open
  41. while (window.isOpen())
  42. {
  43. // check all the window's events that were triggered since the last iteration of the loop
  44. sf::Event event;
  45. while (window.pollEvent(event))
  46. {
  47. // "close requested" event: we close the window
  48. if (event.type == sf::Event::Closed)
  49. window.close();
  50. }
  51.  
  52. // clear the window with black color
  53. window.clear(sf::Color::Black);
  54.  
  55.  
  56. { liscie.setPosition(270,75);
  57. window.draw(liscie);
  58. liscie2.setPosition(240,130);
  59. window.draw(liscie2);
  60. liscie3.setPosition(210,180);
  61. window.draw(liscie3);
  62. liscie4.setPosition(180,230);
  63. window.draw(liscie4);}
  64. {shape.setRotation(0);
  65. shape.setPosition(340,38);
  66. window.draw(shape);
  67.  
  68. shape.setRotation(180);
  69. shape.setPosition(400,100);
  70. window.draw(shape);}
  71. {
  72. lancuch.setPosition(470,370);
  73. lancuch.setRotation(150);
  74. window.draw(lancuch);
  75. lancuch2.setPosition(295,260);
  76. lancuch2.setRotation(30);
  77. window.draw(lancuch2);
  78.  
  79. }
  80.  
  81. {pien.setPosition(370,494);
  82. pien.setRotation(45);
  83. window.draw(pien);
  84. pien.setPosition(370,520);
  85. pien.setRotation(45);
  86. window.draw(pien);}
  87.  
  88. {babka.setPosition(300,400);
  89. window.draw(babka);
  90. babka.setPosition(470,480);
  91. window.draw(babka);
  92. babka.setPosition(390,250);
  93. window.draw(babka);
  94. babka.setPosition(430,210);
  95. window.draw(babka);
  96. babka.setPosition(360,130);
  97. window.draw(babka);
  98. babka.setPosition(280,210);
  99. window.draw(babka);
  100. babka.setPosition(380,330);
  101. window.draw(babka);}
  102.  
  103. {bialababka.setPosition(220,490);
  104. window.draw(bialababka);
  105. bialababka.setPosition(370,420);
  106. window.draw(bialababka);
  107. bialababka.setPosition(290,330);
  108. window.draw(bialababka);
  109. bialababka.setPosition(327,213);
  110. window.draw(bialababka);
  111. bialababka.setPosition(440,360);
  112. window.draw(bialababka);}
  113. {podloga.setPosition(0,580);
  114. window.draw(podloga);}
  115. {prezent1.setPosition(240,545);
  116. window.draw(prezent1);
  117. prezent2.setPosition(400,525);
  118. window.draw(prezent2);
  119. }
  120. {wstazka2.setPosition(270,545);
  121. wstazka2.setRotation(90);
  122. window.draw(wstazka2);
  123. wstazka3.setPosition(435,525);
  124. wstazka3.setRotation(90);
  125. window.draw(wstazka3);
  126. wstazka4.setPosition(400,550);
  127. window.draw(wstazka4);}
  128.  
  129.  
  130. // end the current frame
  131. window.display();
  132.  
  133. }
  134.  
  135. return 0;
  136. }
  137.  
Add Comment
Please, Sign In to add comment