make tolerance dependant on frame rate
This commit is contained in:
parent
c9dd91927e
commit
a3d7ba4dd7
2 changed files with 3 additions and 1 deletions
|
@ -103,7 +103,7 @@ updateNPCs imgmat ws rrp dt = do
|
||||||
if not (null path)
|
if not (null path)
|
||||||
then do
|
then do
|
||||||
let itarget = fmap (+ 0.5) (fromIntegral <$> head path) :: V2 Double
|
let itarget = fmap (+ 0.5) (fromIntegral <$> head path) :: V2 Double
|
||||||
if distance pos' itarget < 0.1
|
if distance pos' itarget < 1.5 * dt
|
||||||
then
|
then
|
||||||
return (Nothing, unchanged
|
return (Nothing, unchanged
|
||||||
{ npcMoveState = Set $ NPCWalking (tail path)
|
{ npcMoveState = Set $ NPCWalking (tail path)
|
||||||
|
|
|
@ -330,6 +330,7 @@ emitJoyActionMessage (MsgJoystickButton time _ but SDL.JoyButtonPressed) = do
|
||||||
case tmap Map.!? (ButtonAction but SDL.JoyButtonPressed) of
|
case tmap Map.!? (ButtonAction but SDL.JoyButtonPressed) of
|
||||||
Just act -> partEmit t (ActionMessage act time)
|
Just act -> partEmit t (ActionMessage act time)
|
||||||
_ -> return ()
|
_ -> return ()
|
||||||
|
_ -> return ()
|
||||||
emitJoyActionMessage _ = return ()
|
emitJoyActionMessage _ = return ()
|
||||||
|
|
||||||
emitKbdActionMessage :: KeyboardMessage -> Affection UserData ()
|
emitKbdActionMessage :: KeyboardMessage -> Affection UserData ()
|
||||||
|
@ -346,6 +347,7 @@ emitKbdActionMessage (MsgKeyboardEvent time _ press False sym) = do
|
||||||
Just (ActRight _) -> partEmit t (ActionMessage (ActRight val) time)
|
Just (ActRight _) -> partEmit t (ActionMessage (ActRight val) time)
|
||||||
Just act -> when (press == SDL.Pressed) (partEmit t (ActionMessage act time))
|
Just act -> when (press == SDL.Pressed) (partEmit t (ActionMessage act time))
|
||||||
_ -> return ()
|
_ -> return ()
|
||||||
|
_ -> return ()
|
||||||
emitKbdActionMessage _ = return ()
|
emitKbdActionMessage _ = return ()
|
||||||
|
|
||||||
fullClean :: Affection UserData ()
|
fullClean :: Affection UserData ()
|
||||||
|
|
Loading…
Reference in a new issue