Rename (indexed) particles to projectiles
This commit is contained in:
+8
-8
@@ -14,8 +14,8 @@ import qualified Data.IntMap.Strict as IM
|
||||
drawCircleAtFor :: Point2 -> Int -> World -> World
|
||||
drawCircleAtFor p t w =
|
||||
let n = newParticleKey w
|
||||
in over particles ( IM.insert n
|
||||
Particle { _ptPos = p
|
||||
in over projectiles ( IM.insert n
|
||||
Projectile { _ptPos = p
|
||||
, _ptStartPos = p
|
||||
, _ptVel = (0,0)
|
||||
, _ptPict = onLayer PtLayer $ uncurry translate p $ color white $ circleSolid 20
|
||||
@@ -25,8 +25,8 @@ drawCircleAtFor p t w =
|
||||
drawCircleAtForCol :: Point2 -> Int -> Color -> World -> World
|
||||
drawCircleAtForCol p t col w =
|
||||
let n = newParticleKey w
|
||||
in over particles ( IM.insert n
|
||||
Particle { _ptPos = p
|
||||
in over projectiles ( IM.insert n
|
||||
Projectile { _ptPos = p
|
||||
, _ptStartPos = p
|
||||
, _ptVel = (0,0)
|
||||
, _ptPict = onLayer PtLayer $ uncurry translate p $ color col $ circleSolid 20
|
||||
@@ -36,8 +36,8 @@ drawCircleAtForCol p t col w =
|
||||
drawLineForCol :: [Point2] -> Int -> Color -> World -> World
|
||||
drawLineForCol ps t col w =
|
||||
let n = newParticleKey w
|
||||
in over particles ( IM.insert n
|
||||
Particle { _ptPos = head ps
|
||||
in over projectiles ( IM.insert n
|
||||
Projectile { _ptPos = head ps
|
||||
, _ptStartPos = head ps
|
||||
, _ptVel = (0,0)
|
||||
, _ptPict = onLayer PtLayer $ color col $ lineOfThickness 5 ps
|
||||
@@ -46,5 +46,5 @@ drawLineForCol ps t col w =
|
||||
} ) w
|
||||
|
||||
ptTimer :: Int -> Int -> World -> World
|
||||
ptTimer 0 i = over particles (IM.delete i)
|
||||
ptTimer time i = set (particles . ix i . ptUpdate) $ ptTimer (time - 1) i
|
||||
ptTimer 0 i = over projectiles (IM.delete i)
|
||||
ptTimer time i = set (projectiles . ix i . ptUpdate) $ ptTimer (time - 1) i
|
||||
|
||||
Reference in New Issue
Block a user