Pass projectile object to draw function

This commit is contained in:
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
@@ -126,7 +126,7 @@ tractorBeamAt colID i pos dir = Projectile
{ _pjPos = pos
, _pjStartPos = p'
, _pjVel = d
, _pjPict = blank
, _pjDraw = \_ -> blank
, _pjID = i
, _pjUpdate = updateTractor colID 10 i
}
@@ -139,7 +139,7 @@ The interaction of this with objects, walls etc needs more thought. -}
updateTractor :: Int -> Int -> Int -> World -> World
updateTractor colID time i w
| time > 0 = set (projectiles . ix i . pjUpdate) (updateTractor colID (time-1) i)
$ set (projectiles . ix i . pjPict) pic
$ set (projectiles . ix i . pjDraw) (\_ -> pic)
$ over creatures (IM.map tractCr)
$ over floorItems (IM.map tractFlIt)
w