aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/LoopManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe/api/LoopManager.cpp')
-rw-r--r--src/crepe/api/LoopManager.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/crepe/api/LoopManager.cpp b/src/crepe/api/LoopManager.cpp
index dc2d9e0..e4b1609 100644
--- a/src/crepe/api/LoopManager.cpp
+++ b/src/crepe/api/LoopManager.cpp
@@ -1,3 +1,5 @@
+#include "../facade/SDLContext.h"
+#include "../system/AISystem.h"
#include "../system/AnimatorSystem.h"
#include "../system/CollisionSystem.h"
#include "../system/InputSystem.h"
@@ -22,6 +24,7 @@ LoopManager::LoopManager() {
this->load_system<RenderSystem>();
this->load_system<ScriptSystem>();
this->load_system<InputSystem>();
+ this->load_system<AISystem>();
}
void LoopManager::process_input() { this->get_system<InputSystem>().update(); }
@@ -51,6 +54,11 @@ void LoopManager::loop() {
this->render();
timer.enforce_frame_rate();
+
+ // Stop the game after 10 seconds, for testing purposes
+ if (timer.get_current_time() > 10) {
+ this->game_running = false;
+ }
}
}
@@ -60,6 +68,7 @@ void LoopManager::setup() {
this->game_running = true;
timer.start();
timer.set_fps(200);
+ this->scene_manager.load_next_scene();
}
void LoopManager::render() {
@@ -68,4 +77,7 @@ void LoopManager::render() {
this->get_system<RenderSystem>().update();
}
-void LoopManager::update() {}
+void LoopManager::update() {
+ this->get_system<AnimatorSystem>().update();
+ this->get_system<AISystem>().update();
+}