Nazaj na multithreadanje - fonti

This commit is contained in:
2026-03-12 16:18:51 +01:00
parent 834f0b29c3
commit 74159a6fda
20 changed files with 254 additions and 43 deletions

25
src/game/agame/player.cpp Normal file
View File

@@ -0,0 +1,25 @@
#include <game/agame/player.hpp>
namespace Game::AGame {
void Player::start() {
LOG("Created the Player");
if (mTex && mTex->getId() == "Arial") {
LOG("Player texture is a font");
// Treat as Font and build it
std::shared_ptr<Renderer::Font> font = std::dynamic_pointer_cast<Renderer::Font>(mTex);
if (font) {
font->build({255, 255, 255, 255}, "Hello, World!");
} else {
ERROR("Failed to cast texture to font");
}
}
}
void Player::update() {
if (!mIsActive) return;
//LOG("Updated Player");
mTransform.x += 0.5f; // Move right at a constant speed for testing
mTransform.rotation += 1.f; // Rotate clockwise for testing
}
}