Started working on this 'arena tester' tool that would let me load an enemy and test them, but then realized I could just make it so I can spawn enemies in the game. I'm keeping the arena around as it will be useful later as a scriptable testing tool, but for now just spawn and test.
This commit is contained in:
parent
b6c1eba1b3
commit
4f090159ab
14 changed files with 524 additions and 58 deletions
45
tools/arena_ui.hpp
Normal file
45
tools/arena_ui.hpp
Normal file
|
@ -0,0 +1,45 @@
|
|||
#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 arena {
|
||||
using std::string, std::shared_ptr;
|
||||
|
||||
class ArenaUI {
|
||||
public:
|
||||
sf::Clock $clock;
|
||||
bool $entity_hit = false;
|
||||
sf::Vector2f $entity_pos;
|
||||
components::Combat $combat;
|
||||
components::Sprite $sprite_config;
|
||||
components::Sound $sounds;
|
||||
components::Animation $animation;
|
||||
guecs::UI $status;
|
||||
guecs::UI $overlay;
|
||||
textures::SpriteTexture $entity_background;
|
||||
bool $entity_has_stage = false;
|
||||
textures::SpriteTexture $entity_stage;
|
||||
std::shared_ptr<DinkyECS::World> $world = nullptr;
|
||||
DinkyECS::Entity $entity_id;
|
||||
components::GameConfig& $config;
|
||||
|
||||
ArenaUI(shared_ptr<DinkyECS::World> world, DinkyECS::Entity entity_id);
|
||||
|
||||
void init();
|
||||
void render(sf::RenderWindow& window);
|
||||
bool mouse(float x, float y);
|
||||
void configure_sprite();
|
||||
void configure_background();
|
||||
void configure_gui();
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue