Add ItEffect data as parameter to the effect itself
This commit is contained in:
+6
-6
@@ -16,7 +16,7 @@ drawCircleAtFor p t w = w & projectiles %~
|
||||
, _pjVel = (0,0)
|
||||
, _pjDraw = \_ -> onLayer PtLayer $ uncurry translate p $ color white $ circleSolid 20
|
||||
, _pjID = k
|
||||
, _pjUpdate = pjTimer t k
|
||||
, _pjUpdate = \_ -> pjTimerF t k
|
||||
}
|
||||
where
|
||||
k = IM.newKey $ _projectiles w
|
||||
@@ -28,7 +28,7 @@ drawCircleAtForCol p t col w = w & projectiles %~
|
||||
, _pjVel = (0,0)
|
||||
, _pjDraw = \_ -> onLayer PtLayer $ uncurry translate p $ color col $ circleSolid 20
|
||||
, _pjID = k
|
||||
, _pjUpdate = pjTimer t k
|
||||
, _pjUpdate = \_ -> pjTimerF t k
|
||||
}
|
||||
where
|
||||
k = IM.newKey $ _projectiles w
|
||||
@@ -40,12 +40,12 @@ drawLineForCol ps t col w = w & projectiles %~
|
||||
, _pjVel = (0,0)
|
||||
, _pjDraw = \_ -> onLayer PtLayer $ color col $ lineOfThickness 5 ps
|
||||
, _pjID = k
|
||||
, _pjUpdate = pjTimer t k
|
||||
, _pjUpdate = \_ -> pjTimerF t k
|
||||
}
|
||||
where
|
||||
k = IM.newKey $ _projectiles w
|
||||
|
||||
pjTimer :: Int -> Int -> World -> World
|
||||
pjTimer 0 i = projectiles %~ IM.delete i
|
||||
pjTimer time i = projectiles . ix i . pjUpdate .~ pjTimer (time - 1) i
|
||||
pjTimerF :: Int -> Int -> World -> World
|
||||
pjTimerF 0 i = projectiles %~ IM.delete i
|
||||
pjTimerF time i = projectiles . ix i . pjUpdate .~ (\_ -> pjTimerF (time - 1) i)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user