basic movement
This commit is contained in:
@@ -5,6 +5,7 @@ namespace Game {
|
||||
void GameManager::run(std::stop_token stopToken) {
|
||||
using namespace std::chrono_literals;
|
||||
LOG("GameManager thread started");
|
||||
Object::Camera::getInstance().setPosition(0.f, 0.f); // Start with camera at (0, 0)
|
||||
|
||||
mLastUpdate = clock::now(); // Get the update
|
||||
|
||||
@@ -18,11 +19,12 @@ namespace Game {
|
||||
const auto frameStart = std::chrono::steady_clock::now();
|
||||
|
||||
try {
|
||||
State::GameState::getInstance().withEntitiesLocked([seconds](auto& entities) {
|
||||
for (auto& entity : entities) {
|
||||
auto entities = State::GameState::getInstance().getEntitiesSnapshot();
|
||||
for (auto* entity : entities) {
|
||||
if (entity) {
|
||||
entity->update(seconds);
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (const std::exception& e) {
|
||||
ERROR("Exception in GameManager thread: " << e.what());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user