Pass projectile object to draw function

This commit is contained in:
jgk
2021-05-24 14:21:13 +02:00
parent a15d592951
commit 38682049c4
10 changed files with 36 additions and 34 deletions
+2 -2
View File
@@ -246,7 +246,7 @@ makeTeslaArcAt i pos dir = Projectile
{ _pjPos = pos
, _pjStartPos = pos
, _pjVel = (0,0)
, _pjPict = onLayer PtLayer $ line [(0,0),(0,0)]
, _pjDraw = \_ -> onLayer PtLayer $ line [(0,0),(0,0)]
, _pjID = i
, _pjUpdate = moveTeslaArc pos dir i
}
@@ -258,7 +258,7 @@ moveTeslaArc
-> World
-> World
moveTeslaArc p d i w =
set (projectiles . ix i . pjPict) pic
set (projectiles . ix i . pjDraw) (\_ -> pic)
$ set (projectiles . ix i . pjUpdate)
(pjTimer 2 i)
$ set randGen g