Separate out concrete part of world
This commit is contained in:
+4
-4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user