Tweak starting rooms

This commit is contained in:
2021-11-16 22:48:45 +00:00
parent 5d0b48829c
commit 559d7e3a23
6 changed files with 102 additions and 92 deletions
+12 -13
View File
@@ -1,5 +1,4 @@
{-
Functions controlling the movement of the screen camera:
{- Functions controlling the movement of the screen camera:
'_cameraCenter', '_cameraZoom', _cameraRot';
and the position that the character sees from: '_cameraViewFrom'. -}
module Dodge.Update.Camera
@@ -165,23 +164,23 @@ farWallDist p w = (winFac /) . min maxViewDistance $ ssfold (> maxViewDistance)
hw = halfWidth w
hh = halfHeight w
winFac = min hw hh
vps = concatMap _grViewpoints grs ++ linkvps
linkvps = map extend (concatMap _grViewpointsEx grs)
extend :: Point2 -> Point2
extend outp = p +.+ maxViewDistance *.* safeNormalizeV (outp -.- p)
vps = concatMap _grViewpoints grs ++ extendedViewPoints p grs
grs = filter (pointInOrOnPolygon p . _grBound) (_gameRooms w)
wos = wallsOnScreen w
farWallPoints :: Point2 -> World -> [Point2]
farWallPoints p w = concatMap _grViewpoints grs ++ linkvps
extendedViewPoints :: Point2 -> [GameRoom] -> [Point2]
extendedViewPoints p grs = map extend
(concatMap _grViewpointsEx grs
++ map addDir (concatMap _grLinkDirs grs)
)
where
grs = filter (pointInOrOnPolygon p . _grBound) (_gameRooms w)
linkvps = map extend (concatMap _grViewpointsEx grs
++ map addDir (concatMap _grLinkDirs grs)
)
extend :: Point2 -> Point2
extend outp = p +.+ maxViewDistance *.* safeNormalizeV (outp -.- p)
addDir a = p +.+ unitVectorAtAngle a
farWallPoints :: Point2 -> World -> [Point2]
farWallPoints p w = concatMap _grViewpoints grs ++ extendedViewPoints p grs
where
grs = filter (pointInOrOnPolygon p . _grBound) (_gameRooms w)
maxViewDistance :: Float
maxViewDistance = 800