Entity update + components
This commit is contained in:
@@ -39,7 +39,7 @@ namespace Game::Object {
|
||||
}
|
||||
|
||||
void Entity::render(Game::Renderer::Renderer* renderer, Game::Renderer::RendererConfig config) {
|
||||
if (!mIsActive || !mTex) return; // Don't render if not active or if there's no texture
|
||||
if (!mIsVisible || !mTex) return; // Don't render if not visible or if there's no texture
|
||||
|
||||
if (!mTex->isTiled()) {
|
||||
float w, h;
|
||||
@@ -98,4 +98,13 @@ namespace Game::Object {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Entity::updateComponents(float deltaTime) {
|
||||
for (const auto& component : mComponents) {
|
||||
if (!component || !component->isActive()) {
|
||||
continue;
|
||||
}
|
||||
component->update(deltaTime, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user