-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTile.h
More file actions
26 lines (24 loc) · 785 Bytes
/
Tile.h
File metadata and controls
26 lines (24 loc) · 785 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
#pragma once
#include <SFML/Graphics.hpp>
#include "Collider.h"
#include "Player.h"
class Tile
{
public:
Tile(sf::Texture* texture, sf::Vector2f position, int tileType);
~Tile() {};
void draw(sf::RenderWindow& window);
int getTileType() {return tileType;}
sf::Vector2f getSize() {return body.getSize();};
sf::Vector2f getPosition() {return body.getPosition();}
void setTileType(int newTileType) {tileType = newTileType;}
void setSize(sf::Vector2f dimensions) {body.setSize(dimensions);}
void setPosition(sf::Vector2f position) {body.setPosition(position);}
private:
int tileType = 0;
bool isPassable = false;
sf::Texture* texture = nullptr;
sf::RectangleShape body;
Collider tileCollider;
Collider playerCollider = Player::getInstance().getCollider();
};