More on the boss fight sytem, just a basic FSM going.
This commit is contained in:
parent
a0861a8f57
commit
f33e14f2cf
7 changed files with 91 additions and 32 deletions
|
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#define FSM_DEBUG 1
|
||||
#include "simplefsm.hpp"
|
||||
#include "dinkyecs.hpp"
|
||||
#include "boss/ui.hpp"
|
||||
|
|
@ -12,7 +13,9 @@ namespace boss {
|
|||
|
||||
enum class State {
|
||||
START=0,
|
||||
END=1
|
||||
BOSS_TURN=1,
|
||||
PLAYER_TURN=2,
|
||||
END=3
|
||||
};
|
||||
|
||||
class Fight : public DeadSimpleFSM<State, gui::Event> {
|
||||
|
|
@ -21,16 +24,22 @@ namespace boss {
|
|||
DinkyECS::Entity $boss_id = NONE;
|
||||
boss::UI $ui;
|
||||
sf::Vector2f mouse_pos{0,0};
|
||||
int run = 0;
|
||||
|
||||
Fight(shared_ptr<World> world, DinkyECS::Entity boss_id);
|
||||
|
||||
bool handle_mouse(gui::Event ev);
|
||||
bool event(gui::Event ev, std::any data);
|
||||
|
||||
void START(gui::Event ev, std::any data);
|
||||
void BOSS_TURN(gui::Event ev, std::any data);
|
||||
void PLAYER_TURN(gui::Event ev, std::any data);
|
||||
void END(gui::Event ev, std::any data);
|
||||
|
||||
void render(sf::RenderWindow& window) {
|
||||
$ui.render(window);
|
||||
}
|
||||
|
||||
void run_systems();
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue