Broken level generation with error message on run
This commit is contained in:
@@ -20,12 +20,16 @@ import qualified Data.Set as S
|
||||
-- ie returns a new set of walls with a hole determined by anticlockwise ordering of the points
|
||||
cutWalls' :: [Point2] -> IM.IntMap Wall -> IM.IntMap Wall
|
||||
cutWalls' qs walls =
|
||||
IM.filter (not.wallIsZeroLength)
|
||||
. fuseWallsWith zs
|
||||
.createPolyWalls rs
|
||||
nubWalls
|
||||
. IM.filter (not.wallIsZeroLength)
|
||||
. removeWallsInPolygon ps
|
||||
$ fuseWallsWith zs cwals
|
||||
. fuseWallsWith zs
|
||||
. createPolyWalls rs
|
||||
. IM.filter (not.wallIsZeroLength)
|
||||
-- . removeWallsInPolygon ps
|
||||
-- $ fuseWallsWith zs cwals
|
||||
. fuseWallsWith zs
|
||||
$ removeWallsInPolygon ps
|
||||
cwals
|
||||
where
|
||||
(zs,cwals) = cutWallsWithPoints ps walls
|
||||
ps = orderPolygon qs
|
||||
@@ -38,6 +42,7 @@ cutWalls' qs walls =
|
||||
-- also remove any walls that ended up zero length
|
||||
-- draw the required new walls along the polygon boundary
|
||||
|
||||
-- the following checks one of the corners of cut walls at each step
|
||||
cutWalls :: [Point2] -> IM.IntMap Wall -> IM.IntMap Wall
|
||||
cutWalls ps wls = case mapMaybe (flip checkWallRight newWalls) newWallsList of
|
||||
[] -> newWalls
|
||||
|
||||
Reference in New Issue
Block a user