Started to set things up so that the boss fight UI can load enemies and configs out of the components setup.

This commit is contained in:
Zed A. Shaw 2025-03-01 00:46:40 -05:00
parent 033358749f
commit b3b8cbbeee
5 changed files with 14 additions and 15 deletions

View file

@ -32,6 +32,9 @@ namespace gui {
}
void BossFightUI::init() {
auto& config = $level.world->get_the<components::GameConfig>();
$sounds = components::get<components::Sound>(config.enemies["RAT_KING"]);
$status.world().set_the<Background>({$status.$parser});
for(auto& [name, cell] : $status.cells()) {
@ -65,7 +68,7 @@ namespace gui {
$boss_image.sprite->setScale({scale, scale});
if(scale > 1.0) {
if(!sound::playing("Sword_Hit_2")) sound::play("Sword_Hit_2");
if(!sound::playing($sounds.attack)) sound::play($sounds.attack);
$boss_image.sprite->setColor({255,255,255});
}