move this out
This commit is contained in:
parent
ca1df3f172
commit
744850d3f0
1 changed files with 4 additions and 4 deletions
|
@ -210,15 +210,15 @@ movePlayer _ = return ()
|
|||
playerInteract :: MouseMessage -> Affection UserData ()
|
||||
playerInteract (MsgMouseButton _ _ SDL.Pressed _ SDL.ButtonRight _ m) = do
|
||||
ud <- getAffection
|
||||
(V2 rx ry) <- liftIO $ relativizeMouseCoords m
|
||||
let dr = (ry / sin (atan 0.5) / 2) + rx
|
||||
dc = rx - (ry / sin (atan 0.5) / 2)
|
||||
(nws, relEnts) <- liftIO $ yieldSystemT (worldState ud) $ do
|
||||
emap allEnts $ do
|
||||
with player
|
||||
with rot
|
||||
rot' <- query rot
|
||||
(V2 rx ry) <- liftIO $ relativizeMouseCoords m
|
||||
let dr = (ry / sin (atan 0.5) / 2) + rx
|
||||
dc = rx - (ry / sin (atan 0.5) / 2)
|
||||
ndir = direction (V2 dr dc)
|
||||
let ndir = direction (V2 dr dc)
|
||||
return $ unchanged
|
||||
{ rot = Set $ fromMaybe rot' ndir
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue