Start to add mountable objects

This commit is contained in:
2022-06-23 16:07:58 +01:00
parent 85406d06c1
commit e3d5c4eb4b
6 changed files with 31 additions and 11 deletions
+6 -2
View File
@@ -106,8 +106,12 @@ addButtonSlowDoor x h rm = do
openDoorBound = reverse $ rectNSWE (h + 5) (h - 5) (3*x/2) (-x/2)
belowH y = (sndV2 . fst) y < h - 40
aboveH y = (sndV2 . fst) y > h + 40
amountedlight dr xoff = Just . moveLSThen (getdoorpos (fromJust $ _plMID dr))
(V3 15 xoff 89) (aShape (V2 15 0) (V3 15 xoff 90)) . const . const
amountedlight dr xoff mpl = Just . moveLSThen (getdoorpos (fromJust $ _plMID dr))
(V3 15 xoff 89) (aShape (V2 15 0) (V3 15 xoff 90))
$ \plls plpr -> Just $ ptCont (PutWorldUpdate (const $ setmount dr plls plpr))
$ const mpl
setmount pldr plls plpr = doors . ix (fromJust $ _plMID pldr) . drMounts .++~
[MountedLS (fromJust $ _plMID plls), MountedProp (fromJust $ _plMID plpr)]
-- TODO make the height of this light source and of other mounted lights
-- be taken from a single consistent source
butDoor = putLitButOnPos col