fix view update issue
This commit is contained in:
parent
2e25c4cfcc
commit
25b6eb659d
2 changed files with 12 additions and 8 deletions
|
@ -25,13 +25,6 @@ singleHandler level event = do
|
|||
changeDirection cat state =
|
||||
Just cat
|
||||
{ pcMoveState = if multiplier > 0 then Just state else Nothing
|
||||
, pcViewDirection = if multiplier > 0 && pcGrounded cat
|
||||
then
|
||||
if state == MoveRight
|
||||
then ViewRight
|
||||
else ViewLeft
|
||||
else
|
||||
pcViewDirection cat
|
||||
}
|
||||
liftIO $ atomically $ modifyTVar (testPlayer level) (\(Just pituicat) ->
|
||||
A.log Debug ("Grounded: " <> fromString (show $ pcGrounded pituicat)) $
|
||||
|
|
|
@ -133,7 +133,18 @@ instance Actor Pituicat where
|
|||
(pcEffects p)
|
||||
}
|
||||
in
|
||||
A.log A.Debug ("*meow* am at: " <> (fromString $ show $ pcPos finalCat)) finalCat
|
||||
A.log A.Debug ("*meow* am at: " <> (fromString $ show $ pcPos finalCat))
|
||||
(finalCat
|
||||
{ pcViewDirection = if pcGrounded finalCat
|
||||
then
|
||||
case pcMoveState finalCat of
|
||||
Just MoveRight -> ViewRight
|
||||
Just MoveLeft -> ViewLeft
|
||||
_ -> pcViewDirection finalCat
|
||||
else
|
||||
pcViewDirection finalCat
|
||||
}
|
||||
)
|
||||
|
||||
instance Mass Pituicat where
|
||||
|
||||
|
|
Loading…
Reference in a new issue