Implement moving mounted lights
This commit is contained in:
@@ -98,9 +98,18 @@ doorMechanism drid speed wlidOpCps dr w
|
||||
doClose w' (wlid,_ ,clp) = moveWallIDToward wlid speed clp w'
|
||||
|
||||
-- TODO cut pathing if not pathable, reset when opened
|
||||
plSlideDoor :: Bool -> Color -> (World -> Bool) -> Point2 -> Point2 -> Float -> GenWorld
|
||||
plSlideDoor
|
||||
:: Bool
|
||||
-> Color
|
||||
-> (World -> Bool)
|
||||
-> Float
|
||||
-> Point2
|
||||
-> Point2
|
||||
-> Float
|
||||
-> GenWorld
|
||||
-> (Int, GenWorld)
|
||||
plSlideDoor isPathable col cond a b speed gw = (drid, gw & gWorld .~ (addWalls w & doors %~ addDoor))
|
||||
plSlideDoor isPathable col cond shiftOffset a b speed gw
|
||||
= (drid, gw & gWorld .~ (addWalls w & doors %~ addDoor))
|
||||
where
|
||||
w = _gWorld gw
|
||||
drid = IM.newKey $ _doors w
|
||||
@@ -117,7 +126,7 @@ plSlideDoor isPathable col cond a b speed gw = (drid, gw & gWorld .~ (addWalls w
|
||||
addWalls w' = foldl' (addDoorWall col isPathable) w' $ zip wlids pairs
|
||||
pairs = rectanglePairs 9 a b
|
||||
shiftedPairs = map (bimap shiftLeft shiftLeft) pairs
|
||||
shiftLeft = (+.+ (a -.- b +.+ normalizeV (b -.- a)))
|
||||
shiftLeft = (+.+ (a -.- b +.+ shiftOffset *.* normalizeV (b -.- a)))
|
||||
wlids = take 4 [IM.newKey $ _walls w ..]
|
||||
-- old code that may help with pathing
|
||||
--import Dodge.LevelGen.Pathing
|
||||
|
||||
Reference in New Issue
Block a user