Nazaj na multithreadanje - fonti
This commit is contained in:
25
src/game/agame/player.cpp
Normal file
25
src/game/agame/player.cpp
Normal 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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user