Add Building, Add Hard floors

This commit is contained in:
Bram Verhulst
2024-04-18 15:39:18 +02:00
parent db83ae5e13
commit ebda39f690
17 changed files with 149 additions and 216 deletions

View File

@@ -10,6 +10,7 @@ enum class GroundTileTypes
{
Air,
Dirt,
Hard,
Stone,
Iron
};
@@ -89,6 +90,13 @@ namespace Tiles
static GroundTileType* AIR = new GroundTileType("", GroundTileTypes::Air);
static GroundTileType* DIRT = new RandomGroundTile("tiles/dirt/dirt[0].png", GroundTileTypes::Dirt, 5);
static GroundTileType* IRON = new GroundTileType("tiles/ores/Ore_Ironium.png", GroundTileTypes::Iron);
namespace Special
{
static GroundTileType* HARD_LEFT = new GroundTileType("tiles/dirt/special/hardLeft.png", GroundTileTypes::Hard);
static GroundTileType* HARD_RIGHT = new GroundTileType("tiles/dirt/special/hardRight.png", GroundTileTypes::Hard);
static GroundTileType* HARD_MIDDLE = new GroundTileType("tiles/dirt/special/hardMiddle.png", GroundTileTypes::Hard);
}
}
class WorldTile
@@ -99,7 +107,7 @@ public:
~WorldTile();
void Draw();
void Update(Camera* camera); //TODO: no use
void Update(const Camera* camera); //TODO: no use
Vector2f GetPosition() const {
return m_Position;
@@ -124,6 +132,9 @@ public:
bool m_Hightlight { false };
private:
void DrawSide(const TileDirection& direction);
Vector2f m_Position;
GroundTileType* m_GroundTileType;
@@ -135,17 +146,7 @@ private:
surroundingTiles m_SurroundingTiles;
Texture* m_pTopLeftTexture;
Texture* m_pTopRightTexture;
Texture* m_pBottomLeftTexture;
Texture* m_pBottomRightTexture;
Texture* m_pMiddleTopTexture;
Texture* m_pMiddleBottomTexture;
Texture* m_pMiddleLeftTexture;
Texture* m_pMiddleRightTexture;
std::vector<Texture*> m_SideTextures { 8, nullptr };
Texture* m_pAllTexture;
};