mirror of
https://github.com/HowestDAE/dae16-VerhulstBram.git
synced 2025-12-16 20:41:47 +01:00
Added the Grid, Camera, Level system
Basic player Started (Barely) on the TextureManager And other fixes
This commit is contained in:
@@ -1,14 +1,21 @@
|
||||
#include "pch.h"
|
||||
#include "WorldTile.h"
|
||||
|
||||
#include "utils.h"
|
||||
|
||||
WorldTile::WorldTile() {
|
||||
|
||||
}
|
||||
WorldTile::WorldTile(const Point2f& position, GroundTileTypes groundTileType) : m_Position { position }, m_GroundTileType { groundTileType } {
|
||||
const std::string dirtPath = + "tiles/dirt/dirt" + std::to_string(utils::randRange(1, 5)) + ".png";
|
||||
m_pTexture = new Texture(dirtPath);
|
||||
}
|
||||
WorldTile::~WorldTile() {
|
||||
delete m_pTexture;
|
||||
}
|
||||
void WorldTile::Draw() const {
|
||||
if (m_GroundTileType != GroundTileTypes::Air) {
|
||||
utils::SetColor(Color4f{ 0.5f, 0.5f, 0.5f, 1.0f});
|
||||
utils::FillRect(m_Position.x, m_Position.y, 50, 50);
|
||||
m_pTexture->Draw(m_Position);
|
||||
//utils::SetColor(Color4f{ 0.5f, 0.5f, 0.5f, 1.0f});
|
||||
//utils::FillRect(m_Position.x, m_Position.y, 50, 50);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user