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.Tests/P45CharacterAnimTests.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.Tests/P45CharacterAnimTests.fs')
| -rw-r--r-- | src/LivingVillage.Desktop.Tests/P45CharacterAnimTests.fs | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/LivingVillage.Desktop.Tests/P45CharacterAnimTests.fs b/src/LivingVillage.Desktop.Tests/P45CharacterAnimTests.fs index eba03aa..b9241ad 100644 --- a/src/LivingVillage.Desktop.Tests/P45CharacterAnimTests.fs +++ b/src/LivingVillage.Desktop.Tests/P45CharacterAnimTests.fs @@ -5,7 +5,7 @@ open LivingVillage.Kernel open LivingVillage.Kernel.Sim open LivingVillage.Desktop -/// P45 角色动画帧升级回归:四向 x 6 帧原创点阵、帧序列确定性、行走推进、停止回 idle。 +/// P45 角色动画帧升级回归:四向 x 8 帧(6 走 + 2 待机)原创点阵、帧序列确定性、行走推进、停止回 idle。 [<TestClass>] type P45CharacterAnimTests () = @@ -76,16 +76,18 @@ type P45CharacterAnimTests () = [ VillageArt.NorthFacing; VillageArt.SouthFacing; VillageArt.WestFacing; VillageArt.EastFacing ] |> List.map (fun d -> (rect VillageArt.IndigoRobe d (VillageArt.WalkFrame VillageArt.FrameOne)).X) assertEqualMsg 4 (xs |> List.distinct |> List.length) "四向必须落在不同源格" - // 同向 6 帧源格逐一不同且按序排列。 + // 同向 8 帧源格逐一不同且按序排列。 let frameXs = [ VillageArt.WalkFrame VillageArt.FrameOne VillageArt.WalkFrame VillageArt.FrameTwo VillageArt.WalkFrame VillageArt.FrameThree VillageArt.WalkFrame VillageArt.FrameFour + VillageArt.WalkFrame VillageArt.FrameFive + VillageArt.WalkFrame VillageArt.FrameSix VillageArt.IdleFrame VillageArt.IdleOne VillageArt.IdleFrame VillageArt.IdleTwo ] |> List.map (fun f -> (rect VillageArt.IndigoRobe VillageArt.SouthFacing f).X) - assertEqualMsg 6 (frameXs |> List.distinct |> List.length) "同向 6 帧源格须互不同" + assertEqualMsg 8 (frameXs |> List.distinct |> List.length) "同向 8 帧源格须互不同" assertEqualMsg frameXs (List.sort frameXs) "帧源格须按帧序递增" [<TestMethod>] @@ -95,18 +97,22 @@ type P45CharacterAnimTests () = assertEqualMsg (VillageArt.WalkFrame VillageArt.FrameTwo) (VillageArt.characterFrame true 4L) "走 4" assertEqualMsg (VillageArt.WalkFrame VillageArt.FrameThree) (VillageArt.characterFrame true 8L) "走 8" assertEqualMsg (VillageArt.WalkFrame VillageArt.FrameFour) (VillageArt.characterFrame true 12L) "走 12" - assertEqualMsg (VillageArt.WalkFrame VillageArt.FrameOne) (VillageArt.characterFrame true 16L) "走 16 循环" + assertEqualMsg (VillageArt.WalkFrame VillageArt.FrameFive) (VillageArt.characterFrame true 16L) "走 16" + assertEqualMsg (VillageArt.WalkFrame VillageArt.FrameSix) (VillageArt.characterFrame true 20L) "走 20" + assertEqualMsg (VillageArt.WalkFrame VillageArt.FrameOne) (VillageArt.characterFrame true 24L) "走 24 循环" // 停止:无论 tick,回 idle 两帧呼吸循环。 assertEqualMsg (VillageArt.IdleFrame VillageArt.IdleOne) (VillageArt.characterFrame false 0L) "停 0" assertEqualMsg (VillageArt.IdleFrame VillageArt.IdleTwo) (VillageArt.characterFrame false 24L) "停 24" assertEqualMsg (VillageArt.IdleFrame VillageArt.IdleOne) (VillageArt.characterFrame false 9999L) "停任意 tick 仍在 idle" // 玩家行走规格:方向 + 是否移动 + tick 决定帧,四向共享同一帧序(方向只换源格)。 let framesFor direction = - [ 0L; 4L; 8L; 12L ] |> List.map (fun t -> (VillageArt.avatarSpriteSpec direction true t).Frame) + [ 0L; 4L; 8L; 12L; 16L; 20L ] |> List.map (fun t -> (VillageArt.avatarSpriteSpec direction true t).Frame) let north = framesFor VillageArt.NorthFacing assertEqualMsg [ VillageArt.WalkFrame VillageArt.FrameOne VillageArt.WalkFrame VillageArt.FrameTwo VillageArt.WalkFrame VillageArt.FrameThree - VillageArt.WalkFrame VillageArt.FrameFour ] north "方向->帧序确定" + VillageArt.WalkFrame VillageArt.FrameFour + VillageArt.WalkFrame VillageArt.FrameFive + VillageArt.WalkFrame VillageArt.FrameSix ] north "方向->帧序确定" for direction in [ VillageArt.SouthFacing; VillageArt.WestFacing; VillageArt.EastFacing ] do assertEqualMsg north (framesFor direction) "四向帧序一致" |
