Initial implementation of bezier bullet

This commit is contained in:
2021-03-15 13:11:01 +01:00
parent 5ce9b4487b
commit a5e0dc65da
6 changed files with 43 additions and 349 deletions
+4 -7
View File
@@ -1425,14 +1425,11 @@ bezierControl targetp cid w = resetGun $ shootWithSound 0 (mkBezierBul startp co
resetGun = set (creatures . ix cid . crInv . ix j . wpFire) $ bezierTarget
mkBezierBul :: Point2 -> Point2 -> Point2 -> Int -> World -> World
mkBezierBul startp controlp targetp cid w = over particles' (bbul 30 :) w
mkBezierBul startp controlp targetp cid w = over particles' (bbul :) w
where
bbul i = Particle'
{_ptPict' = onLayerL [levLayer PtLayer ] $ bezierQuad white white 5 5 startp controlp targetp
,_ptUpdate' = \w p -> case i of 0 -> (w, Nothing)
n -> (w, Just $ bbul (i-1))
}
bbul = aCurveBulAt (Just cid) white startp controlp targetp
(threeEff' bulHitCr' bulHitWall' bulHitFF') 5
fireRemoteLauncher :: Int -> World -> World
fireRemoteLauncher cid w = setLocation $ resetFire $ resetName
$ soundOnce (fromIntegral launcherSound)