Runtime broken level generation

This commit is contained in:
2021-03-29 11:27:30 +02:00
parent e0570ed54c
commit c959b7d59c
9 changed files with 356 additions and 369 deletions
+9 -9
View File
@@ -194,19 +194,19 @@ cloudPoisonDamage c w = w & creatures %~ flip (foldr (IM.adjust doDam)) damagedC
makeTeslaArcAt :: Int -> Point2 -> Float -> Projectile
makeTeslaArcAt i pos dir = Projectile
{ _ptPos = pos
, _ptStartPos = pos
, _ptVel = (0,0)
, _ptPict = onLayer PtLayer $ line [(0,0),(0,0)]
, _ptID = i
, _ptUpdate = moveTeslaArc pos dir i
{ _pjPos = pos
, _pjStartPos = pos
, _pjVel = (0,0)
, _pjPict = onLayer PtLayer $ line [(0,0),(0,0)]
, _pjID = i
, _pjUpdate = moveTeslaArc pos dir i
}
moveTeslaArc :: Point2 -> Float -> Int -> World -> World
moveTeslaArc p d i w =
set (projectiles . ix i . ptPict) pic
$ set (projectiles . ix i . ptUpdate)
(ptTimer 2 i)
set (projectiles . ix i . pjPict) pic
$ set (projectiles . ix i . pjUpdate)
(pjTimer 2 i)
$ set randGen g
$ createSpark 8 nc q2 (argV sv + d1) Nothing
$ foldr damCrs w hitCrs