diff --git a/src/Scenes/Test/EventHandler.hs b/src/Scenes/Test/EventHandler.hs index fb6c550..9f4d6f6 100644 --- a/src/Scenes/Test/EventHandler.hs +++ b/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)) $ diff --git a/src/Types/Player.hs b/src/Types/Player.hs index cbde911..7db647d 100644 --- a/src/Types/Player.hs +++ b/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