-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tile.cpp
61 lines (46 loc) · 1.02 KB
/
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
51
52
53
54
55
56
57
58
59
60
61
#include "Main.hpp"
Tile::Tile(int x2, int y2, SDL_Texture* newTexture,int x2g,int r){
x = x2;
y = y2;
tileRect.x = x2*100;
tileRect.y =y2*100;
tileRect.w =100;
tileRect.h =100;
texture = newTexture;
if(x2g != -1){
std::cout<<"2.2.1"<<std::endl;
if(r == 1){
std::cout<<"2.2.2"<<std::endl;
tileSplitter.x = (x2g *100);
tileSplitter.y =0;
tileSplitter.w =100;
tileSplitter.h =100;
}else{
tileSplitter.x = 0;
tileSplitter.y =(x2g *100);
tileSplitter.w =100;
tileSplitter.h =100;
}
std::cout<<"2.2.3"<<std::endl;
}else{
tileSplitter.x = -1;
}
}
int Tile::getX(){
return x;
}
int Tile::getY(){
return y;
}
SDL_Texture* Tile::getTexture(){
return texture;
}
bool Tile::isShip(){
return false;
}
SDL_Rect Tile::getTileRect(){
return tileRect;
}
SDL_Rect Tile::getTileSplitter(){
return tileSplitter;
}