Exploring raycasters and possibly make a little "doom like" game based on it.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
raycaster/gui.hpp

61 lines
1.1 KiB

#pragma once
#include "raycaster.hpp"
#include "constants.hpp"
#include "stats.hpp"
#include "levelmanager.hpp"
#include "camera.hpp"
#include "fsm.hpp"
namespace gui {
enum class State {
START,
MOVING,
ROTATING,
IDLE,
END
};
enum class Event {
STARTED,
TICK,
MOVE_FORWARD,
MOVE_BACK,
MOVE_LEFT,
MOVE_RIGHT,
ROTATE_LEFT,
ROTATE_RIGHT,
QUIT
};
class FSM : public DeadSimpleFSM<State, Event> {
public:
float $rotation = -30.0f;
Point $player{0,0};
LevelManager $levels;
sf::RenderWindow $window;
CameraLOL $camera;
sf::Font $font;
sf::Text $text;
Stats $stats;
TexturePack $textures;
Raycaster $rayview;
FSM();
void event(Event ev);
void START(Event );
void MOVING(Event );
void ROTATING(Event );
void IDLE(Event ev);
void END(Event ev);
void keyboard();
void draw_weapon();
void draw_gui();
void render();
void mouse();
void generate_map();
bool active();
};
}