Implement the following plan: Address PR #21 Review Comments Context PR #21 ("Add…
- User
Implement the following plan:
Address PR #21 Review Comments
Context
PR #21 ("Add rotation wobble and Y-sort depth bias") received 3 review comments from the repo owner. All are small, targeted fixes — a safety clamp, a rename for clarity, and a duplicate-check consolidation.
Changes
1. Consolidate duplicate silhouette check
File:
MonoDreams.Examples/Screens/LoadLevelExampleGameScreen.cs(lines 177-188)Extract
var isShilhouette = blenderObj.Name.EndsWith("shilhouette")and reuse it in both the amplitude ternary and the depth-biasifblock. Pure refactor, no behavioral change.2. Rename RotationWobble → StopMotionEffect
The current implementation does discrete snapping, not smooth wobble. Rename to match the actual behavior.
Old New RotationWobble(class)StopMotionEffectAmplitudeRadians(property)OffsetRadiansRotationWobbleSystem(class)StopMotionEffectSystemFiles:
MonoDreams.Examples/Component/RotationWobble.cs→ rename file toStopMotionEffect.cs, rename class + property, update doc commentMonoDreams.Examples/System/RotationWobbleSystem.cs→ rename file toStopMotionEffectSystem.cs, rename class, update[With]attribute, rename local varwobble→effect, update doc commentMonoDreams.Examples/Screens/LoadLevelExampleGameScreen.cs→ update allRotationWobble/AmplitudeRadiansreferences andRotationWobbleSystem→StopMotionEffectSystem
3. Clamp YSortDepthBias to layer range
File:
MonoDreams/System/Draw/YSortSystem.cs(line 48)Wrap the depth calculation in
Math.Clamp(..., minDepth, maxDepth)so bias can never push depth into an adjacent layer.Math.Clampis already used in the same method (line 44).csharp Assistant
I'll start by reading all the files that need to be modified.
Assistant
Now I have all the context. Let me implement all three changes. I'll start with the file renames and edits in parallel.
Assistant
Now update the screen file with the consolidated silhouette check and renamed references.
Assistant
Now update the system reference in the screen file.
Assistant
Now delete the old files and build to verify.
Assistant
Build succeeded with 0 errors. Now let me commit all the changes.
Assistant
Everything looks correct. Let me create the commit.
Assistant
All three review comments addressed in a single commit:
-
Consolidated duplicate silhouette check — extracted
var isSilhouette = blenderObj.Name.EndsWith("shilhouette")and reused it in both the offset ternary and the depth-biasifblock. -
Renamed RotationWobble → StopMotionEffect — class, property (
AmplitudeRadians→OffsetRadians), system, and all references updated. Old files deleted; git detected the component rename. -
Clamped YSortDepthBias to layer range — wrapped the depth calculation in
Math.Clamp(…, minDepth, maxDepth)so bias can never push depth into an adjacent layer.
Build passes with 0 errors.
-
- User
push and update the PR
Assistant
Pushed and commented on PR #21: https://github.com/roo-oliv/monodreams/pull/21