Music deletion fix. Set a starting camera location for a level.

CorrectiveAction
sigonasr2 1 year ago
parent 223e26afe5
commit ca39790119
  1. 15
      olcCodeJam2023Entry/Info.txt
  2. 2
      olcCodeJam2023Entry/Level.h
  3. 16
      olcCodeJam2023Entry/VirusAttack.cpp

@ -77,8 +77,10 @@ Stage 2:
Now select the memory allocator and let's make a Shifter unit. Now select the memory allocator and let's make a Shifter unit.
The memory shifters will be your way to delete memory from units. The memory shifters will be your way to delete memory from units.
I have detected viruses in the system again. Please eradicate them and free system resources. I have detected viruses in the system again. Please eradicate them and free system resources.
(New Scenario Objective:
-Defeat all enemy units)
Stage 2.5: Stage 3:
I haven't touched on what the other meters on your units are, but they are important. I haven't touched on what the other meters on your units are, but they are important.
The Blue bits indicates movement capabilities of a unit. The Blue bits indicates movement capabilities of a unit.
The Green bits indicates the range of a unit. The Green bits indicates the range of a unit.
@ -87,8 +89,11 @@ Stage 2.5:
As units attack each other, their bits are going to get shuffled around, impeding their ability to perform. As units attack each other, their bits are going to get shuffled around, impeding their ability to perform.
Your immediate goal is to always take out the Yellow bits but sometimes taking out other bits is important too. Your immediate goal is to always take out the Yellow bits but sometimes taking out other bits is important too.
I'll leave a guide by the map in case your memory betrays you. I'll leave a guide by the map in case your memory betrays you.
(Guide Enabled)
(New Scenario Objective:
-Defeat all enemy units)
Stage 3: Stage 4:
(Start with 3 of the yellow resource) (Start with 3 of the yellow resource)
Hacker, I have unfortunate news. I can't supply you with any more bits to construct things with. Hacker, I have unfortunate news. I can't supply you with any more bits to construct things with.
You've only got 3 health bits to start with this time. To allocate memory you always need at least 5 bits of memory. You've only got 3 health bits to start with this time. To allocate memory you always need at least 5 bits of memory.
@ -101,8 +106,10 @@ Stage 3:
An ambush...? I, WHAT? -- THIS IS NOT- An ambush...? I, WHAT? -- THIS IS NOT-
Screen glitches out and fades away Screen glitches out and fades away
Stage 4: Stage 5:
(New Scenario Objective:
-Defeat all enemy units)

@ -29,4 +29,6 @@ struct Level{
std::vector<UnitData>unitPlacement; std::vector<UnitData>unitPlacement;
std::vector<CPData>cpPlacement; std::vector<CPData>cpPlacement;
Sound bgm=Sound::COSMOS; Sound bgm=Sound::COSMOS;
vf2d cameraStart={96,96};
vf2d worldZoom={1,1};
}; };

@ -154,15 +154,25 @@ void VirusAttack::LoadLevel(LevelName level){
WORLD_SIZE=selectedLevel.size; WORLD_SIZE=selectedLevel.size;
if(bgm!=nullptr){ game.SetWorldScale(selectedLevel.worldZoom);
game.SetWorldOffset(selectedLevel.cameraStart-vf2d(GetScreenSize())/2.f/game.GetWorldScale());
if(bgm==nullptr){
bgm=SOUNDS[selectedLevel.bgm].get();
bgm->PlayCentered(1,1,true);
} else
if(bgm!=SOUNDS[selectedLevel.bgm].get()){
bgm->Stop(); bgm->Stop();
bgm=SOUNDS[selectedLevel.bgm].get();
bgm->PlayCentered(1,1,true);
} }
bgm=SOUNDS[selectedLevel.bgm].get();
bgm->PlayCentered(1,1,true);
player_resources=selectedLevel.player_starting_resources; player_resources=selectedLevel.player_starting_resources;
enemy_resources=selectedLevel.enemy_starting_resources; enemy_resources=selectedLevel.enemy_starting_resources;
TileManager::visibleTiles.clear(); TileManager::visibleTiles.clear();
std::for_each(units.begin(),units.end(),[&](auto&u){
u->OnDeath(SOUNDS);
});
units.clear(); units.clear();
collectionPoints.clear(); collectionPoints.clear();

Loading…
Cancel
Save