Commit before attempting to remove ptDraw field
This commit is contained in:
@@ -52,10 +52,27 @@ drawPulse col pt = setLayer DebugLayer $ pictures sweepPics
|
||||
x = _ptTimer pt
|
||||
{- | Radar blip at a point. -}
|
||||
blipAt :: Float -> Point2 -> Color -> Int -> Particle
|
||||
blipAt r p col i = Particle
|
||||
{_ptDraw = const blank
|
||||
,_ptUpdate = mvBlip r p col i i
|
||||
blipAt r p col i = BlipParticle
|
||||
{_ptDraw = drawBlip
|
||||
,_ptUpdate = \w pt -> if _ptTimer pt <= 0 then (w,Nothing) else (w,Just $ pt & ptTimer -~ 1)
|
||||
,_ptColor = col
|
||||
,_ptTimer = i
|
||||
,_ptMaxTime = i
|
||||
,_ptRad = r
|
||||
,_ptPos = p
|
||||
}
|
||||
drawBlip :: Particle -> Picture
|
||||
drawBlip pt = setDepth (-0.5)
|
||||
. setLayer DebugLayer
|
||||
. uncurryV translate p
|
||||
. color (withAlpha (fromIntegral t / fromIntegral maxt) col)
|
||||
$ circleSolid r
|
||||
where
|
||||
p = _ptPos pt
|
||||
t = _ptTimer pt
|
||||
r = _ptRad pt
|
||||
col = _ptColor pt
|
||||
maxt = _ptMaxTime pt
|
||||
mvBlip :: Float
|
||||
-> Point2 -> Color
|
||||
-> Int -- ^ Max possible timer value
|
||||
|
||||
Reference in New Issue
Block a user