Steps towards making clouds list based

This commit is contained in:
jgk
2021-07-21 00:05:13 +02:00
parent af44a380fc
commit 7b45a4a295
7 changed files with 65 additions and 67 deletions
+11 -11
View File
@@ -264,19 +264,19 @@ makeGasCloud
-> World
-> World
makeGasCloud pos vel w = w
& clouds %~ IM.insert i theCloud
& clouds %~ (theCloud :)
& randGen .~ g
where
i = IM.newKey $ _clouds w
theCloud = Cloud { _clID = i
, _clPos = pos
, _clVel = vel
, _clPict = \_ -> onLayer CrLayer $ color (withAlpha 0.1 col)
$ circleSolid 20
, _clRad = 10
, _clTimer = 400
, _clEffect = cloudPoisonDamage
}
theCloud = Cloud
{ _clPos = pos
, _clVel = vel
, _clPict = \_ -> onLayer CrLayer $ color (withAlpha 0.1 col)
$ circleSolid 20
, _clRad = 10
, _clTimer = 400
, _clType = GasCloud
-- , _clEffect = cloudPoisonDamage
}
(col, g) = runState (takeOne [green,yellow]) $ _randGen w
{-