-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcollision.h
51 lines (38 loc) · 1.2 KB
/
collision.h
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef COLLISION_H_INCLUDED
#define COLLISION_H_INCLUDED
#include <SFML/Graphics.hpp>
#include <iostream>
#include <tr1/memory>
#include "player.h"
#include "population.h"
#include "tirs/projectile_manager.h"
#include "tirs/missile_manager.h"
#include "drop.h"
#include "enemies/spawn.h"
//Gère les collisions des types unit
class Collision
{
public:
Collision(sf::Vector2f windowSize, std::tr1::shared_ptr<Player> player, std::tr1::shared_ptr<Player> player2);
//Destructeur
virtual ~Collision();
//Collisions déplacement joueur
void manageCollisionsX();
void manageCollisionsY();
void manageCollisionsX2();
void manageCollisionsY2();
//Collisions sur les tirs
void manageProjectileCollision();
//Collisions sur les drops
void dropCollision();
protected:
//Objet joueur
std::tr1::shared_ptr<Player> m_player, m_player2;
sf::SoundBuffer clingBuffer;
sf::Sound clingSound;
//Taille de la fenêtre
const sf::Vector2f m_windowSize;
};
//Vérifie les colisions entre rectangles
bool checkCollision(const sf::IntRect & a, const sf::IntRect & b);
#endif // COLLISION_H_INCLUDED