diff --git a/src/Dodge/Projectile/Update.hs b/src/Dodge/Projectile/Update.hs index 54cb0b95e..6808513ce 100644 --- a/src/Dodge/Projectile/Update.hs +++ b/src/Dodge/Projectile/Update.hs @@ -99,7 +99,7 @@ upProjectile pu pj = case pu of PJShellCollisionCheck -> updateShell pj PJDecTimMvVel -> decTimMvVel pj PJThrust st et - | act st et -> doThrust' pj + | act st et -> doThrust pj | otherwise -> id PJSpin t cid spinamount | ain t -> trySpinByCID' cid spinamount pj @@ -129,18 +129,19 @@ retireRemoteProj'' itid pjid w = & cWorld . props %~ IM.delete pjid setRemoteDir :: Int -> Int -> Proj -> World -> World -setRemoteDir cid itid pj w = w & cWorld . projectiles . ix (_prjID pj) . prjDir .~ newdir +setRemoteDir cid itid pj w = w & cWorld . projectiles . ix (_prjID pj) . prjAcc .~ turntonewdir where + turntonewdir = magV (_prjAcc pj) *.* unitVectorAtAngle newdir --i = _prjID pj newdir | SDL.ButtonRight `M.member` _mouseButtons w - && w ^? cWorld . creatures . ix cid . crInvSel . iselPos - == w ^? cWorld . itemLocations . ix itid . ipInvID = - _cameraRot (_cWorld w) + argV (_mousePos w) +-- && w ^? cWorld . creatures . ix cid . crInvSel . iselPos +-- == w ^? cWorld . itemLocations . ix itid . ipInvID + = _cameraRot (_cWorld w) + argV (_mousePos w) | otherwise = _prjDir pj -doThrust' :: Proj -> World -> World -doThrust' pj w = +doThrust :: Proj -> World -> World +doThrust pj w = w & randGen .~ g & cWorld . projectiles . ix i . prjVel %~ (\v -> accel +.+ frict *.* v)