Reify cloud drawing, move gust data
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user