Skip to content

Commit

Permalink
formal sandbox
Browse files Browse the repository at this point in the history
  • Loading branch information
ntut-Tu committed Jun 14, 2024
1 parent 9447482 commit dc10fd4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion include/AI/AIGroupCommander.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class AIGroupCommander {
glm::vec2 findTargetForOffensiveUnit(std::shared_ptr<Avatar> unit){
glm::vec2 targetCell = {-10.f,-10.f};
//issue: empty group should delete before this
if(static_cast<int>(m_offensiveGroup.size())>=static_cast<int>(m_PlayerUnitManager->getAvatarManager()->getAvatarArray().size())){
if(static_cast<int>(m_offensiveGroup.size())>=static_cast<int>(m_PlayerUnitManager->getAvatarManager()->getAvatarArray().size())&&!m_PlayerUnitManager->getStructureManager()->getStructureArray()->getBuiltStructureArray().empty()){
if(!m_PlayerUnitManager->getStructureManager()->getStructureArray()->getBuiltStructureArray().empty()){
targetCell=m_PlayerUnitManager->getStructureManager()->getStructureArray()->getBuiltStructureArray().front()->getTopRightCell();
}else{
Expand Down
10 changes: 4 additions & 6 deletions src/Scene/SandBoxScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,14 @@ void SandBoxScene::stageUpdate() {
m_stage = Stages::STAGE3;
m_EnemyScripts->Start(m_GameObjectManager, m_EnemyObjectManager,
m_Map);

stageStart();
}
if (Util::Input::IsKeyPressed(Util::Keycode::NUM_4)) {
m_stage = Stages::STAGE4;
m_EnemyScripts->Start(m_GameObjectManager, m_EnemyObjectManager,
m_Map, true);
m_EnemyObjectManager->setCheatMode(true);
stageStart();
}
}else if(m_stage == Stages::FORMAL_START){
Expand All @@ -156,15 +158,11 @@ void SandBoxScene::stageUpdate() {
}

if(m_stage == Stages::PLAYER_WON){

}else if(m_stage == Stages::AI_WON){

}
if (Util::Input::IsKeyPressed(Util::Keycode::DEBUG_KEY )) {
if(m_EnemyObjectManager->getCheatMode()){
m_EnemyObjectManager->setCheatMode(false);
}else{
m_EnemyObjectManager->setCheatMode(true);
}
m_EnemyObjectManager->setCheatMode(true);
}
}

0 comments on commit dc10fd4

Please sign in to comment.