Skip to content

fix(ui): eliminate settings toggle clipping, smooth jelly directional arrows, and optimize frame pacing - #8

Open
Shahidzbi4213 wants to merge 1 commit into
mainfrom
feat/ui-settings-and-animation-polish
Open

Shahidzbi4213 wants to merge 1 commit into
mainfrom
feat/ui-settings-and-animation-polish

Conversation

@Shahidzbi4213

Copy link
Copy Markdown
Owner

Overview

This PR resolves the UI, animation consistency, and frame performance issues from the follow-up review:

  1. Settings Screen Toggle Cropping (GummyToggleSwitch.kt & SettingsModal.kt):

    • Decoupled the recessed track pill clipping (.clip(trackShape)) from the knob container.
    • The bouncy 3D gummy knob, its squish-and-stretch scale (squishX = 1.22f), spring overshoot, and drop shadow now float unclipped with clean margins.
    • Expanded container to 62x34dp and calibrated knob travel (3dp -> 33dp).
    • Increased vertical padding in ArcadeSettingRow for generous clearance.
  2. Jelly Click Direction Arrow & Eye Glance Consistency (SkiaBoardView.kt & JellyRenderer.kt):

    • Replaced generic vertical press compression with direction-aware anticipation tension (squashing along travel axis with backward recoil offset).
    • When a jelly is pressed, its eyes now lock squarely toward its exit direction (direction.dx * 0.45f), eliminating conflicting glances toward touch coordinates.
    • Fixed drawAnticipationTrajectory starting waypoint by anchoring to anchorLead rather than arbitrary head position to eliminate crooked/diagonal raycast starts on multi-cell jellies.
    • Fixed launch direction calculation so the final path segment does not falsely collapse dx=0, dy=0 to Direction.NORTH.
    • Rotated deflected launching jellies dynamically (directedJelly) so their body and snout face the true corridor direction.
  3. Frame Jank & Animation Performance Elimination (GameViewModel.kt & AnimationState.kt):

    • Added timestamp-based frame interpolation (startTimeMillis, durationMillis, easedProgressAt(now)) to LaunchAnimation.
    • Eliminated the 60 FPS coroutine delay(16) loop that re-allocated List<LaunchAnimation> and forced full Composable recompositions on every frame.
    • Replaced repeated Map copying with single mutable map updates in animateWobble.

Verification

  • Tested via ./gradlew :core-engine:allTests :shared:allTests: All 84 tasks passed cleanly.

… arrows, and optimize frame pacing

- Decouple GummyToggleSwitch track pill clipping from knob and shadow bounds to eliminate edge clipping
- Make jelly touch anticipation squish direction-aware and lock pupil glance toward travel corridor when pressed
- Align trajectory beam with anchorLead to prevent diagonal/misaligned rays on multi-cell jellies
- Prevent launching direction snap-back to NORTH on final segment and rotate deflected jellies smoothly
- Eliminate 60 FPS coroutine StateFlow allocation loops in GameViewModel via timestamp-based draw interpolation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants