-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBackground.hpp
49 lines (34 loc) · 1.11 KB
/
Background.hpp
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
#ifndef BACKGROUND_HPP
#define BACKGROUND_HPP
#include <vector>
#include <string>
#include <fstream>
#include <iostream>
#include "utils.hpp"
#include "Resources.hpp"
class Background {
public:
Background();
Background(std::string lvlDesc);
~Background();
bool _doorOpenedL;
bool _doorOpenedR;
void init(std::string lvlDesc);
void draw(sf::RenderTarget *target);
void readLevel(std::string lvlDesc);
bool colision(float x, float y);
bool colision(sf::Vector2f pos);
bool colision(sf::Vector2f pos, float rad);
bool rectangleColision(sf::FloatRect rect);
bool circleColision(sf::Vector2f pos, float rad);
sf::Vector2i getIntersection(sf::Vector2i mousePos);
sf::Vector2f getCircleColisionOffset(sf::Vector2f pos, float rad);
sf::Vector2i getIntersection(sf::Vector2i position, sf::Vector2i mousePos);
sf::Vector2f getVectorFromCircleColision(sf::Vector2f &direction, sf::Vector2f pos, float rad);
private:
sf::Sprite _doors;
sf::Texture _bTexture;
sf::Sprite _background;
std::vector<sf::FloatRect> _boundaries;
};
#endif // BACKGROUND_HPP