Commit before generalising picture transformation to alternative
This commit is contained in:
@@ -18,13 +18,14 @@ import Control.Lens
|
||||
import Control.Monad.State
|
||||
import Data.Maybe
|
||||
import qualified Data.IntMap.Strict as IM
|
||||
import Data.Foldable
|
||||
|
||||
withThinSmoke
|
||||
:: (Creature -> World -> World) -- ^ Underlying effect
|
||||
-> Creature
|
||||
-> World
|
||||
-> World
|
||||
withThinSmoke eff cr w = eff cr $ foldr (makeThinSmokeAt . (+.+ pos)) w ps
|
||||
withThinSmoke eff cr w = eff cr $ foldl' (flip $ makeThinSmokeAt . (+.+ pos)) w ps
|
||||
where
|
||||
dir = _crDir cr
|
||||
pos = _crPos cr +.+ (_crRad cr +0.5) *.* unitVectorAtAngle dir
|
||||
@@ -35,7 +36,7 @@ withThickSmoke
|
||||
-> Creature
|
||||
-> World
|
||||
-> World
|
||||
withThickSmoke eff cr w = eff cr $ foldr (makeThickSmokeAt . (+.+ pos)) w ps
|
||||
withThickSmoke eff cr w = eff cr $ foldl' (flip $ makeThickSmokeAt . (+.+ pos)) w ps
|
||||
where
|
||||
dir = _crDir cr
|
||||
pos = _crPos cr +.+ (_crRad cr + 15) *.* unitVectorAtAngle dir
|
||||
|
||||
Reference in New Issue
Block a user