Add menu option for auto camera rotation

This commit is contained in:
2021-09-11 20:22:44 +01:00
parent f2553ded0e
commit ea333a363b
5 changed files with 34 additions and 22 deletions
+8 -2
View File
@@ -8,6 +8,7 @@ module Dodge.Update
import Dodge.Data
import Dodge.Menu
import Dodge.Zone.Data
import Dodge.Config.Data
import Dodge.World.Trigger.Data
--import Dodge.Config.Data
import Dodge.Base
@@ -60,7 +61,7 @@ functionalUpdate w = case _menuLayers w of
. ppEvents
. updateCamera
. colCrsWalls
. rotateToOverlappingWall
. ifConfigWallRotate
. simpleCrSprings
. zoneCreatures
. updateWalls
@@ -252,6 +253,11 @@ crCrSpring c1 c2 w
overlap2 = ((comRad - diff) * _crMass c1 * 0.5 / massT) *.* errorNormalizeV 56 vec
massT = _crMass c1 + _crMass c2
ifConfigWallRotate :: World -> World
ifConfigWallRotate w
| _rotate_to_wall $ _config w = rotateToOverlappingWall w
| otherwise = w
rotateToOverlappingWall :: World -> World
rotateToOverlappingWall w = case theWall of
Nothing -> w
@@ -267,7 +273,7 @@ rotateToOverlappingWall w = case theWall of
b' = fromIntegral $ (round b :: Int)
cr = you w
p = _crPos cr
theWall = collideCircWallsReturnWall p (_crRad cr + 5) (wallsNearPoint p w)
theWall = overlapCircWallsReturnWall p (_crRad cr + 5) (wallsNearPoint p w)
{-
Finds the IDs of visible walls from a point to another point. -}