Implement the following plan: Plan: Review PR #21 Context PR #21 ("Add rotation wobble…
- User
Implement the following plan:
Plan: Review PR #21
Context
PR #21 ("Add rotation wobble and Y-sort depth bias") introduces two features:
- A
RotationWobblecomponent + system that snaps entity rotation between two states on a global timer - A
YSortDepthBiasfield onSpriteInfofor deterministic front/back ordering of entities at the same Y
The user wants a review comment posted via
gh(comment only, no approve/request-changes).Review findings
Positive
- Component/system placement follows conventions (class in Examples,
AEntitySetSystem<GameState>) - System ordering correct:
RotationWobbleSystem->HierarchySystem->YSortSystem - Dirty flag optimization avoids unnecessary transform propagation
YSortDepthBiasdefaults to 0 (backward-compatible)- Global timer sync ensures coordinated wobble across entities
Items to flag
-
YSortDepthBias can escape the Y-sort range — The bias is added unconditionally after interpolation in
YSortSystem:48. With 11 layers, the Characters Y-sort range is ~0.098 with a 0.001 margin to adjacent layers. The -0.0005 bias eats half that margin. Safe now, but fragile for future use. Suggest clamping or documenting the safe range. -
"Wobble" naming vs snap behavior — The component name and
AmplitudeRadiansfield suggest smooth sinusoidal motion, but the implementation does discrete snapping between two states. The doc comment is accurate ("snap between a base rotation and a rotated state") but the naming creates a mismatch. Worth considering whether smooth sine interpolation (MathF.Sin) would better match the intent, or renaming toRotationToggle/RotationSnap. -
Duplicate
EndsWith("shilhouette")check —LoadLevelExampleGameScreen.cs:178and:184both checkblenderObj.Name.EndsWith("shilhouette"). Could be consolidated into a single conditional block.
Action
Post a single review comment via:
bashgh pr review 21 --comment --body "<review text>"If you need specific details from before exiting plan mode (like exact code snippets, error messages, or content you generated), read the full transcript at: /Users/rodrigooliveira/.REDACTED.jsonl
- A
Assistant
Review comment posted on PR #21. It covers the three findings:
- YSortDepthBias margin fragility — bias eats into the thin layer margin, suggesting clamping or documentation
- Naming mismatch — "wobble" implies smooth motion but implementation snaps discretely; suggest rename or smooth interpolation
- Duplicate silhouette check — two identical
EndsWithchecks that could be consolidated