A little bit of layout up and displaying to get started.
This commit is contained in:
parent
07e281d987
commit
7cdd96ef73
3 changed files with 20 additions and 11 deletions
|
|
@ -15,10 +15,8 @@ namespace combat {
|
||||||
|
|
||||||
if(enemy.ai.active()) {
|
if(enemy.ai.active()) {
|
||||||
if(enemy.ai.wants_to("kill_enemy")) {
|
if(enemy.ai.wants_to("kill_enemy")) {
|
||||||
fmt::println(">> enemy {} wants to KILL", entity);
|
|
||||||
pending_actions.emplace_back(enemy, BattleAction::ATTACK);
|
pending_actions.emplace_back(enemy, BattleAction::ATTACK);
|
||||||
} else if(enemy.ai.wants_to("run_away")) {
|
} else if(enemy.ai.wants_to("run_away")) {
|
||||||
fmt::println(">> enemy {} wants to RUN", entity);
|
|
||||||
pending_actions.emplace_back(enemy, BattleAction::ESCAPE);
|
pending_actions.emplace_back(enemy, BattleAction::ESCAPE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
26
boss/ui.cpp
26
boss/ui.cpp
|
|
@ -1,24 +1,32 @@
|
||||||
#include "boss/ui.hpp"
|
#include "boss/ui.hpp"
|
||||||
|
#include "constants.hpp"
|
||||||
|
|
||||||
namespace boss {
|
namespace boss {
|
||||||
UI::UI(shared_ptr<World> world, Entity boss_id) {
|
UI::UI(shared_ptr<World> world, Entity boss_id)
|
||||||
(void)world;
|
: $world(world), $boss_id(boss_id)
|
||||||
(void)boss_id;
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void UI::init() {
|
void UI::init() {
|
||||||
|
$gui.position(SCREEN_WIDTH-BOSS_VIEW_WIDTH,0, BOSS_VIEW_WIDTH, SCREEN_HEIGHT);
|
||||||
|
$gui.layout(
|
||||||
|
"[a1|b1|c1|d1|e1|f1]"
|
||||||
|
"[a2|b2|c2|d2|e2|f2]"
|
||||||
|
"[a3|b3|c3|d3|e3|f3]"
|
||||||
|
"[a4|b4|c4|d4|e4|f4]"
|
||||||
|
"[a5|b5|c5|d5|e5|f5]"
|
||||||
|
"[a6|b6|c6|d6|e6|f6]"
|
||||||
|
);
|
||||||
|
$gui.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
void UI::render(sf::RenderWindow& window) {
|
void UI::render(sf::RenderWindow& window) {
|
||||||
(void)window;
|
$gui.render(window);
|
||||||
|
$gui.debug_layout(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool UI::mouse(float x, float y, guecs::Modifiers mods) {
|
bool UI::mouse(float x, float y, guecs::Modifiers mods) {
|
||||||
(void)x;
|
return $gui.mouse(x, y, mods);
|
||||||
(void)y;
|
|
||||||
(void)mods;
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool UI::boss_dead() {
|
bool UI::boss_dead() {
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,9 @@ namespace boss {
|
||||||
using namespace DinkyECS;
|
using namespace DinkyECS;
|
||||||
|
|
||||||
struct UI {
|
struct UI {
|
||||||
|
shared_ptr<World> $world = nullptr;
|
||||||
|
Entity $boss_id = NONE;
|
||||||
|
guecs::UI $gui;
|
||||||
|
|
||||||
UI(shared_ptr<World> world, Entity boss_id);
|
UI(shared_ptr<World> world, Entity boss_id);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue