Implement teleporting bullets

This commit is contained in:
2022-02-21 20:51:01 +00:00
parent 724ee21afc
commit f626fce105
23 changed files with 245 additions and 154 deletions
+2
View File
@@ -429,6 +429,8 @@ cartePosToScreen cfig w = doWindowScale cfig . doRotate . doZoom . doTranslate
doTranslate p = p -.- _carteCenter w
doZoom p = _carteZoom w *.* p
doRotate p = rotateV (negate $ _carteRot w) p
crToMousePosOffset :: Creature -> World -> (Point2,Float)
crToMousePosOffset cr w = (mouseWorldPos w -.- _crPos cr,0)
{- | The mouse position in world coordinates. -}
mouseWorldPos :: World -> Point2
mouseWorldPos w = _cameraCenter w +.+ (1/_cameraZoom w) *.* rotateV (_cameraRot w) (_mousePos w)