module Dodge.Cloud.Draw where import Dodge.Data.Cloud import Picture drawCloud :: CloudDraw -> Cloud -> Picture drawCloud cd = case cd of CloudColor radmult fadet col -> drawCloudWith radmult fadet col -- DrawGasCloud col -> const . setLayer MidLayer . setDepth 30 $ color (withAlpha 0.05 col) -- $ circleSolid 20 drawCloudWith :: Float -> Float -> Color -> Cloud -> Picture drawCloudWith radMult fadet col cl = setLayer MidLayer . setDepth 25 $ circleSolidCol (withAlpha 0 col) (withAlpha a col) (radMult * _clRad cl) where a = min 1 $ fromIntegral (_clTimer cl) / fadet