Working implementation of light change when door opens

This commit is contained in:
2021-09-29 01:34:54 +01:00
parent 6b937b115e
commit f3437adef7
12 changed files with 87 additions and 66 deletions
+7
View File
@@ -8,6 +8,7 @@ module Dodge.LightSources
, lampCoverWhen
, doubleLampCover
, verticalLampCover
, chain
)
where
import Dodge.Data
@@ -26,7 +27,13 @@ colorLightAt col pos i =
,_lsDir = 0
,_lsRad = 700
,_lsIntensity = col
,_lsPict = lightSourcePicture
}
lightSourcePicture :: LightSource -> Picture
lightSourcePicture ls = setLayer 1 . translate3 (_lsPos ls) . color col $ circleSolid 3
where
col = V4 r g b 1
V3 r g b = _lsIntensity ls
lightAt :: Point3 -> Int -> LightSource
lightAt = colorLightAt 0.75