diff options
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 |
