Move towards allowing partial destruction of doors
This commit is contained in:
@@ -15,6 +15,7 @@ import qualified IntMapHelp as IM
|
||||
import Dodge.SoundLogic
|
||||
--import Dodge.LevelGen.LevelStructure
|
||||
|
||||
--import Data.Maybe
|
||||
import Data.List
|
||||
import Control.Lens
|
||||
--import Data.Graph.Inductive hiding ((&))
|
||||
@@ -106,27 +107,24 @@ doorMechanism dr w = case mvDir of
|
||||
plSlideDoor
|
||||
:: Bool
|
||||
-> Color
|
||||
-> (World -> Bool)
|
||||
-> Door
|
||||
-> Float
|
||||
-> Point2
|
||||
-> Point2
|
||||
-> Float
|
||||
-> World
|
||||
-> (Int, World)
|
||||
plSlideDoor isPathable col cond shiftOffset a b speed gw
|
||||
plSlideDoor isPathable col dr shiftOffset a b gw
|
||||
= (drid, addDoorWalls gw & doors %~ addDoor)
|
||||
where
|
||||
drid = IM.newKey $ _doors gw
|
||||
addDoor = IM.insert drid $ defaultDoor
|
||||
addDoor = IM.insert drid $ dr
|
||||
{ _drID = drid
|
||||
, _drWallIDs = IS.fromList wlids
|
||||
, _drStatus = DoorClosed
|
||||
, _drTrigger = cond
|
||||
, _drMech = doorMechanism
|
||||
, _drPos = (a,b)
|
||||
, _drOpenPos = (shiftLeft a,shiftLeft b)
|
||||
, _drClosePos = (a,b)
|
||||
, _drSpeed = speed
|
||||
}
|
||||
addDoorWalls w' = foldl' (addDoorWall drid col isPathable) w' $ zip wlids pairs
|
||||
pairs = rectanglePairs 9 a b
|
||||
|
||||
Reference in New Issue
Block a user