Browse Source

fix view update issue

master
nek0 3 months ago
parent
commit
25b6eb659d
  1. 7
      src/Scenes/Test/EventHandler.hs
  2. 13
      src/Types/Player.hs

7
src/Scenes/Test/EventHandler.hs

@ -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)) $

13
src/Types/Player.hs

@ -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…
Cancel
Save