Commit before static wall change

This commit is contained in:
jgk
2021-04-27 22:01:03 +02:00
parent 6d229f8de2
commit 2085d5a048
9 changed files with 10 additions and 19 deletions
+7 -4
View File
@@ -393,10 +393,13 @@ furthestPointWalkable p1 p2 ws = head $ (sortBy (compare `on` dist p1) $ IM.elem
) ++ [p2]
collidePointIndirect :: Point2 -> Point2 -> IM.IntMap Wall -> Maybe Point2
collidePointIndirect p1 p2 ws = listToMaybe $ sortOn (dist p1) $ IM.elems
$ IM.mapMaybe ( ( \(x:y:_) -> intersectSegSeg' p1 p2 x y)
. _wlLine
) notWindows
{-# INLINE collidePointIndirect #-}
collidePointIndirect p1 p2 ws = listToMaybe
$ sortOn (dist p1)
$ IM.elems
$ IM.mapMaybe ( ( \(x:y:_) -> intersectSegSeg' p1 p2 x y)
. _wlLine
) notWindows
where
notWindows = IM.filter (not . _wlIsSeeThrough) ws
-4
View File
@@ -445,7 +445,6 @@ data Wall
= Wall
{ _wlLine :: [Point2] , _wlID :: Int
, _wlColor :: Color
, _wlDraw :: Maybe (Wall -> Picture)
, _wlSeen :: Bool
, _wlIsSeeThrough :: Bool
}
@@ -454,7 +453,6 @@ data Wall
, _wlID :: Int
, _doorMech :: World -> World
, _wlColor :: Color
, _wlDraw :: Maybe (Wall -> Picture)
, _wlSeen :: Bool
, _blIDs :: [Int]
, _blHP :: Int
@@ -464,7 +462,6 @@ data Wall
{ _wlLine :: [Point2] , _wlID :: Int
, _doorMech :: World -> World
, _wlColor :: Color
, _wlDraw :: Maybe (Wall -> Picture)
, _wlSeen :: Bool
, _wlIsSeeThrough :: Bool
, _doorPathable :: Bool
@@ -473,7 +470,6 @@ data Wall
{ _wlLine :: [Point2]
, _wlID :: Int
, _wlColor :: Color
, _wlDraw :: Maybe (Wall -> Picture)
, _wlSeen :: Bool
, _blIDs :: [Int]
, _blHP :: Int
-3
View File
@@ -31,7 +31,6 @@ defaultWall = Wall
{ _wlLine = [(0,0),(50,0)]
, _wlID = 0
, _wlColor = greyN 0.6
, _wlDraw = Nothing
, _wlSeen = False
, _wlIsSeeThrough = False
}
@@ -44,7 +43,6 @@ defaultAutoDoor = Door
, _wlID = 0
, _doorMech = id
, _wlColor = light $ dim $ dim $ dim $ yellow
, _wlDraw = Nothing
, _wlSeen = False
, _wlIsSeeThrough = False
, _doorPathable = True
@@ -57,7 +55,6 @@ defaultDoor = Door
, _wlID = 0
, _doorMech = id
, _wlColor = light $ dim $ dim $ dim $ yellow
, _wlDraw = Nothing
, _wlSeen = False
, _wlIsSeeThrough = False
, _doorPathable = False
-1
View File
@@ -121,7 +121,6 @@ addPane :: Color -> (Point2,Point2) -> IM.IntMap Wall -> IM.IntMap Wall
addPane c (p0,p1) wls = IM.insert (newKey wls) (Wall { _wlLine = [p0,p1]
, _wlID = newKey wls
, _wlColor = c
, _wlDraw = Nothing
, _wlSeen = False
, _wlIsSeeThrough = True
}
-1
View File
@@ -63,7 +63,6 @@ autoDoorPane (trigx,trigy) n closedPos openPos = Door
, _wlID = n
, _doorMech = dm
, _wlColor = dim $ yellow
, _wlDraw = Nothing
, _wlSeen = False
, _wlIsSeeThrough = False
, _doorPathable = True
-2
View File
@@ -91,7 +91,6 @@ addBlockNoShadow (p:ps) hp col isSeeThrough degradability hasAllShadows w
, _wlID = j
-- , _wlColor = greyN 0.5
, _wlColor = col
, _wlDraw = Nothing
, _wlSeen = False
, _blIDs = is
, _blHP = hp
@@ -124,7 +123,6 @@ addBlock (p:ps) hp col isSeeThrough degradability w
, _wlID = j
-- , _wlColor = greyN 0.5
, _wlColor = col
, _wlDraw = Nothing
, _wlSeen = False
, _blIDs = is
, _blHP = hp
-1
View File
@@ -112,7 +112,6 @@ triggerDoorPane c cond n closedPos openPos = Door
, _wlID = n
, _doorMech = dm
, _wlColor = c
, _wlDraw = Nothing
, _wlSeen = False
, _wlIsSeeThrough = False
, _doorPathable = False
-2
View File
@@ -67,7 +67,6 @@ baseBlockPane = Block
{ _wlLine = []
, _wlID = 0
, _wlColor = greyN 0.5
, _wlDraw = Nothing
, _wlSeen = False
, _blIDs = []
, _blHP = 5
@@ -81,7 +80,6 @@ baseWindowPane = Block
{ _wlLine = []
, _wlID = 0
, _wlColor = withAlpha 0.2 cyan
, _wlDraw = Nothing
, _wlSeen = False
, _blIDs = []
, _blHP = 1
+3 -1
View File
@@ -165,9 +165,11 @@ farWallDist cpos w = min (halfWidth w / (horizontalMax+50) ) (halfHeight w / (ve
tRays = rotF [(y, maxViewDistance) | y <- zs]
bRays = rotF [(y,-maxViewDistance) | y <- zs]
rotF = map (h . (+.+) cpos . rotateV (_cameraRot w))
zs = take 9 [-maxViewDistance,0 - 0.8*maxViewDistance..]
zs = takeWhile (< maxViewDistance) [-maxViewDistance,0 - 0.8*maxViewDistance..]
maxViewDistance = 800
dirRays :: Float -> [Point2]
dirRays dir = take 11 $ iterate (rotateV (0.5 * pi / 10)) $ rotateV (dir-pi*0.25) (600,0)