Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <SFML/Graphics.hpp>
- #include <stdlib.h>
- #define x 500
- #define y 400
- sf::RenderWindow windows[300];
- void delay(float t)
- {
- sf::Clock clock;
- sf::Time time = clock.getElapsedTime();
- float aux = time.asSeconds();
- while ((float)aux < (float)t)
- {
- time = clock.getElapsedTime();
- aux = time.asSeconds();
- }
- }
- int main()
- {
- sf::Texture texture;
- if (!texture.loadFromFile("meme.jpg"))
- {
- return 0;
- }
- sf::Sprite sprite;
- sprite.setTexture(texture);
- for (int i = 0; i < 300; ++i)
- {
- windows[i].create(sf::VideoMode(x, y), "MOCANU-Virus");
- windows[i].setPosition(sf::Vector2i(rand() % 400, rand() % 400));
- windows[i].draw(sprite);
- windows[i].display();
- delay(0.4f);
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment