Create the systems.cpp for the boss fight mini game.

This commit is contained in:
Zed A. Shaw 2025-09-25 11:40:09 -04:00
parent 27b71d4ba3
commit 06f6098281
7 changed files with 67 additions and 38 deletions

View file

@ -1,5 +1,6 @@
#include "boss/ui.hpp"
#include "constants.hpp"
#include "components.hpp"
namespace boss {
using namespace guecs;
@ -7,11 +8,16 @@ namespace boss {
UI::UI(shared_ptr<World> world, Entity boss_id) :
$world(world),
$boss_id(boss_id),
$combat_ui(true),
$boss_sprite(textures::get_sprite("test_boss")),
$player_sprite(textures::get_sprite("test_player")),
$floor_sprite(textures::get_sprite("test_floor"))
$combat_ui(true)
{
auto& sprite = world->get<components::Sprite>($boss_id);
$boss_sprite = textures::get_sprite(sprite.name);
auto& boss_conf = world->get<components::BossFight>($boss_id);
// floor is std::optional
$floor_sprite = textures::get_sprite(*boss_conf.floor);
$player_sprite = textures::get_sprite("test_player");
}
void UI::init() {