diff --git a/Resources/map/easy/sidebar.bmp b/Resources/map/easy/sidebar.bmp new file mode 100644 index 0000000..4edbf77 Binary files /dev/null and b/Resources/map/easy/sidebar.bmp differ diff --git a/Resources/map/hard/sidebar.bmp b/Resources/map/hard/sidebar.bmp new file mode 100644 index 0000000..26eeec5 Binary files /dev/null and b/Resources/map/hard/sidebar.bmp differ diff --git a/Resources/map/medium/sidebar.bmp b/Resources/map/medium/sidebar.bmp new file mode 100644 index 0000000..f0d761f Binary files /dev/null and b/Resources/map/medium/sidebar.bmp differ diff --git a/Source/Game/BtdClass/GameManager.cpp b/Source/Game/BtdClass/GameManager.cpp index d76d73f..7708bc0 100644 --- a/Source/Game/BtdClass/GameManager.cpp +++ b/Source/Game/BtdClass/GameManager.cpp @@ -160,8 +160,8 @@ namespace Btd void GameManager::OnShow() { map->ShowBackground(); - map->ShowFactoryButton(); map->ShowRoad(); + map->ShowFactoryButton(); for (int i = 0; i < static_cast(TowerFactory::TowerVector.size()); i++) { TowerFactory::TowerVector[i]->TowerShow(); diff --git a/Source/Game/BtdClass/TowerFactory.cpp b/Source/Game/BtdClass/TowerFactory.cpp index ce0e34e..9a0b6a4 100644 --- a/Source/Game/BtdClass/TowerFactory.cpp +++ b/Source/Game/BtdClass/TowerFactory.cpp @@ -52,15 +52,15 @@ void Btd::TowerFactory::MakeTower(TowerType attribute) } case ice: { - shared_ptr ice = make_shared(IceTower()); - ice->LoadBitmapByString({"resources/towers/ice/tower_ice.bmp"}, RGB(0, 0, 0)); - ice->SetCenter(GetCursorPosX(), GetCursorPosY()); - ice->SetIsMove(true); - ice->SetShootDeltaTime(3); - ice->SetActive(false); - ice->RangeCircle.LoadBitmapByString({"resources/towers/range.bmp", "resources/towers/range_red.bmp"}, RGB(0, 0, 0)); - ice->RangeCircle.SetCenter(GetCursorPosX(), GetCursorPosY()); - TowerVector.push_back(ice); + // shared_ptr ice = make_shared(IceTower()); + // ice->LoadBitmapByString({"resources/towers/ice/tower_ice.bmp"}, RGB(0, 0, 0)); + // ice->SetCenter(GetCursorPosX(), GetCursorPosY()); + // ice->SetIsMove(true); + // ice->SetShootDeltaTime(3); + // ice->SetActive(false); + // ice->RangeCircle.LoadBitmapByString({"resources/towers/range.bmp", "resources/towers/range_red.bmp"}, RGB(0, 0, 0)); + // ice->RangeCircle.SetCenter(GetCursorPosX(), GetCursorPosY()); + // TowerVector.push_back(ice); } default: break; diff --git a/Source/Game/BtdClass/map.cpp b/Source/Game/BtdClass/map.cpp index 1d7fb52..fffc52e 100644 --- a/Source/Game/BtdClass/map.cpp +++ b/Source/Game/BtdClass/map.cpp @@ -101,6 +101,8 @@ namespace Btd tmpRoad.SetTag("road"); _road.push_back(tmpRoad); } + _sidebar.LoadBitmapByString({"resources/map/" + roadPath[type] + "/sidebar.bmp"}); + _sidebar.SetTopLeft(732, 11); } void Map::ShowRoad() @@ -109,6 +111,7 @@ namespace Btd { _road[i].ShowBitmap(); } + _sidebar.ShowBitmap(); } void Map::InitBackground(MapType::MapType type) @@ -200,6 +203,10 @@ namespace Btd return true; } } + if (Btd::IsOverlap(_sidebar, target)) + { + return true; + } return false; }; diff --git a/Source/Game/BtdClass/map.h b/Source/Game/BtdClass/map.h index 500962d..cd631cb 100644 --- a/Source/Game/BtdClass/map.h +++ b/Source/Game/BtdClass/map.h @@ -39,6 +39,7 @@ namespace Btd static vector _route; static Vector2 _startPosition; vector> _rounds; + GameObject _sidebar; }; } diff --git a/Source/Game/mygame_initialize.cpp b/Source/Game/mygame_initialize.cpp index db2cb87..4016604 100644 --- a/Source/Game/mygame_initialize.cpp +++ b/Source/Game/mygame_initialize.cpp @@ -84,11 +84,17 @@ void CGameStateInit::OnLButtonDown(UINT nFlags, CPoint point) void CGameStateInit::OnMouseMove(UINT nFlags, CPoint point) { - for (int i = 0; i < 3; i++) + if (_mapButton[2].IsBitmapLoaded()) { - if (IsCursorInObj(static_cast(_mapButton[i]))) + for (int i = 0; i < 3; i++) { - map = selectedMaps[i]; + if (IsCursorInObj(static_cast(_mapButton[i]))) + { + if (Btd::IsCursorInObj(static_cast(_mapButton[i]))) + { + map = selectedMaps[i]; + } + } } } }