Add destroyable lighting

This commit is contained in:
jgk
2021-03-27 11:59:34 +01:00
parent 151fa5b6bd
commit 2897c65e9e
7 changed files with 135 additions and 143 deletions
+2 -3
View File
@@ -39,6 +39,7 @@ import qualified Data.Set as S
import qualified Data.Map as M
-- deals with placement of objects within the world
-- after they have had their coordinates set by the layout
placeSpots :: [PlacementSpot] -> World -> World
placeSpots pss w = foldr placeSpot w basicPlacements
@@ -75,9 +76,6 @@ placeSpot ps w = case ps of
PS {_psPos = p, _psRot = rot, _psType = PutBlock (hp:hps) col ps}
-> putBlock (map (shiftPointBy (p,rot)) ps) hp col False hps w
-- PS {_psPos = p, _psRot = rot, _psType = PutBlockWall (hp:hps) col ps}
-- -> putBlockWallPart (map (shiftPointBy (p,rot)) ps) hp col False hps w
PS {_psPos = p, _psRot = rot, _psType = PutBtDoor c bp f a b}
-> addButtonDoor c (shiftPointBy (p,rot) bp) (f + rot)
(shiftPointBy (p,rot) a) (shiftPointBy (p,rot) b) w
@@ -95,6 +93,7 @@ placeSpot ps w = case ps of
_ -> w
-- TODO: remove this typeclass
class Shiftable a where
translateS :: Point2 -> a -> a
rotateS :: Float -> a -> a