-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
37 lines (29 loc) · 827 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <iostream>
#include <vector>
#include <SFML/Graphics.hpp>
#include "ParticleCollection.h"
using namespace std;
using namespace sf;
int main()
{
RenderWindow window(VideoMode(800, 600), "Particle Collision", Style::Close | Style::Resize);
ParticleCollection collection(15);
window.setFramerateLimit(160);
while (window.isOpen()) {
Event evnt;
while (window.pollEvent(evnt)) {
switch (evnt.type) {
case Event::Closed:
window.close();
break;
}
}
collection.moveParticles();
collection.checkCollisions({}, true);
// Drawing
window.clear();
collection.draw(window);
window.display();
}
return 0;
}