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.
48 lines
1.4 KiB
48 lines
1.4 KiB
#pragma once
|
|
#include <SFML/Graphics/RenderWindow.hpp>
|
|
#include <SFML/Graphics/Font.hpp>
|
|
#include "guecs.hpp"
|
|
#include "textures.hpp"
|
|
#include "components.hpp"
|
|
#include <SFML/System/Clock.hpp>
|
|
|
|
// aspect ratio of art is 3/2 so 1.5
|
|
// possible sizes: 900/600; 1620/1080; 1800/1200
|
|
// To calculate it do short side * 1.5 so 1080 * 1.5 == 1620
|
|
//
|
|
// Side panel = 300/1080
|
|
|
|
namespace gui {
|
|
using std::string;
|
|
|
|
class BossFightUI {
|
|
public:
|
|
sf::Clock $clock;
|
|
bool $boss_hit = false;
|
|
sf::Vector2f $boss_pos;
|
|
components::Combat $combat;
|
|
components::Sprite $sprite_config;
|
|
components::Sound $sounds;
|
|
components::Animation $animation;
|
|
guecs::UI $status;
|
|
guecs::UI $overlay;
|
|
textures::SpriteTexture $boss_image;
|
|
textures::SpriteTexture $boss_background;
|
|
bool $boss_has_stage = false;
|
|
textures::SpriteTexture $boss_stage;
|
|
std::shared_ptr<DinkyECS::World> $world = nullptr;
|
|
DinkyECS::Entity $boss_id;
|
|
components::GameConfig& $config;
|
|
|
|
BossFightUI(std::shared_ptr<DinkyECS::World> world, DinkyECS::Entity boss_id);
|
|
|
|
void init();
|
|
void render(sf::RenderWindow& window);
|
|
bool mouse(float x, float y);
|
|
void bounce_boss(sf::RenderWindow& window);
|
|
bool boss_dead() { return $combat.hp < 0; }
|
|
void configure_sprite();
|
|
void configure_background();
|
|
void configure_gui();
|
|
};
|
|
}
|
|
|