Assign used links during room generation
This commit is contained in:
@@ -19,6 +19,7 @@ assigning no bounds will allow rooms to overlap.
|
||||
data Room = Room
|
||||
{ _rmPolys :: [ [Point2] ]
|
||||
, _rmLinks :: [(Point2,Float)]
|
||||
, _rmUsedLinks :: [(Point2,Float)]
|
||||
, _rmPath :: [(Point2, Point2)]
|
||||
, _rmPS :: [Placement]
|
||||
, _rmBound :: [ [Point2] ]
|
||||
|
||||
@@ -106,8 +106,12 @@ addButtonSlowDoor x h rm = do
|
||||
,( V2 (x/2+50) 5,0)
|
||||
]
|
||||
thePlacement <- takeOne [butDoor butPos butRot ]
|
||||
filterLinks aboveH =<< changeLinkTo belowH (rm & rmPS %~ (thePlacement :))
|
||||
filterLinks aboveH =<< changeLinkTo belowH (rm
|
||||
& rmPS %~ (thePlacement :)
|
||||
& rmBound %~ (openDoorBound :)
|
||||
)
|
||||
where
|
||||
openDoorBound = rectNSEW (h + 5) (h - 5) (-x/2) (3*x/2)
|
||||
belowH y = (sndV2 . fst) y < h - 40
|
||||
aboveH y = (sndV2 . fst) y > h + 40
|
||||
butDoor bpos brot = putLitButtonID col bpos brot
|
||||
|
||||
Reference in New Issue
Block a user