25 lines
801 B
C++
25 lines
801 B
C++
#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
|
|
}
|
|
} |