|
|
@ -212,6 +212,7 @@ namespace gui { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void FSM::draw_weapon() { |
|
|
|
void FSM::draw_weapon() { |
|
|
|
|
|
|
|
return; |
|
|
|
auto weapon = $rayview.$textures.sword.sprite; |
|
|
|
auto weapon = $rayview.$textures.sword.sprite; |
|
|
|
weapon->setPosition({SCREEN_WIDTH/2, SCREEN_HEIGHT/2}); |
|
|
|
weapon->setPosition({SCREEN_WIDTH/2, SCREEN_HEIGHT/2}); |
|
|
|
weapon->setRotation(sf::degrees($rotation)); |
|
|
|
weapon->setRotation(sf::degrees($rotation)); |
|
|
@ -224,6 +225,11 @@ namespace gui { |
|
|
|
rect.setFillColor({50, 50, 50}); |
|
|
|
rect.setFillColor({50, 50, 50}); |
|
|
|
$window.draw(rect); |
|
|
|
$window.draw(rect); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sf::RectangleShape lower({RAY_VIEW_WIDTH, SCREEN_HEIGHT - RAY_VIEW_HEIGHT}); |
|
|
|
|
|
|
|
lower.setPosition({RAY_VIEW_X,RAY_VIEW_HEIGHT}); |
|
|
|
|
|
|
|
lower.setFillColor({40, 40, 40}); |
|
|
|
|
|
|
|
$window.draw(lower); |
|
|
|
|
|
|
|
|
|
|
|
auto player = $level.world->get_the<Player>(); |
|
|
|
auto player = $level.world->get_the<Player>(); |
|
|
|
auto player_combat = $level.world->get<Combat>(player.entity); |
|
|
|
auto player_combat = $level.world->get<Combat>(player.entity); |
|
|
|
|
|
|
|
|
|
|
@ -249,6 +255,8 @@ namespace gui { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void FSM::render() { |
|
|
|
void FSM::render() { |
|
|
|
|
|
|
|
draw_gui(); |
|
|
|
|
|
|
|
|
|
|
|
if(in_state(State::MAPPING)) { |
|
|
|
if(in_state(State::MAPPING)) { |
|
|
|
$window.clear(); |
|
|
|
$window.clear(); |
|
|
|
$map_view.render(); |
|
|
|
$map_view.render(); |
|
|
@ -263,7 +271,6 @@ namespace gui { |
|
|
|
draw_weapon(); |
|
|
|
draw_weapon(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
draw_gui(); |
|
|
|
|
|
|
|
$window.display(); |
|
|
|
$window.display(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|