Basic ability to create a 'stage' for a boss fight, which is a thing in front the boss animates behind.
This commit is contained in:
parent
8b414c13e6
commit
243b4c2663
8 changed files with 25 additions and 3 deletions
|
@ -50,9 +50,16 @@ namespace gui {
|
|||
|
||||
void BossFightUI::configure_background() {
|
||||
auto& boss = $world->get<components::BossFight>($boss_id);
|
||||
$boss_has_stage = boss.stage != "none";
|
||||
|
||||
$boss_background = textures::get(boss.background);
|
||||
$boss_background.sprite->setPosition({BOSS_VIEW_X, BOSS_VIEW_Y});
|
||||
$status.world().set_the<Background>({$status.$parser});
|
||||
|
||||
if($boss_has_stage) {
|
||||
$boss_stage = textures::get(boss.stage);
|
||||
$boss_stage.sprite->setPosition({BOSS_VIEW_X, BOSS_VIEW_Y});
|
||||
}
|
||||
}
|
||||
|
||||
void BossFightUI::configure_gui() {
|
||||
|
@ -114,6 +121,10 @@ namespace gui {
|
|||
window.draw(*$boss_image.sprite);
|
||||
}
|
||||
|
||||
if($boss_has_stage) {
|
||||
window.draw(*$boss_stage.sprite);
|
||||
}
|
||||
|
||||
if($combat.hp == 0) {
|
||||
$overlay.show_label("overlay_1", "YOU WON!");
|
||||
$overlay.show_label("overlay_4", "CLICK TO CONTINUE...");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue