The open source repository for the action RPG game in development by Sig Productions titled 'Adventures in Lestoria'! https://forums.lestoria.net
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
AdventuresInLestoria/Crawler/State_GameRun.cpp

36 lines
984 B

#include "State_GameRun.h"
#include "Crawler.h"
#include "DEFINES.h"
#include "Menu.h"
INCLUDE_MONSTER_LIST
INCLUDE_game
void State_GameRun::OnStateChange(GameState*prevState){
Menu::CloseAllMenus();
game->GetPlayer()->SetState(State::NORMAL);
};
void State_GameRun::OnUserUpdate(Crawler*game){
game->bossDisplayTimer=std::max(0.f,game->bossDisplayTimer-game->GetElapsedTime());
if(game->encounterStarted&&game->totalBossEncounterMobs>0){
game->encounterDuration+=game->GetElapsedTime();
}
game->HandleUserInput(game->GetElapsedTime());
game->UpdateEffects(game->GetElapsedTime());
game->GetPlayer()->Update(game->GetElapsedTime());
for(Monster&m:MONSTER_LIST){
m.Update(game->GetElapsedTime());
}
for(Monster&m:game->monstersToBeSpawned){
MONSTER_LIST.push_back(m);
}
game->monstersToBeSpawned.clear();
game->UpdateBullets(game->GetElapsedTime());
game->UpdateCamera(game->GetElapsedTime());
};
void State_GameRun::Draw(Crawler*game){
game->RenderHud();
};