feat(renderer): polish gameplay visuals — transport, starfield, sparkles, smooth piece motion

Add transport/transfer effect for NEXT → grid with cross-fade and preview swap
Integrate in-grid Starfield3D with magnet targeting tied to active piece
Spawn ambient sparkles and impact sparks (hard-drop crackle + burst on expiry)
Smooth horizontal/fall interpolation for active piece (configurable smooth scroll)
Refactor next panel / preview rendering and connector drawing
Tweak stats/score panel layout, progress bars and typography for compact view
Preserve safe alpha handling and restore renderer blend/scale state after overlays
This commit is contained in:
2025-12-08 20:43:51 +01:00
parent 815913b15b
commit 57eac01bcb
8 changed files with 293 additions and 48 deletions

View File

@ -15,15 +15,18 @@ public:
bool drawMainButtonNormally = true;
// Draw only the main PLAY button on top of other layers (expects logical coords).
void renderMainButtonTop(SDL_Renderer* renderer, float logicalScale, SDL_Rect logicalVP);
// Show or hide the inline HELP panel (menu-style)
void showHelpPanel(bool show);
private:
int selectedButton = 0; // 0 = PLAY, 1 = LEVEL, 2 = OPTIONS, 3 = EXIT
int selectedButton = 0; // 0 = PLAY, 1 = LEVEL, 2 = OPTIONS, 3 = HELP, 4 = EXIT
// Button icons (optional - will use text if nullptr)
SDL_Texture* playIcon = nullptr;
SDL_Texture* levelIcon = nullptr;
SDL_Texture* optionsIcon = nullptr;
SDL_Texture* exitIcon = nullptr;
SDL_Texture* helpIcon = nullptr;
// Options panel animation state
bool optionsVisible = false;
@ -74,4 +77,11 @@ private:
int exitDirection = 1; // 1 show, -1 hide
int exitSelectedButton = 0; // 0 = YES (quit), 1 = NO (cancel)
double exitScroll = 0.0; // vertical scroll offset for content
// Help submenu (inline HUD like Options/Exit)
bool helpPanelVisible = false;
bool helpPanelAnimating = false;
double helpTransition = 0.0; // 0..1
double helpTransitionDurationMs = 360.0;
int helpDirection = 1; // 1 show, -1 hide
double helpScroll = 0.0; // vertical scroll offset for content
};