Added new level sound

This commit is contained in:
2025-11-30 10:37:35 +01:00
parent 69b2521695
commit 5fd77fdaf0
7 changed files with 219 additions and 5 deletions

View File

@ -4,6 +4,7 @@
#include "../gameplay/effects/LineEffect.h"
#include "../persistence/Scores.h"
#include "../audio/Audio.h"
#include "../audio/SoundEffect.h"
#include "../graphics/renderers/GameRenderer.h"
#include "../core/Config.h"
#include <SDL3/SDL.h>
@ -115,6 +116,7 @@ void PlayingState::handleEvent(const SDL_Event& e) {
// Hard drop (space)
if (e.key.scancode == SDL_SCANCODE_SPACE) {
SoundEffectManager::instance().playSound("hard_drop", 0.7f);
ctx.game->hardDrop();
return;
}
@ -128,6 +130,8 @@ void PlayingState::handleEvent(const SDL_Event& e) {
void PlayingState::update(double frameMs) {
if (!ctx.game) return;
ctx.game->updateVisualEffects(frameMs);
// forward per-frame gameplay updates (gravity, line effects)
if (!ctx.game->isPaused()) {
ctx.game->tickGravity(frameMs);