feat(playfield): reaccions orbit al pas de la nau i pulse al spawn de fireworks
This commit is contained in:
1 parent
ffeff3d69d
commit
20f5b83649
6 files changed
+238
-13
No files matched your search
@@ -75,6 +75,11 @@ GameScene::GameScene(SDLManager& sdl, SceneContext& context)
|
||||
border_.bumpAt(hit.contact_point, STRENGTH);
|
||||
});
|
||||
|
||||
// Fireworks generen un pulse a les línies V i H més properes del playfield.
|
||||
firework_manager_.setSpawnCallback([this](Vec2 origen) {
|
||||
playfield_.notifyFireworkSpawn(origen);
|
||||
});
|
||||
|
||||
// Explosions properes a una paret també generen bump (falloff lineal amb la distància).
|
||||
debris_manager_.setExplosionCallback([this](Vec2 center) {
|
||||
const SDL_FRect& zona = Defaults::Zones::PLAYAREA;
|
||||
@@ -210,6 +215,13 @@ void GameScene::stepPhysics(float delta_time) {
|
||||
trail_manager_.update(delta_time, ships_);
|
||||
playfield_.update(delta_time);
|
||||
border_.update(delta_time);
|
||||
|
||||
// Notificar al playfield que la nau ha passat (per excitar línies properes).
|
||||
for (const auto& ship : ships_) {
|
||||
if (ship.isActive()) {
|
||||
playfield_.notifyShipPass(ship.getCenter(), ship.getSpeed());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GameScene::stepShootingInput() {
|
||||
|
||||
Reference in new issue
Block a user