We now have a full map that's basically the same mapping system from Roguish. There's a bug right now where it needs you to move once to calc the light and it's not being centered, but it does work.
This commit is contained in:
parent
55b67dcf5d
commit
d798d154ae
22 changed files with 1270 additions and 47 deletions
27
gui.hpp
27
gui.hpp
|
@ -5,11 +5,30 @@
|
|||
#include "levelmanager.hpp"
|
||||
#include "camera.hpp"
|
||||
#include "fsm.hpp"
|
||||
#include "render.hpp"
|
||||
#include "panel.hpp"
|
||||
#include <ftxui/dom/canvas.hpp>
|
||||
|
||||
using ftxui::Canvas;
|
||||
|
||||
namespace gui {
|
||||
class MapViewUI : public Panel {
|
||||
public:
|
||||
Canvas $canvas;
|
||||
GameLevel $level;
|
||||
|
||||
MapViewUI(GameLevel &level);
|
||||
void create_render();
|
||||
void resize_canvas();
|
||||
void draw_map();
|
||||
void update_level(GameLevel &level);
|
||||
};
|
||||
|
||||
|
||||
enum class State {
|
||||
START,
|
||||
MOVING,
|
||||
MAPPING,
|
||||
ROTATING,
|
||||
IDLE,
|
||||
END
|
||||
|
@ -22,6 +41,8 @@ namespace gui {
|
|||
MOVE_BACK,
|
||||
MOVE_LEFT,
|
||||
MOVE_RIGHT,
|
||||
MAP_OPEN,
|
||||
CLOSE,
|
||||
ROTATE_LEFT,
|
||||
ROTATE_RIGHT,
|
||||
QUIT
|
||||
|
@ -29,15 +50,16 @@ namespace gui {
|
|||
|
||||
class FSM : public DeadSimpleFSM<State, Event> {
|
||||
public:
|
||||
GameLevel $level;
|
||||
float $rotation = -30.0f;
|
||||
Point $player{0,0};
|
||||
LevelManager $levels;
|
||||
sf::RenderWindow $window;
|
||||
SFMLRender $renderer;
|
||||
GameLevel $level;
|
||||
MapViewUI $map_view;
|
||||
CameraLOL $camera;
|
||||
sf::Font $font;
|
||||
sf::Text $text;
|
||||
sf::Text $map_display;
|
||||
Stats $stats;
|
||||
TexturePack $textures;
|
||||
Raycaster $rayview;
|
||||
|
@ -48,6 +70,7 @@ namespace gui {
|
|||
|
||||
void START(Event );
|
||||
void MOVING(Event );
|
||||
void MAPPING(Event);
|
||||
void ROTATING(Event );
|
||||
void IDLE(Event ev);
|
||||
void END(Event ev);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue