mirror of
https://github.com/HowestDAE/dae16-VerhulstBram.git
synced 2026-02-04 09:29:20 +01:00
Fixed sidePieces (Need to add more cases tho)
This commit is contained in:
44
.idea/.idea.Motherload/.idea/workspace.xml
generated
44
.idea/.idea.Motherload/.idea/workspace.xml
generated
@@ -10,32 +10,10 @@
|
|||||||
<option name="autoReloadType" value="SELECTIVE" />
|
<option name="autoReloadType" value="SELECTIVE" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="26a0623a-44d5-441c-8048-32ff1dab3479" name="Changes" comment="">
|
<list default="true" id="26a0623a-44d5-441c-8048-32ff1dab3479" name="Changes" comment="Fix precompiled headers Added edge detection (if it works :/)">
|
||||||
<change afterPath="$PROJECT_DIR$/Engine/Text.cpp" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/Engine/Text.h" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/Game/Levels/MainMenu/MainMenuLevel.cpp" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/Game/Levels/MainMenu/MainMenuLevel.h" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/.idea.Motherload/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.Motherload/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/.idea.Motherload/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.Motherload/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/Engine/Engine.vcxproj" beforeDir="false" afterPath="$PROJECT_DIR$/Engine/Engine.vcxproj" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/Game/Animations/Animation.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Animations/Animation.cpp" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/Game/Game.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Game.cpp" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/Game/Game.h" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Game.h" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/Game/Game.vcxproj" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Game.vcxproj" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/Game/Game.vcxproj.filters" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Game.vcxproj.filters" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/Game/GameManager.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/GameManager.cpp" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/Game/GridSystem/WorldGridManager.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/GridSystem/WorldGridManager.cpp" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/Game/GridSystem/WorldGridManager.h" beforeDir="false" afterPath="$PROJECT_DIR$/Game/GridSystem/WorldGridManager.h" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/Game/GridSystem/WorldTile.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/GridSystem/WorldTile.cpp" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/Game/GridSystem/WorldTile.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/GridSystem/WorldTile.cpp" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/Game/GridSystem/WorldTile.h" beforeDir="false" afterPath="$PROJECT_DIR$/Game/GridSystem/WorldTile.h" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/Game/GridSystem/WorldTile.h" beforeDir="false" afterPath="$PROJECT_DIR$/Game/GridSystem/WorldTile.h" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/Game/Gui/Button.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Gui/Button.cpp" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/Game/Gui/Screen.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Gui/Screen.cpp" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/Game/Gui/Screens/FuelScreen.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Gui/Screens/FuelScreen.cpp" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/Game/Gui/Screens/ScreenManager.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Gui/Screens/ScreenManager.cpp" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/Game/Level.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Levels/Level.cpp" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/Game/Level.h" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Levels/Level.h" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/Game/Player.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Player.cpp" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/Game/WorldLevel.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Levels/World/WorldLevel.cpp" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/Game/WorldLevel.h" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Levels/World/WorldLevel.h" afterDir="false" />
|
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
@@ -208,6 +186,11 @@
|
|||||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock://C:/Users/Bram/Desktop/Programming 2/Exam/dae16-VerhulstBram/Game/Animations/Animation.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
<setting file="file://$PROJECT_DIR$/Game/Animations/Animation.h" root0="FORCE_HIGHLIGHTING" />
|
<setting file="file://$PROJECT_DIR$/Game/Animations/Animation.h" root0="FORCE_HIGHLIGHTING" />
|
||||||
<setting file="file://$PROJECT_DIR$/Game/Camera.cpp" root0="FORCE_HIGHLIGHTING" />
|
<setting file="file://$PROJECT_DIR$/Game/Camera.cpp" root0="FORCE_HIGHLIGHTING" />
|
||||||
<setting file="file://$PROJECT_DIR$/Game/pch.cpp" root0="FORCE_HIGHLIGHTING" />
|
<setting file="file://$PROJECT_DIR$/Game/pch.cpp" root0="FORCE_HIGHLIGHTING" />
|
||||||
@@ -341,7 +324,7 @@
|
|||||||
<workItem from="1712269212956" duration="5658000" />
|
<workItem from="1712269212956" duration="5658000" />
|
||||||
<workItem from="1712313346695" duration="4041000" />
|
<workItem from="1712313346695" duration="4041000" />
|
||||||
<workItem from="1712322453730" duration="533000" />
|
<workItem from="1712322453730" duration="533000" />
|
||||||
<workItem from="1712328371740" duration="10932000" />
|
<workItem from="1712328371740" duration="12603000" />
|
||||||
</task>
|
</task>
|
||||||
<task id="LOCAL-00001" summary="Rework Tile detection system">
|
<task id="LOCAL-00001" summary="Rework Tile detection system">
|
||||||
<option name="closed" value="true" />
|
<option name="closed" value="true" />
|
||||||
@@ -375,7 +358,15 @@
|
|||||||
<option name="project" value="LOCAL" />
|
<option name="project" value="LOCAL" />
|
||||||
<updated>1712182067316</updated>
|
<updated>1712182067316</updated>
|
||||||
</task>
|
</task>
|
||||||
<option name="localTasksCounter" value="5" />
|
<task id="LOCAL-00005" summary="Fix precompiled headers Added edge detection (if it works :/)">
|
||||||
|
<option name="closed" value="true" />
|
||||||
|
<created>1712359406452</created>
|
||||||
|
<option name="number" value="00005" />
|
||||||
|
<option name="presentableId" value="LOCAL-00005" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1712359406452</updated>
|
||||||
|
</task>
|
||||||
|
<option name="localTasksCounter" value="6" />
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="TypeScriptGeneratedFilesManager">
|
<component name="TypeScriptGeneratedFilesManager">
|
||||||
@@ -388,7 +379,8 @@
|
|||||||
<MESSAGE value="Reformat + Basic animation system General fixes" />
|
<MESSAGE value="Reformat + Basic animation system General fixes" />
|
||||||
<MESSAGE value="Basic screen system" />
|
<MESSAGE value="Basic screen system" />
|
||||||
<MESSAGE value="Update Screen system Added FuelScreen (Working buttons) Added SellScreen (Nothing working)" />
|
<MESSAGE value="Update Screen system Added FuelScreen (Working buttons) Added SellScreen (Nothing working)" />
|
||||||
<option name="LAST_COMMIT_MESSAGE" value="Update Screen system Added FuelScreen (Working buttons) Added SellScreen (Nothing working)" />
|
<MESSAGE value="Fix precompiled headers Added edge detection (if it works :/)" />
|
||||||
|
<option name="LAST_COMMIT_MESSAGE" value="Fix precompiled headers Added edge detection (if it works :/)" />
|
||||||
</component>
|
</component>
|
||||||
<component name="XDebuggerManager">
|
<component name="XDebuggerManager">
|
||||||
<watches-manager>
|
<watches-manager>
|
||||||
|
|||||||
@@ -15,10 +15,17 @@ WorldTile::WorldTile(const Point2f& position, GroundTileType* groundTileType, Te
|
|||||||
// m_pTexture = new Texture(dirtPath);
|
// m_pTexture = new Texture(dirtPath);
|
||||||
m_pTexture = pTextureManager->GetTexture(groundTileType->getPath());
|
m_pTexture = pTextureManager->GetTexture(groundTileType->getPath());
|
||||||
|
|
||||||
m_pBottomLeftTexture = pTextureManager->GetTexture("tiles/dirt/sidepieces/bottomRight.png");
|
m_pBottomLeftTexture = pTextureManager->GetTexture("tiles/dirt/sidepieces/bottomLeft.png");
|
||||||
m_pBottomRightTexture = pTextureManager->GetTexture("tiles/dirt/sidepieces/bottomLeft.png");
|
m_pBottomRightTexture = pTextureManager->GetTexture("tiles/dirt/sidepieces/bottomRight.png");
|
||||||
m_pTopLeftTexture = pTextureManager->GetTexture("tiles/dirt/sidepieces/topRight.png");
|
m_pTopLeftTexture = pTextureManager->GetTexture("tiles/dirt/sidepieces/topLeft.png");
|
||||||
m_pTopRightTexture = pTextureManager->GetTexture("tiles/dirt/sidepieces/topLeft.png");
|
m_pTopRightTexture = pTextureManager->GetTexture("tiles/dirt/sidepieces/topRight.png");
|
||||||
|
|
||||||
|
m_pMiddleBottomTexture = pTextureManager->GetTexture("tiles/dirt/sidepieces/middleBottom.png");
|
||||||
|
m_pMiddleTopTexture = pTextureManager->GetTexture("tiles/dirt/sidepieces/middleTop.png");
|
||||||
|
m_pMiddleLeftTexture = pTextureManager->GetTexture("tiles/dirt/sidepieces/middleLeft.png");
|
||||||
|
m_pMiddleRightTexture = pTextureManager->GetTexture("tiles/dirt/sidepieces/middleRight.png");
|
||||||
|
|
||||||
|
m_pAllTexture = pTextureManager->GetTexture("tiles/dirt/sidepieces/all.png");
|
||||||
}
|
}
|
||||||
WorldTile::~WorldTile() {
|
WorldTile::~WorldTile() {
|
||||||
delete m_pTexture;
|
delete m_pTexture;
|
||||||
@@ -32,26 +39,118 @@ void WorldTile::Draw() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//check if it's all around dirt
|
||||||
if(m_Hightlight) {
|
bool allDirt = true;
|
||||||
for (int i = 0; i < 8; i++) {
|
for (int i = 0; i < 8; i++) {
|
||||||
WorldTile* tile = m_SurroundingTiles.GetTile(static_cast<TileDirection>(i));
|
WorldTile* tile = m_SurroundingTiles.GetTile(static_cast<TileDirection>(i));
|
||||||
if(tile != nullptr) { //Tile exists
|
if(tile != nullptr) { //Tile exists
|
||||||
//TODO: Wow Big mess
|
|
||||||
GroundTileTypes type = tile->GetTileType()->getType();
|
GroundTileTypes type = tile->GetTileType()->getType();
|
||||||
if(type == Tiles::AIR->getType()) {
|
if(type != Tiles::DIRT->getType()) {
|
||||||
utils::SetColor(Colors::BLACK);
|
allDirt = false;
|
||||||
utils::FillRect(Rectf{tile->GetPosition(), Point2f{50,50}});
|
break;
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(allDirt) {
|
||||||
|
m_pAllTexture->Draw(m_Position);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(*m_GroundTileType == Tiles::AIR) {
|
||||||
|
WorldTile* topLeft = m_SurroundingTiles.GetTile(TileDirection::TopLeft);
|
||||||
|
if(topLeft != nullptr) {
|
||||||
|
GroundTileTypes type = topLeft->GetTileType()->getType();
|
||||||
if(type != Tiles::AIR->getType()) {
|
if(type != Tiles::AIR->getType()) {
|
||||||
utils::SetColor(Colors::YELLOW);
|
m_pTopLeftTexture->Draw(m_Position);
|
||||||
utils::FillRect(Rectf{tile->GetPosition(), Point2f{50,50}});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WorldTile* topRight = m_SurroundingTiles.GetTile(TileDirection::TopRight);
|
||||||
|
if(topRight != nullptr) {
|
||||||
|
GroundTileTypes type = topRight->GetTileType()->getType();
|
||||||
|
if(type != Tiles::AIR->getType()) {
|
||||||
|
m_pTopRightTexture->Draw(m_Position);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WorldTile* bottomLeft = m_SurroundingTiles.GetTile(TileDirection::BottomLeft);
|
||||||
|
if(bottomLeft != nullptr) {
|
||||||
|
GroundTileTypes type = bottomLeft->GetTileType()->getType();
|
||||||
|
if(type != Tiles::AIR->getType()) {
|
||||||
|
m_pBottomLeftTexture->Draw(m_Position);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
WorldTile* bottomRight = m_SurroundingTiles.GetTile(TileDirection::BottomRight);
|
||||||
|
if(bottomRight != nullptr) {
|
||||||
|
GroundTileTypes type = bottomRight->GetTileType()->getType();
|
||||||
|
if(type != Tiles::AIR->getType()) {
|
||||||
|
m_pBottomRightTexture->Draw(m_Position);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
WorldTile* middleTop = m_SurroundingTiles.GetTile(TileDirection::TopMiddle);
|
||||||
|
if(middleTop != nullptr) {
|
||||||
|
GroundTileTypes type = middleTop->GetTileType()->getType();
|
||||||
|
if(type != Tiles::AIR->getType()) {
|
||||||
|
m_pMiddleTopTexture->Draw(m_Position);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
WorldTile* middleBottom = m_SurroundingTiles.GetTile(TileDirection::BottomMiddle);
|
||||||
|
if(middleBottom != nullptr) {
|
||||||
|
GroundTileTypes type = middleBottom->GetTileType()->getType();
|
||||||
|
if(type != Tiles::AIR->getType()) {
|
||||||
|
m_pMiddleBottomTexture->Draw(m_Position);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
WorldTile* middleLeft = m_SurroundingTiles.GetTile(TileDirection::MiddleLeft);
|
||||||
|
if(middleLeft != nullptr) {
|
||||||
|
GroundTileTypes type = middleLeft->GetTileType()->getType();
|
||||||
|
if(type != Tiles::AIR->getType()) {
|
||||||
|
m_pMiddleLeftTexture->Draw(m_Position);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
WorldTile* middleRight = m_SurroundingTiles.GetTile(TileDirection::MiddleRight);
|
||||||
|
if(middleRight != nullptr) {
|
||||||
|
GroundTileTypes type = middleRight->GetTileType()->getType();
|
||||||
|
if(type != Tiles::AIR->getType()) {
|
||||||
|
m_pMiddleRightTexture->Draw(m_Position);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
WorldTile* bottomMiddle = m_SurroundingTiles.GetTile(TileDirection::BottomMiddle);
|
||||||
|
if(bottomMiddle != nullptr) {
|
||||||
|
GroundTileTypes type = bottomMiddle->GetTileType()->getType();
|
||||||
|
if(type != Tiles::AIR->getType()) {
|
||||||
|
m_pMiddleBottomTexture->Draw(m_Position);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// if(m_Hightlight) {
|
||||||
|
// for (int i = 0; i < 8; i++) {
|
||||||
|
// WorldTile* tile = m_SurroundingTiles.GetTile(static_cast<TileDirection>(i));
|
||||||
|
// if(tile != nullptr) { //Tile exists
|
||||||
|
// //TODO: Wow Big mess
|
||||||
|
// GroundTileTypes type = tile->GetTileType()->getType();
|
||||||
|
// if(type == Tiles::AIR->getType()) {
|
||||||
|
// utils::SetColor(Colors::BLACK);
|
||||||
|
// utils::FillRect(Rectf{tile->GetPosition(), Point2f{50,50}});
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
// if(type != Tiles::AIR->getType()) {
|
||||||
|
// utils::SetColor(Colors::YELLOW);
|
||||||
|
// utils::FillRect(Rectf{tile->GetPosition(), Point2f{50,50}});
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
//Tile is air, So check 8 tiles around
|
//Tile is air, So check 8 tiles around
|
||||||
// Check the 4 tiles diagonally
|
// Check the 4 tiles diagonally
|
||||||
|
|
||||||
|
|||||||
@@ -140,6 +140,12 @@ private:
|
|||||||
Texture* m_pBottomLeftTexture;
|
Texture* m_pBottomLeftTexture;
|
||||||
Texture* m_pBottomRightTexture;
|
Texture* m_pBottomRightTexture;
|
||||||
|
|
||||||
|
Texture* m_pMiddleTopTexture;
|
||||||
|
Texture* m_pMiddleBottomTexture;
|
||||||
|
Texture* m_pMiddleLeftTexture;
|
||||||
|
Texture* m_pMiddleRightTexture;
|
||||||
|
|
||||||
|
Texture* m_pAllTexture;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
BIN
Resources/fonts/verdana.ttf
Normal file
BIN
Resources/fonts/verdana.ttf
Normal file
Binary file not shown.
BIN
Resources/tiles/dirt/sidepieces/all.png
Normal file
BIN
Resources/tiles/dirt/sidepieces/all.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
BIN
Resources/tiles/dirt/sidepieces/middleBottom.png
Normal file
BIN
Resources/tiles/dirt/sidepieces/middleBottom.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 869 B |
BIN
Resources/tiles/dirt/sidepieces/middleLeft.png
Normal file
BIN
Resources/tiles/dirt/sidepieces/middleLeft.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 927 B |
BIN
Resources/tiles/dirt/sidepieces/middleRight.png
Normal file
BIN
Resources/tiles/dirt/sidepieces/middleRight.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 931 B |
BIN
Resources/tiles/dirt/sidepieces/middleTop.png
Normal file
BIN
Resources/tiles/dirt/sidepieces/middleTop.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 868 B |
Reference in New Issue
Block a user