Commit, fix boxcollider

This commit is contained in:
2026-04-15 07:52:14 +02:00
parent dc55af5323
commit ab3baf5cbb
4 changed files with 61 additions and 23 deletions

View File

@@ -1,11 +1,19 @@
#include <game/agame/enemy.hpp>
#include <object/components/boxcollider.hpp>
namespace Game::AGame {
void Enemy::start() {
mZIndex = 20;
addComponent<Object::Components::BoxCollider>();
LOG("Enemy started: " << getName());
}
void Enemy::update(float deltaTime) {
return;
}
void Enemy::onCollisionEnter(Object::Entity* other) {
LOG("Enemy '" << getName() << "' collided with '" << other->getName() << "' (onCollisionEnter); Killing myself now!");
GameManager::setSharedData("enemyActiveCount", GameManager::getSharedData<int>("enemyActiveCount") - 1);
}
}