Have the first little turn based system going.
This commit is contained in:
parent
f33e14f2cf
commit
ee9f8c7c4b
4 changed files with 10 additions and 2 deletions
|
|
@ -65,6 +65,7 @@ namespace boss {
|
||||||
run_systems();
|
run_systems();
|
||||||
break;
|
break;
|
||||||
case ATTACK:
|
case ATTACK:
|
||||||
|
$ui.status(L"PLAYER TURN");
|
||||||
state(State::PLAYER_TURN);
|
state(State::PLAYER_TURN);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
@ -81,6 +82,7 @@ namespace boss {
|
||||||
state(State::END);
|
state(State::END);
|
||||||
break;
|
break;
|
||||||
case ATTACK: {
|
case ATTACK: {
|
||||||
|
$ui.status(L"PLAYER TURN");
|
||||||
int attack_id = std::any_cast<int>(data);
|
int attack_id = std::any_cast<int>(data);
|
||||||
boss::System::combat(attack_id);
|
boss::System::combat(attack_id);
|
||||||
state(State::PLAYER_TURN);
|
state(State::PLAYER_TURN);
|
||||||
|
|
@ -100,6 +102,7 @@ namespace boss {
|
||||||
state(State::END);
|
state(State::END);
|
||||||
break;
|
break;
|
||||||
case ATTACK: {
|
case ATTACK: {
|
||||||
|
$ui.status(L"BOSS TURN");
|
||||||
int attack_id = std::any_cast<int>(data);
|
int attack_id = std::any_cast<int>(data);
|
||||||
boss::System::combat(attack_id);
|
boss::System::combat(attack_id);
|
||||||
state(State::BOSS_TURN);
|
state(State::BOSS_TURN);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define FSM_DEBUG 1
|
|
||||||
#include "simplefsm.hpp"
|
#include "simplefsm.hpp"
|
||||||
#include "dinkyecs.hpp"
|
#include "dinkyecs.hpp"
|
||||||
#include "boss/ui.hpp"
|
#include "boss/ui.hpp"
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ namespace boss {
|
||||||
background.set_sprite($scene.background, true);
|
background.set_sprite($scene.background, true);
|
||||||
|
|
||||||
$arena.layout(
|
$arena.layout(
|
||||||
"[_ |boss1 |boss2 |boss3 |boss4 |_]"
|
"[status|boss1 |boss2 |boss3 |boss4 |_]"
|
||||||
"[_ |boss5 |boss6 |boss7 |boss8 |_]"
|
"[_ |boss5 |boss6 |boss7 |boss8 |_]"
|
||||||
"[floor1|boss9 |boss10|boss11|boss12|_]"
|
"[floor1|boss9 |boss10|boss11|boss12|_]"
|
||||||
"[floor2|boss13|boss14|boss15|boss16|_]"
|
"[floor2|boss13|boss14|boss15|boss16|_]"
|
||||||
|
|
@ -86,4 +86,9 @@ namespace boss {
|
||||||
|| $combat_ui.mouse(x, y, mods)
|
|| $combat_ui.mouse(x, y, mods)
|
||||||
|| $actions.mouse(x, y, mods);
|
|| $actions.mouse(x, y, mods);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UI::status(const std::wstring& msg) {
|
||||||
|
$arena.show_text("status", msg);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,5 +32,6 @@ namespace boss {
|
||||||
void render(sf::RenderWindow& window);
|
void render(sf::RenderWindow& window);
|
||||||
bool mouse(float x, float y, guecs::Modifiers mods);
|
bool mouse(float x, float y, guecs::Modifiers mods);
|
||||||
void position_sprite(SpriteTexture& st, const std::string& name, float scale, bool at_mid=false);
|
void position_sprite(SpriteTexture& st, const std::string& name, float scale, bool at_mid=false);
|
||||||
|
void status(const std::wstring& msg);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue