diff options
| author | Somhairle H. Marisol <[email protected]> | 2026-09-29 10:38:53 +0800 |
|---|---|---|
| committer | Somhairle H. Marisol <[email protected]> | 2026-09-29 10:38:53 +0800 |
| commit | 328760853c15c44d1de915d6c88e0dfd7ddc5af6 (patch) | |
| tree | aa1e570378cfe92b0c4e9f125141a43d0ba89663 /src/LivingVillage.Desktop/VillageArt.fs | |
| parent | 46073814a67598c1a4122d1cb5abaaeb38c94e6d (diff) | |
| download | living-village-328760853c15c44d1de915d6c88e0dfd7ddc5af6.tar.gz | |
p72: 角色行走四向动画帧提升(6 走 + 2 待机)
CharacterArt 运行时点阵图集从 4 走 + 2 待机扩为 6 走(新增左右低过渡步 4/5,由 1/2 镜像)+ 2 待机,格数 *8、图集 5120x48;VillageArt 帧循环 %6、characterSourceRectangle *8、characterAtlasWidth 5120。同步 P45/Prototype 帧断言、新增 P72 帧表完整性回归、脚本与素材重新生成、维护说明动画语义。白天正午村庄行走实跑证据落 docs/evidence/p72-*。Desktop 343/343、Kernel 120/120、digest 与 p70 一致。
Diffstat (limited to 'src/LivingVillage.Desktop/VillageArt.fs')
| -rw-r--r-- | src/LivingVillage.Desktop/VillageArt.fs | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/LivingVillage.Desktop/VillageArt.fs b/src/LivingVillage.Desktop/VillageArt.fs index 76abc4a..db594d2 100644 --- a/src/LivingVillage.Desktop/VillageArt.fs +++ b/src/LivingVillage.Desktop/VillageArt.fs @@ -108,13 +108,16 @@ module VillageArt = | FrameTwo | FrameThree | FrameFour + | FrameFive + | FrameSix /// Two-pose standing breath cycle used whenever a character is not moving. type IdleFrame = | IdleOne | IdleTwo - /// A character either walks (four-pose cycle) or breathes in place (two-pose cycle). + /// A character either walks (six-pose cycle, incl. left/right transition steps) or + /// breathes in place (two-pose cycle). type CharacterFrame = | WalkFrame of AnimationFrame | IdleFrame of IdleFrame @@ -363,13 +366,16 @@ module VillageArt = | Peddler -> { WalkWindow = 3L; IdleWindow = 20L; PhaseOffset = 1L } | Scholar -> { WalkWindow = 6L; IdleWindow = 36L; PhaseOffset = 2L } - /// Four-pose walk cycle at a rhythm's window (one pose per WalkWindow sim ticks). + /// Six-pose walk cycle at a rhythm's window (one pose per WalkWindow sim ticks). + /// P72: four strides became six by adding left/right transition steps. let animationFrameFor (rhythm: WalkRhythm) (tick: int64) : AnimationFrame = - match positiveModulo64 4L (tick / rhythm.WalkWindow + rhythm.PhaseOffset) with + match positiveModulo64 6L (tick / rhythm.WalkWindow + rhythm.PhaseOffset) with | 0L -> FrameOne | 1L -> FrameTwo | 2L -> FrameThree - | _ -> FrameFour + | 3L -> FrameFour + | 4L -> FrameFive + | _ -> FrameSix /// Two-pose standing breath cycle at a rhythm's IdleWindow, fully deterministic. let idleFrameFor (rhythm: WalkRhythm) (tick: int64) : IdleFrame = @@ -454,9 +460,11 @@ module VillageArt = | WalkFrame FrameTwo -> 1 | WalkFrame FrameThree -> 2 | WalkFrame FrameFour -> 3 - | IdleFrame IdleOne -> 4 - | IdleFrame IdleTwo -> 5 - let cellIndex = (variantIndex * 4 + directionIndex) * 6 + frameIndex + | WalkFrame FrameFive -> 4 + | WalkFrame FrameSix -> 5 + | IdleFrame IdleOne -> 6 + | IdleFrame IdleTwo -> 7 + let cellIndex = (variantIndex * 4 + directionIndex) * 8 + frameIndex Microsoft.Xna.Framework.Rectangle(cellIndex * 32, 0, 32, 48) let private rgba (r: int) (g: int) (b: int) (a: int) : XnaColor = XnaColor(r, g, b, a) @@ -566,7 +574,7 @@ module VillageArt = let worldTileCount = 32 let worldAtlasWidth = Sim.tilePixels * worldTileCount let worldAtlasHeight = Sim.tilePixels - let characterAtlasWidth = 32 * 5 * 4 * 6 + let characterAtlasWidth = 32 * 5 * 4 * 8 let characterAtlasHeight = 48 let interiorAtlasWidth = 392 let interiorAtlasHeight = 96 |
