Cleaned up the arena code more and closer to pulling it out for a scene system.

This commit is contained in:
Zed A. Shaw 2025-10-23 00:29:15 -04:00
parent 25f7096489
commit 49c9702041
4 changed files with 65 additions and 43 deletions

View file

@ -6,6 +6,7 @@
#include "textures.hpp"
#include "gui/combat_ui.hpp"
#include "components.hpp"
#include <unordered_map>
struct AnimatedFixture {
textures::SpriteTexture st;
@ -29,15 +30,13 @@ namespace boss {
Entity $boss_id = NONE;
components::AnimatedScene $scene;
gui::CombatUI $combat_ui;
SpriteTexture $boss_sprite;
SpriteTexture $player_sprite;
SpriteTexture $floor_sprite;
guecs::UI $arena;
guecs::UI $actions;
components::Animation $boss_anim;
sf::Vector2f $boss_pos;
std::unordered_map<std::string, int> $actor_name_ids;
std::vector<AnimatedFixture> $fixtures;
std::vector<AnimatedFixture> $actors;
UI(shared_ptr<World> world, Entity boss_id);
@ -46,7 +45,8 @@ namespace boss {
bool mouse(float x, float y, guecs::Modifiers mods);
sf::Vector2f position_sprite(textures::SpriteTexture& st, const std::string& cell_name, float scale_x, float scale_y, bool at_mid, float x_diff=0.0f, float y_diff=0.0f);
void status(const std::wstring& msg);
sf::Vector2f move_actor(SpriteTexture& st, const std::string& actor, const std::string& cell_name);
void move_actor(const std::string& actor, const std::string& cell_name);
void animate_actor(const std::string& actor);
void play_animations();
};
}