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:
Zed A. Shaw 2025-04-04 12:45:55 -04:00
parent b6c1eba1b3
commit 4f090159ab
14 changed files with 524 additions and 58 deletions

52
tools/arena_fsm.hpp Normal file
View file

@ -0,0 +1,52 @@
#pragma once
#include "constants.hpp"
#include "stats.hpp"
#include "levelmanager.hpp"
#include "fsm.hpp"
#include "main_ui.hpp"
#include "combat_ui.hpp"
#include "status_ui.hpp"
#include "arena_ui.hpp"
#include "map_view.hpp"
#include "mini_map.hpp"
namespace arena {
enum class State {
START,
IDLE,
END
};
enum class Event {
STARTED=0,
TICK=1,
CLOSE = 7,
ATTACK = 10,
QUIT = 14
};
class FSM : public DeadSimpleFSM<State, Event> {
public:
std::string $enemy_name;
sf::RenderWindow $window;
sf::Font $font;
LevelManager $level_mgr;
GameLevel $level;
shared_ptr<arena::ArenaUI> $arena_ui = nullptr;
FSM(std::string enemy_name);
void event(Event ev);
void START(Event );
void IDLE(Event ev);
void END(Event ev);
void try_move(int dir, bool strafe);
void keyboard_mouse();
void draw_gui();
void render();
bool active();
void run_systems();
void handle_world_events();
};
}