Commit before attempting to simplify creature update

This commit is contained in:
2025-10-17 10:36:19 +01:00
parent c533e88d24
commit f969056912
4 changed files with 4 additions and 34 deletions
+2 -2
View File
@@ -44,11 +44,11 @@ crMvForward :: Float -> LWorld -> Creature -> Creature
crMvForward speed = crMvBy (V2 speed 0)
advanceStepCounter :: Float -> Creature -> Creature
advanceStepCounter speed = crStance . carriage %~ f
advanceStepCounter speed cr = cr & crStance . carriage %~ f
where
f car = case car of
Standing -> f (Walking 0 RightForward)
Walking i ff -> Walking (i + speed) ff
Walking i ff -> Walking (min (cr ^. crStance . strideLength) (i + speed)) ff
_ -> car
creatureTurnTo :: Point2 -> Creature -> Creature