Work on transparency of windows/clouds

This commit is contained in:
2025-11-20 12:02:05 +00:00
parent 10dbb238c8
commit 6563d87247
7 changed files with 49 additions and 37 deletions
+3 -13
View File
@@ -138,7 +138,7 @@ makeFragBullets p w = w & cWorld . lWorld . bullets .++~ bus
f a s =
defaultBullet
& buPayload .~ BulPlain 5
& buVel .~ s *.* unitVectorAtAngle a
& buVel .~ s *^ unitVectorAtAngle a
& buDrag .~ 0.8
& buPos .~ p
& buOldPos .~ p
@@ -151,20 +151,10 @@ makeFlak bu _ w = w & cWorld . lWorld . bullets .++~ [f x | x <- xs]
f x =
bu & buVel %~ g x
& buPayload .~ BulPlain 25
g x v = v +.+ x *.* normalizeV (vNormal v)
g x v = v + x *^ normalizeV (vNormal v)
hitEffFromBul :: World -> Bullet -> (World, Bullet)
hitEffFromBul w bu = hitEffFromBul' w' bu
where
w' = w & cWorld . lWorld . distortions .:~ x
x = RadialDistortion (_buPos bu + _buVel bu) (V2 50 0) (V2 0 50)
(v3 & _3 .~ t) (v3 & _3 .~ negate t) v3 1
v3 = V3 (V2 1 0) (V2 0 1) 0
t = vNormal (_buVel bu)
-- (V2 1 0) (V2
hitEffFromBul' :: World -> Bullet -> (World, Bullet)
hitEffFromBul' w bu = case _buEffect bu of
hitEffFromBul w bu = case _buEffect bu of
PenetrateBullet -> movePenBullet bu hitstream w
BounceBullet -> fromMaybe (expireAndDamage bu hitstream w) $ do
(hp, crwl) <- hitstream ^? _head