Separate out concrete part of world

This commit is contained in:
2022-07-25 12:10:50 +01:00
parent 3354d108be
commit b2efbd2b3e
134 changed files with 933 additions and 930 deletions
+4 -4
View File
@@ -35,8 +35,8 @@ sparkDam
-> World
-> World
sparkDam sk sp ep mayEiCrWl = case mayEiCrWl of
(hitp,Left cr) -> creatures . ix (_crID cr) . crState . csDamage .:~ thedam hitp
(hitp,Right wl) -> wallDamages %~ IM.insertWith (++) (_wlID wl) [thedam hitp]
(hitp,Left cr) -> cWorld . creatures . ix (_crID cr) . crState . csDamage .:~ thedam hitp
(hitp,Right wl) -> cWorld . wallDamages %~ IM.insertWith (++) (_wlID wl) [thedam hitp]
where
thedam hitp = Damage (_skDamageType sk) 1 sp hitp ep NoDamageEffect
@@ -53,7 +53,7 @@ randColDirSpark
-> World
-> World
randColDirSpark randcol randdir pos w = w
& sparks .:~ spark
& cWorld . sparks .:~ spark
& randGen .~ g
where
((col,dir),g) = (`runState` _randGen w) $ do
@@ -79,7 +79,7 @@ randSpark
-> World
randSpark dt randspeed randcol randdir pos w = w
& randGen .~ g
& sparks .:~ Spark
& cWorld . sparks .:~ Spark
{ _skVel = rotateV dir (V2 speed 0)
, _skColor = col
, _skPos = pos