Added new level sound
This commit is contained in:
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user