feat(playfield): refactor a Playfield amb animació de creació durant l'INIT_HUD
This commit is contained in:
@@ -31,7 +31,7 @@ GameScene::GameScene(SDLManager& sdl, SceneContext& context)
|
||||
floating_score_manager_(sdl.getRenderer()),
|
||||
trail_manager_(sdl.getRenderer()),
|
||||
text_(sdl.getRenderer()),
|
||||
playfield_grid_(sdl.getRenderer()) {
|
||||
playfield_(sdl.getRenderer()) {
|
||||
// Recuperar configuración de match des del context
|
||||
match_config_ = context_.getMatchConfig();
|
||||
|
||||
@@ -182,6 +182,7 @@ void GameScene::stepPhysics(float delta_time) {
|
||||
bullet.postUpdate(delta_time);
|
||||
}
|
||||
trail_manager_.update(delta_time, ships_);
|
||||
playfield_.update(delta_time);
|
||||
}
|
||||
|
||||
void GameScene::stepShootingInput() {
|
||||
@@ -574,6 +575,9 @@ void GameScene::drawInitHudState() {
|
||||
Defaults::Game::INIT_HUD_SHIP2_RATIO_INIT,
|
||||
Defaults::Game::INIT_HUD_SHIP2_RATIO_END);
|
||||
|
||||
// Graella de fons al darrere (timer intern propi, cobreix tot l'INIT_HUD).
|
||||
playfield_.draw();
|
||||
|
||||
if (rect_progress > 0.0F) {
|
||||
if (!init_hud_rect_sound_played_) {
|
||||
Audio::get()->playSound(Defaults::Sound::INIT_HUD, Audio::Group::GAME);
|
||||
@@ -596,7 +600,7 @@ void GameScene::drawInitHudState() {
|
||||
}
|
||||
|
||||
void GameScene::drawLevelStartState() {
|
||||
playfield_grid_.draw();
|
||||
playfield_.draw();
|
||||
drawMargins();
|
||||
trail_manager_.draw();
|
||||
drawActiveShipsAlive();
|
||||
@@ -609,7 +613,7 @@ void GameScene::drawLevelStartState() {
|
||||
}
|
||||
|
||||
void GameScene::drawPlayingState() {
|
||||
playfield_grid_.draw();
|
||||
playfield_.draw();
|
||||
drawMargins();
|
||||
trail_manager_.draw();
|
||||
drawActiveShipsAlive();
|
||||
@@ -622,7 +626,7 @@ void GameScene::drawPlayingState() {
|
||||
}
|
||||
|
||||
void GameScene::drawLevelCompletedState() {
|
||||
playfield_grid_.draw();
|
||||
playfield_.draw();
|
||||
drawMargins();
|
||||
trail_manager_.draw();
|
||||
drawActiveShipsAlive();
|
||||
|
||||
Reference in New Issue
Block a user