First step to a normal update/render loop.
This commit is contained in:
parent
46c6fce47e
commit
0ff5fd1980
3 changed files with 13 additions and 3 deletions
|
|
@ -399,20 +399,28 @@ namespace gui {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FSM::update() {
|
||||||
|
if(in_state(State::BOSS_FIGHT)) {
|
||||||
|
$boss_fight->update();
|
||||||
|
} else if(in_state(State::CUT_SCENE_PLAYING)) {
|
||||||
|
$boss_scene->update();
|
||||||
|
} else {
|
||||||
|
// BUG: look at draw_gui for the update for here
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void FSM::render() {
|
void FSM::render() {
|
||||||
$window.clear();
|
$window.clear();
|
||||||
|
|
||||||
if(in_state(State::BOSS_FIGHT)) {
|
if(in_state(State::BOSS_FIGHT)) {
|
||||||
$boss_fight->update();
|
|
||||||
$boss_fight->render($window);
|
$boss_fight->render($window);
|
||||||
// this clears any attack animations, like fire
|
// this clears any attack animations, like fire
|
||||||
System::clear_attack();
|
|
||||||
} else if(in_state(State::CUT_SCENE_PLAYING)) {
|
} else if(in_state(State::CUT_SCENE_PLAYING)) {
|
||||||
$boss_scene->update();
|
|
||||||
$boss_scene->render($window);
|
$boss_scene->render($window);
|
||||||
} else {
|
} else {
|
||||||
// this clears any attack animations, like fire
|
// this clears any attack animations, like fire
|
||||||
System::clear_attack();
|
System::clear_attack();
|
||||||
|
// BUG: this is the render for this class, and where I add an update
|
||||||
draw_gui();
|
draw_gui();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,7 @@ namespace gui {
|
||||||
void mouse_action(guecs::Modifiers mods);
|
void mouse_action(guecs::Modifiers mods);
|
||||||
void handle_keyboard_mouse();
|
void handle_keyboard_mouse();
|
||||||
void draw_gui();
|
void draw_gui();
|
||||||
|
void update();
|
||||||
void render();
|
void render();
|
||||||
bool active();
|
bool active();
|
||||||
void run_systems();
|
void run_systems();
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ int main(int argc, char* argv[]) {
|
||||||
}
|
}
|
||||||
|
|
||||||
while(main.active()) {
|
while(main.active()) {
|
||||||
|
main.update();
|
||||||
main.render();
|
main.render();
|
||||||
|
|
||||||
if(main.in_state(gui::State::BOSS_FIGHT)) {
|
if(main.in_state(gui::State::BOSS_FIGHT)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue