Start making projectile update function rather than folded list
This commit is contained in:
@@ -26,10 +26,10 @@ updateProjectile pj w = foldl' (flip $ upProjectile pj) w (_pjUpdates pj)
|
||||
|
||||
upProjectile :: Projectile -> ProjectileUpdate -> World -> World
|
||||
upProjectile pj pu = case pu of
|
||||
CollisionEffectPU mdetonatorid mscreenid ->
|
||||
CollisionEffectPU ->
|
||||
shellCollisionCheck
|
||||
mdetonatorid
|
||||
mscreenid
|
||||
(pj ^. pjDetonatorID)
|
||||
(pj ^. pjScreenID)
|
||||
pj
|
||||
TimePU -> decTimMvVel pj
|
||||
ThrustPU st et
|
||||
@@ -79,7 +79,7 @@ applyGravityPU pj w
|
||||
| otherwise = x * 0.9
|
||||
newz = pj ^. pjZ + pj ^. pjZVel
|
||||
|
||||
--shellCollisionCheck :: (Projectile -> World -> World) -> Projectile -> World -> World
|
||||
-- consider using thingHit, pushing any hit creature back
|
||||
shellCollisionCheck ::
|
||||
Maybe (NewInt ItmInt) ->
|
||||
Maybe (NewInt ItmInt) ->
|
||||
@@ -174,12 +174,9 @@ decTimMvVel :: Projectile -> World -> World
|
||||
decTimMvVel pj =
|
||||
cWorld . lWorld . projectiles . ix (_pjID pj)
|
||||
%~ ( (pjTimer -~ 1)
|
||||
. (pjPos %~ (+.+ vel))
|
||||
. (pjDir +~ rot)
|
||||
. (pjPos +~ _pjVel pj)
|
||||
. (pjDir +~ _pjSpin pj)
|
||||
)
|
||||
where
|
||||
rot = _pjSpin pj
|
||||
vel = _pjVel pj
|
||||
|
||||
explodeShell ::
|
||||
Maybe (NewInt ItmInt) ->
|
||||
|
||||
Reference in New Issue
Block a user