Modularise item data, change tesla arc from projectile to particle

This commit is contained in:
2021-06-06 16:08:56 +02:00
parent c2f7c6e245
commit 0b8ac97fe9
25 changed files with 141 additions and 85 deletions
+9 -8
View File
@@ -36,14 +36,15 @@ makeTeslaExplosionAt
:: Point2 -- ^ Position
-> World
-> World
makeTeslaExplosionAt pos w = soundOncePos grenadeBang pos $ foldr ($) w listOfFunctions -- a bit shorter
where
xs = randomRs (0, 2*pi) $ _randGen w
j = newProjectileKey w
pks = [j..]
listOfFunctions = map
(\i -> over projectiles (IM.insert (pks!!i) (makeTeslaArcAt (pks!!i) pos (xs!!i))))
[1 .. 29]
makeTeslaExplosionAt pos w = undefined
-- soundOncePos grenadeBang pos $ foldr ($) w listOfFunctions -- a bit shorter
-- where
-- xs = randomRs (0, 2*pi) $ _randGen w
-- j = newProjectileKey w
-- pks = [j..]
-- listOfFunctions = map
-- (\i -> over projectiles (IM.insert (pks!!i) (makeTeslaArcAt (pks!!i) pos (xs!!i))))
-- [1 .. 29]
makeFlameExplosionAt
:: Point2 -- ^ Position