Cleanup
This commit is contained in:
@@ -5,19 +5,14 @@ module Dodge.Creature.Lamp
|
||||
import Dodge.Data
|
||||
import Dodge.Material.Sound
|
||||
import Dodge.Default
|
||||
import Dodge.Creature.Picture
|
||||
import Dodge.LightSource
|
||||
import Dodge.WorldEvent.Flash
|
||||
import Dodge.WorldEvent.Sound
|
||||
import Dodge.Creature.State
|
||||
import Geometry
|
||||
import Picture
|
||||
import Polyhedra
|
||||
import qualified IntMapHelp as IM
|
||||
import LensHelp
|
||||
|
||||
--import qualified Streaming.Prelude as S
|
||||
|
||||
colorLamp
|
||||
:: Point3 -- color of lamp
|
||||
-> Float -- height of lamp
|
||||
@@ -25,7 +20,7 @@ colorLamp
|
||||
colorLamp col h = defaultInanimate
|
||||
{ _crUpdate = initialiseColorLamp col h
|
||||
, _crHP = 100
|
||||
, _crType = DrawnCreature $ picAtCrPosNoRot (lampCrPic h)
|
||||
, _crType = Lampoid h
|
||||
, _crRad = 3
|
||||
, _crMass = 3
|
||||
}
|
||||
@@ -33,14 +28,6 @@ colorLamp col h = defaultInanimate
|
||||
lamp :: Float -> Creature
|
||||
lamp = colorLamp 0.75
|
||||
|
||||
lampCrPic :: Float -> Picture
|
||||
lampCrPic h = pictures
|
||||
[ setLayer BloomLayer (setDepth h . color white $ circleSolid 3)
|
||||
, foldMap (polyToTris . map f) $ boxXYZnobase 5 5 (h-1)
|
||||
]
|
||||
where
|
||||
f pos = Verx (pos -.-.- V3 2.5 2.5 0) blue [] BottomLayer polyNum
|
||||
|
||||
initialiseColorLamp :: Point3 -> Float -> Creature -> World -> World
|
||||
initialiseColorLamp col h cr w = w
|
||||
& lightSources . at lsid ?~ lsColPosID col (addZ h $ _crPos cr) lsid
|
||||
|
||||
Reference in New Issue
Block a user