Tweak airlock door to stop z fighting

This commit is contained in:
2021-04-22 14:42:49 +02:00
parent 1ab793180c
commit 6c65515381
4 changed files with 24 additions and 10 deletions
+9 -1
View File
@@ -22,6 +22,9 @@ data Annotation
| Key Int
| Corridor
| DoorAno
| SwitchDoorAno
| DoorNumAno Int
| AirlockAno
| FirstWeapon
| StartRoom
| EndRoom
@@ -42,12 +45,17 @@ randomPadCorridors (Node x xs) = do
xs' <- mapM randomPadCorridors xs
return $ treeTrunk (replicate n [Corridor]) (Node x xs')
roomThenCorridor :: RandomGen g => Room -> State g (Tree (Either Room Room))
roomThenCorridor theRoom = fmap (\r -> Node (Left theRoom) [(pure . Right) r])
(randomiseOutLinks corridor)
annoToRoomTree :: RandomGen g => [Annotation] -> State g (Tree (Either Room Room))
annoToRoomTree [OrAno as] = do
a <- takeOne as
annoToRoomTree a
annoToRoomTree [Corridor] = fmap (pure . Right) $ randomiseOutLinks corridor
annoToRoomTree [DoorAno] = fmap (\r -> Node (Left door) [(pure . Right) r]) (randomiseOutLinks corridor)
annoToRoomTree [DoorAno] = roomThenCorridor door
annoToRoomTree [DoorNumAno i,AirlockAno] = roomThenCorridor (airlock i)
annoToRoomTree [FirstWeapon] = do
branchWP <- branchRectWith weaponRoom
blockedC <- blockedCorridor