Now has an actual game loop where you die and start over.
This commit is contained in:
parent
514bfec0ea
commit
009c5c1cd2
10 changed files with 124 additions and 86 deletions
|
|
@ -27,12 +27,14 @@ namespace gui {
|
|||
ROTATING=__LINE__,
|
||||
LOOTING=__LINE__,
|
||||
IDLE=__LINE__,
|
||||
END=__LINE__,
|
||||
END_QUIT=__LINE__,
|
||||
END_PLAYER_DIED=__LINE__,
|
||||
END_PLAY_AGAIN=__LINE__,
|
||||
};
|
||||
|
||||
class FSM : public DeadSimpleFSM<State, game::Event> {
|
||||
public:
|
||||
sf::RenderWindow $window;
|
||||
sf::RenderWindow& $window;
|
||||
bool $draw_stats = false;
|
||||
DebugUI $debug_ui;
|
||||
MainUI $main_ui;
|
||||
|
|
@ -51,7 +53,7 @@ namespace gui {
|
|||
std::shared_ptr<gui::SceneUI> $cur_scene = nullptr;
|
||||
std::shared_ptr<storyboard::UI> $story = nullptr;
|
||||
|
||||
FSM();
|
||||
FSM(sf::RenderWindow& window);
|
||||
|
||||
void event(game::Event ev, std::any data={});
|
||||
|
||||
|
|
@ -67,7 +69,9 @@ namespace gui {
|
|||
void MAPPING(game::Event ev);
|
||||
void ROTATING(game::Event ev);
|
||||
void LOOTING(game::Event ev, std::any data);
|
||||
void END(game::Event ev);
|
||||
void END_QUIT(game::Event ev);
|
||||
void END_PLAYER_DIED(game::Event ev);
|
||||
void END_PLAY_AGAIN(game::Event ev);
|
||||
|
||||
void try_move(int dir, bool strafe);
|
||||
sf::Vector2f mouse_position();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue