Collection Point AI fix.

master
sigonasr2 1 year ago
parent 020c15bcc3
commit f63c2b00ca
  1. 12
      olcCodeJam2023Entry/Scenario.cpp
  2. 2
      olcCodeJam2023Entry/pge.js
  3. BIN
      olcCodeJam2023Entry/pge.wasm

@ -93,7 +93,7 @@ void Scenario::RunAI(Resources&enemy_resources,std::vector<std::shared_ptr<Colle
} }
} }
for(auto&key:cpCheckTimer){ for(auto&key:cpCheckTimer){
cpCheckTimer[key.first]=std::max(0.0f,game.GetPGE()->GetElapsedTime()); cpCheckTimer[key.first]=std::max(0.0f,cpCheckTimer[key.first]-game.GetPGE()->GetElapsedTime());
} }
int memoryAllocatorCount=0; int memoryAllocatorCount=0;
for(auto&u:units){ for(auto&u:units){
@ -752,6 +752,7 @@ void Stage6::Update(){
if(box.bPressed){ if(box.bPressed){
flags.playerInControl=true; flags.playerInControl=true;
box.SetVisible(false); box.SetVisible(false);
state=1;
} }
}break; }break;
} }
@ -803,14 +804,19 @@ Stage8::Stage8(std::vector<std::shared_ptr<Unit>>&units,std::vector<std::unique_
:Scenario(units,IMAGES,SOUNDS,objective,game,flags){} :Scenario(units,IMAGES,SOUNDS,objective,game,flags){}
void Stage8::Start(){ void Stage8::Start(){
SetCameraTarget({4*24,4*24},true); SetCameraTarget({4*24,4*24},true);
flags.playerInControl=true; flags.playerInControl=false;
SetObjective("Defeat all enemy units."); SetObjective("Defeat all enemy units.");
nextLevel=LevelName::FINISH; nextLevel=LevelName::FINISH;
}; };
void Stage8::Update(){ void Stage8::Update(){
switch(state){ switch(state){
case 0:{ case 0:{
DisplayBox("You need to cease all operations, you are causing more harm than good.");
if(box.bPressed){
state=1;
flags.playerInControl=true;
box.SetVisible(false);
}
}break; }break;
} }
}; };

File diff suppressed because one or more lines are too long

Binary file not shown.
Loading…
Cancel
Save