Add window icon,

Add digging animation (Non functional)
This commit is contained in:
Bram Verhulst
2024-05-02 12:28:03 +02:00
parent 64915567dc
commit b6be73019f
16 changed files with 140 additions and 101 deletions

View File

@@ -79,12 +79,12 @@ void WorldLevel::Update(float elapsedSec) {
m_mousePos = Vector2f { float(mouseX), float(mouseY) };
m_mousePos = m_pCamera->TransformMouse(m_mousePos);
for (size_t x { 0 }; x < WORLD_WIDTH; ++x) {
for (size_t y { 0 }; y < WORLD_HEIGHT; ++y) {
m_gridManager.GetTileAtIndex(x, y)->m_Hightlight = false;
}
}
// for (size_t x { 0 }; x < WORLD_WIDTH; ++x) {
// for (size_t y { 0 }; y < WORLD_HEIGHT; ++y) {
// m_gridManager.GetTileAtIndex(x, y)->m_Hightlight = false;
// }
// }
for (size_t x { 0 }; x < WORLD_WIDTH; ++x) {
for (size_t y { 0 }; y < WORLD_HEIGHT; ++y) {
m_gridManager.GetTileAtIndex(x, y)->Update(m_pCamera);
@@ -101,21 +101,21 @@ void WorldLevel::Update(float elapsedSec) {
}
//Get the diogonal tiles of the selected tile
if (m_pSelectedTile != nullptr) {
surroundingTiles surroundingTiles = m_gridManager.GetSurroundingTiles(m_pSelectedTile);
TileDirection direction = TileDirection::TopMiddle;
const std::array<TileDirection, 8> directions = { TileDirection::TopLeft, TileDirection::TopMiddle, TileDirection::TopRight, TileDirection::MiddleLeft,
TileDirection::MiddleRight, TileDirection::BottomLeft, TileDirection::BottomMiddle, TileDirection::BottomRight };
for (int i = 0; i < 8; i++) {
direction = directions[i];
if (surroundingTiles.GetTile(direction) != nullptr) {
if (surroundingTiles.GetTile(direction)->GetTileType() != GroundTileTypeManager::GetInstance()->AIR) {
//surroundingTiles.GetTile(direction)->m_Hightlight = true;
}
}
}
}
// if (m_pSelectedTile != nullptr) {
// surroundingTiles surroundingTiles = m_gridManager.GetSurroundingTiles(m_pSelectedTile);
// TileDirection direction = TileDirection::TopMiddle;
// const std::array<TileDirection, 8> directions = { TileDirection::TopLeft, TileDirection::TopMiddle, TileDirection::TopRight, TileDirection::MiddleLeft,
// TileDirection::MiddleRight, TileDirection::BottomLeft, TileDirection::BottomMiddle, TileDirection::BottomRight };
//
// for (int i = 0; i < 8; i++) {
// direction = directions[i];
// if (surroundingTiles.GetTile(direction) != nullptr) {
// if (surroundingTiles.GetTile(direction)->GetTileType() != GroundTileTypeManager::GetInstance()->AIR) {
// //surroundingTiles.GetTile(direction)->m_Hightlight = true;
// }
// }
// }
// }
m_player.Update(elapsedSec, *this);