Continue work on bullet drawing
This commit is contained in:
@@ -240,20 +240,48 @@ makeSingleClipAt p it = case it ^? itUse . heldConsumption . laLoaded of
|
||||
makeTinClipAt :: Float -> Point3 -> Item -> Shape
|
||||
makeTinClipAt r p it =
|
||||
translateSH p . overPosSH (rotate3z r) $
|
||||
(upperPrismPoly 1 $
|
||||
colorSH midcol (upperPrismPoly 1 (
|
||||
reverse $
|
||||
rectNSWE 0 (- y) (-2) 2) <> tips
|
||||
rectNSWE 0 (- y) (-2) 2)) <> tips <> tails
|
||||
where
|
||||
midcol = maybe black bulletEffectColor
|
||||
(it ^? itUse . heldConsumption . laAmmoType . amBullet . buEffect)
|
||||
y = fromIntegral y' * 0.3
|
||||
y' = fromMaybe 0 $ it ^? itUse . heldConsumption . laLoaded
|
||||
tips = fromMaybe mempty $ do
|
||||
ebt <- it ^? itUse . heldConsumption . laAmmoType . amBullet . buSpawn . spawnEBT
|
||||
ebt <- it ^? itUse . heldConsumption . laAmmoType . amBullet . buSpawn
|
||||
return $ colorSH (bulletPayloadColor ebt) $ upperPrismPoly 1.1 $
|
||||
reverse $
|
||||
rectNSWE 0 (- y) (-2) (-1)
|
||||
tails = fromMaybe mempty $ do
|
||||
ebt <- it ^? itUse . heldConsumption . laAmmoType . amBullet . buTrajectory
|
||||
return $ colorSH (bulletTrajColor ebt) $ upperPrismPoly 1.1 $
|
||||
reverse $
|
||||
rectNSWE 0 (- y) 1 2
|
||||
|
||||
bulletPayloadColor :: EnergyBallType -> Color
|
||||
bulletPayloadColor ebt = case ebt of
|
||||
bulletEffectColor :: BulletEffect -> Color
|
||||
bulletEffectColor x = case x of
|
||||
DestroyBullet -> black
|
||||
BounceBullet -> mixColors 0.5 0.5 black yellow
|
||||
PenetrateBullet -> mixColors 0.5 0.5 black blue
|
||||
|
||||
bulletTrajColor :: BulletTrajectory -> Color
|
||||
bulletTrajColor x = case x of
|
||||
BasicBulletTrajectory -> black
|
||||
BezierTrajectory {} -> chartreuse
|
||||
FlechetteTrajectory {} -> white
|
||||
MagnetTrajectory {} -> yellow
|
||||
|
||||
bulletPayloadColor :: BulletSpawn -> Color
|
||||
bulletPayloadColor x = case x of
|
||||
BulBall y -> energyBallColor y
|
||||
BulSpark -> black
|
||||
BulFlak -> chartreuse
|
||||
BulFrag -> magenta
|
||||
BulGas -> green
|
||||
|
||||
energyBallColor :: EnergyBallType -> Color
|
||||
energyBallColor ebt = case ebt of
|
||||
IncBall -> orange
|
||||
TeslaBall -> cyan
|
||||
ConcBall -> white
|
||||
|
||||
Reference in New Issue
Block a user