Steps towards making clouds list based

This commit is contained in:
2021-07-21 00:05:13 +02:00
parent af44a380fc
commit 7b45a4a295
7 changed files with 65 additions and 67 deletions
+4 -5
View File
@@ -10,17 +10,16 @@ import qualified IntMapHelp as IM
import Control.Lens
makeCloudAt :: Float -> Int -> (Cloud -> Picture) -> Point2 -> World -> World
makeCloudAt rad t drawFunc p w = w & clouds %~ IM.insert i theCloud
makeCloudAt rad t drawFunc p w = w & clouds %~ (theCloud :)
where
i = IM.newKey $ _clouds w
theCloud = Cloud
{ _clID = i
, _clPos = p
{ _clPos = p
, _clVel = (0,0)
, _clPict = drawFunc
, _clRad = rad
, _clTimer = t
, _clEffect = const id
, _clType = SmokeCloud
--, _clEffect = const id
}
drawCloudWith :: Float -> Float -> Color -> Cloud -> Picture