-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTile.cpp
50 lines (42 loc) · 808 Bytes
/
Tile.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
38
39
40
41
42
43
44
45
46
47
48
49
50
#include "Tile.h"
void logSDLError(std::ostream &os, const std::string &msg){
os << msg << " error: " << SDL_GetError() << std::endl;
}
Tile::Tile(int tId, float frictionIn, glm::ivec2 positionIn)
{
textureId = tId;
friction = frictionIn;
position = positionIn;
size = glm::ivec2(Settings::Tile::width, Settings::Tile::height);
if(Utility::getRandInt(1, 10) < 3)
{
bb = new RectangleShape(new glm::vec2(), 0.0, new glm::vec2(Settings::Tile::width, Settings::Tile::height));
}
else
{
bb = nullptr;
}
}
Tile::~Tile(void)
{
}
glm::ivec2 Tile::getPosition(void)
{
return position;
}
RectangleShape* Tile::getBB(void)
{
return bb;
}
glm::ivec2 Tile::getSize(void)
{
return size;
}
int Tile::getTextureId(void)
{
return textureId;
}
float Tile::getFriction(void)
{
return friction;
}