fixed gameplay
This commit is contained in:
@ -88,8 +88,10 @@ public:
|
||||
// Sound effect callbacks
|
||||
using SoundCallback = std::function<void(int)>; // Callback for line clear sounds (number of lines)
|
||||
using LevelUpCallback = std::function<void(int)>; // Callback for level up sounds
|
||||
using AsteroidDestroyedCallback = std::function<void(AsteroidType)>; // Callback when an asteroid is fully destroyed
|
||||
void setSoundCallback(SoundCallback callback) { soundCallback = callback; }
|
||||
void setLevelUpCallback(LevelUpCallback callback) { levelUpCallback = callback; }
|
||||
void setAsteroidDestroyedCallback(AsteroidDestroyedCallback callback) { asteroidDestroyedCallback = callback; }
|
||||
|
||||
// Shape helper --------------------------------------------------------
|
||||
static bool cellFilled(const Piece& p, int cx, int cy);
|
||||
@ -147,6 +149,7 @@ private:
|
||||
// Sound effect callbacks
|
||||
SoundCallback soundCallback;
|
||||
LevelUpCallback levelUpCallback;
|
||||
AsteroidDestroyedCallback asteroidDestroyedCallback;
|
||||
// Gravity tuning -----------------------------------------------------
|
||||
// Global multiplier applied to all level timings (use to slow/speed whole-game gravity)
|
||||
double gravityGlobalMultiplier{1.0};
|
||||
|
||||
Reference in New Issue
Block a user