-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTile.cpp
More file actions
40 lines (32 loc) · 699 Bytes
/
Copy pathTile.cpp
File metadata and controls
40 lines (32 loc) · 699 Bytes
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
#include "Tile.h"
void Tile::innitsprite()
{
if(!this->texture.loadFromFile("Textures/Tile/Tile.png"))
{
cout << "ERROR::Tile::Failed to load texture" << "\n";
}
texture.setSmooth(true);
this->sprite.setTexture(this->texture);
this->sprite.setTextureRect(IntRect(0, 0, 50, 50));
this->sprite.setScale(0.5f, 0.5f);
this->sprite.setPosition(this->pos);
}
Tile::Tile()
{
}
Tile::Tile(bool ispassable, bool isexit, float x, float y, Texture texture)
{
this->ispassable = ispassable;
this->isexit = isexit;
this->pos.x = x;
this->pos.y = y;
this->texture = texture;
innitsprite();
}
void Tile::update()
{
}
void Tile::render(RenderTarget& target)
{
target.draw(this->shape);
}