feat(enemy): afegir behaviors WANDER/CHASE/FLEE i target multi-ship

This commit is contained in:
2026-05-25 18:08:11 +02:00
parent 61e40e88f4
commit 5ad433e63a
6 changed files with 108 additions and 16 deletions
+1 -1
View File
@@ -186,7 +186,7 @@ GameScene::GameScene(SDLManager& sdl, SceneContext& context)
// Registramos el body al world incluso inactivo: con radius=0 no colisiona
// ni se mueve, y al init() del stage system se activa sin re-registrar.
for (auto& enemy : enemies_) {
enemy.setShipPosition(&ships_[0].getCenter()); // Set ship reference (P1 for now)
enemy.setShips(ships_.data(), &ships_[1]);
physics_world_.addBody(&enemy.getBody());
// DON'T call enemy.init() here - stage system handles spawning
}