Improve visuals

This commit is contained in:
jgk
2021-02-24 04:51:08 +01:00
parent 4db5fb44fe
commit 8a4169653f
2 changed files with 28 additions and 31 deletions
+13 -11
View File
@@ -595,28 +595,30 @@ mvGenBullet' w bt
wth = _btWidth' bt
t = _btTimer' bt
bulLine :: Color -> Float -> [Point2] -> Drawing
bulLine _ _ [] = blank
bulLine _ _ (x:[]) = blank
bulLine col width (a:b:[]) -- (a:b:[])
= onLayer HPtLayer $ pictures
bulLine c w = setLayer 2 . bulLinea c w
bulLinea :: Color -> Float -> [Point2] -> Picture
bulLinea _ _ [] = blank
bulLinea _ _ (x:[]) = blank
bulLinea col width (a:b:[]) -- (a:b:[])
= onLayer HPtLayer $ pictures $ reverse
[polygonCol $ zip (wedgeGeom width b a) $ [white,withAlpha 0 white,withAlpha 0 white]
,polygonCol $ zip (lineGeom (width+1.5) a b) $ [col,col,withAlpha 0 col,withAlpha 0 col]
]
bulLine col width (a:b:c:[]) -- (a:b:[])
= onLayer HPtLayer $ pictures
bulLinea col width (a:b:c:[]) -- (a:b:[])
= onLayer HPtLayer $ pictures $ reverse
[polygonCol $ zip (wedgeGeom width b a) $ repeat white
,polygonCol $ zip (wedgeGeom width b c) $ [white,white,withAlpha 0 white]
,polygonCol $ zip (lineGeom (width+1.5) a c) $ [col,col,withAlpha 0 col,withAlpha 0 col]
]
bulLine col width (a:b:_:c:[]) -- (a:b:[])
= onLayer HPtLayer $ pictures
bulLinea col width (a:b:_:c:[]) -- (a:b:[])
= onLayer HPtLayer $ pictures $ reverse
[polygonCol $ zip (wedgeGeom width b a) $ repeat white
,polygonCol $ zip (wedgeGeom width b c) $ [white,white,withAlpha 0 white]
,polygonCol $ zip (lineGeom (width+1.5) a c) $ [col,col,withAlpha 0 col,withAlpha 0 col]
]
bulLine col width (a:b:_:_:c:_) -- (a:b:[])
= onLayer HPtLayer $ pictures
bulLinea col width (a:b:_:_:c:_) -- (a:b:[])
= onLayer HPtLayer $ pictures $ reverse
[polygonCol $ zip (wedgeGeom width b a) $ repeat white
,polygonCol $ zip (wedgeGeom width b c) $ [white,white,withAlpha 0 white]
,polygonCol $ zip (lineGeom (width+1.5) a c) $ [col,col,withAlpha 0 col,withAlpha 0 col]