Modularise and improve step cycle
This commit is contained in:
@@ -53,15 +53,17 @@ advanceStepCounter
|
||||
:: Float -- ^ Speed
|
||||
-> Creature
|
||||
-> Creature
|
||||
advanceStepCounter speed = crStance . carriage %~ f
|
||||
advanceStepCounter speed cr = cr & crStance . carriage %~ f
|
||||
where
|
||||
f w@Walking{} = w{_stepToAdd = ceiling speed}
|
||||
f s = s
|
||||
--stnce = _crStance cr
|
||||
f car = case car of
|
||||
Standing -> f (Walking 0 RightForward)
|
||||
Walking i ff -> Walking (i + ceiling speed) ff
|
||||
_ -> car
|
||||
|
||||
creatureTurn :: Float -> Creature -> Creature
|
||||
creatureTurn a = crDir +~ a
|
||||
|
||||
|
||||
creatureTurnTo :: Point2 -> Creature -> Creature
|
||||
creatureTurnTo p cr
|
||||
| vToTarg == (0,0) = cr -- this should deal with the angleVV error
|
||||
|
||||
Reference in New Issue
Block a user