Data-ify creature drawing (partially)
This commit is contained in:
@@ -25,19 +25,14 @@ colorLamp
|
||||
colorLamp col h = defaultInanimate
|
||||
{ _crUpdate = initialiseColorLamp col h
|
||||
, _crHP = 100
|
||||
, _crPict = picAtCrPosNoRot (lampCrPic h)
|
||||
, _crType = DrawnCreature $ picAtCrPosNoRot (lampCrPic h)
|
||||
, _crRad = 3
|
||||
, _crMass = 3
|
||||
}
|
||||
|
||||
lamp :: Float -> Creature
|
||||
lamp h = defaultInanimate
|
||||
{ _crUpdate = initialiseLamp h
|
||||
, _crHP = 100
|
||||
, _crPict = picAtCrPosNoRot (lampCrPic h)
|
||||
, _crRad = 3
|
||||
, _crMass = 3
|
||||
}
|
||||
lamp = colorLamp 0.75
|
||||
|
||||
lampCrPic :: Float -> Picture
|
||||
lampCrPic h = pictures
|
||||
[ setLayer BloomLayer (setDepth h . color white $ circleSolid 3)
|
||||
@@ -46,9 +41,6 @@ lampCrPic h = pictures
|
||||
where
|
||||
f pos = Verx (pos -.-.- V3 2.5 2.5 0) blue [] BottomLayer polyNum
|
||||
|
||||
initialiseLamp :: Float -> Creature -> World -> World
|
||||
initialiseLamp = initialiseColorLamp 0.75
|
||||
|
||||
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