Add various helpers for creating polyhedra
This commit is contained in:
@@ -41,7 +41,7 @@ initialiseLamp :: CRUpdate
|
||||
initialiseLamp w (f,g) cr = ( (addLS . f , g), Just $ cr & crUpdate .~ updateLamp i)
|
||||
where
|
||||
i = IM.newKey $ _lightSources $ f w -- to give different lights different keys
|
||||
addLS = over lightSources (IM.insert i (lightAt (x,y,0) i))
|
||||
addLS = over lightSources (IM.insert i (lightAt (x,y,100) i))
|
||||
(x,y) = _crPos cr
|
||||
|
||||
updateLamp :: Int -> CRUpdate
|
||||
@@ -53,7 +53,7 @@ updateLamp i = unrandUpdate handleLS internalUpdate
|
||||
| otherwise = w & lightSources . ix i . lsPos .~ f cPos
|
||||
where
|
||||
cPos = _crPos cr
|
||||
f (x,y) = (x,y,0)
|
||||
f (x,y) = (x,y,100)
|
||||
internalUpdate cr
|
||||
| _crHP cr < 0 = Nothing
|
||||
| otherwise = Just $ doDamage cr
|
||||
|
||||
Reference in New Issue
Block a user