Cleanup rocket movement code

This commit is contained in:
jgk
2021-03-24 00:10:18 +01:00
parent 1a91d29896
commit 746f905ba1
+3 -19
View File
@@ -788,16 +788,8 @@ moveShell time i cid rot accel w
Just cr -> min 0.1 $ max (-0.1)
$ (normalizeAnglePi (dir - _crDir cr)) / 20
_ -> 0
(v1:v2:v3:_) = fst $ runState ((sequence . repeat . randInCirc) 0.1) $ _randGen w
(r1:r2:r3:_) = map ((*.*) 100) (v2:v3:v1:[])
-- ((r1:r2:r3:_),_) = runState ((sequence . repeat . randInCirc) 10) $ _randGen w
-- v1 = fst $ runState (randInCirc 0.5) $ _randGen w
r1 = _randGen w & evalState (randInCirc 10)
smokeGen = makeSmokeCloud (oldPos +.+ r1 +.+ 30 *.* (normalizeV (oldPos -.- newPos)))
-- (t1:t2:t3:_) = randomRs ( 15,20) $ _randGen w
-- (s1:s2:s3:_) = map (\s -> fromIntegral s * 0.1 - 1) (t3:t2:t1:[])
-- smokeGen = makeSmokeAt'' v1 s1 t1 (newPos +.+ r1)
-- . makeSmokeAt'' v2 s2 t2 (newPos +.+ r2)
-- -- . makeSmokeAt'' v3 s3 t3 (newPos +.+ r3)
normalizeAnglePi angle | normalizeAngle angle > pi = normalizeAngle angle - 2*pi
@@ -1540,16 +1532,8 @@ moveRemoteShell time i cid itid dir w
hitWl = fmap fst $ collideCircWalls' oldPos newPos 2 $ wallsNearPoint newPos w
thingHit = hitCr <|> hitWl
(v1:v2:v3:_) = fst $ runState ((sequence . repeat . randInCirc) 0.1) $ _randGen w
(r1:r2:r3:_) = map ((*.*) 100) (v2:v3:v1:[])
(t1:t2:t3:_) = randomRs ( 15,20) $ _randGen w
(s1:s2:s3:_) = map (\s -> fromIntegral s * 0.1 - 1) (t3:t2:t1:[])
-- ((r1:r2:r3:_),_) = runState ((sequence . repeat . randInCirc) 10) $ _randGen w
-- v1 = fst $ runState (randInCirc 0.5) $ _randGen w
smokeGen = makeSmokeAt'' v2 s2 t2 (newPos +.+ r2)
. makeSmokeAt'' v1 s1 t1 (newPos +.+ r1)
-- . makeSmokeAt'' v3 s3 t3 (newPos +.+ r3)
r1 = _randGen w & evalState (randInCirc 10)
smokeGen = makeSmokeCloud (oldPos +.+ r1 +.+ 30 *.* (normalizeV (oldPos -.- newPos)))
doExplosion = explodeRemoteRocket itid i cid
setScope w' = case _itemPositions w' IM.! itid of
InInv cid invid