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
+15 -20
View File
@@ -1020,7 +1020,7 @@ moveFlame rotd w pt =
((:) $ Flaming (div time 10) sp p ep) ((:) $ Flaming (div time 10) sp p ep)
hiteff = _btHitEffect' pt pt hiteff = _btHitEffect' pt pt
thepic p' = pictures $ reverse [ pic p' , piu p' , pi2 p' , glow p' ] thepic p' = pictures $ reverse [ pic p' , piu p' , pi2 p' , glow p' ]
pic p' = onLayerL [levLayer UPtLayer,6] $ uncurry translate (prot3 p') pic p' = setLayer 2 $ onLayerL [levLayer UPtLayer,6] $ uncurry translate (prot3 p')
$ rotate (pi * 0.5 + argV rotd) $ rotate (pi * 0.5 + argV rotd)
$ scale scaleChange 1 $ scale scaleChange 1
-- $ color white -- $ color white
@@ -1030,7 +1030,7 @@ moveFlame rotd w pt =
] ]
-- $ rotate (radToDeg (fromIntegral time * 10)) -- $ rotate (radToDeg (fromIntegral time * 10))
-- $ polygon [(-5,-2),(5,-2),(5,2),(-5,2)] -- $ polygon [(-5,-2),(5,-2),(5,2),(-5,2)]
pi2 p' = onLayerL [levLayer UPtLayer,4] $ uncurry translate (prot p') pi2 p' = setLayer 2 $ onLayerL [levLayer UPtLayer,4] $ uncurry translate (prot p')
-- $ rotate ( (fromIntegral time * 5)) -- $ rotate ( (fromIntegral time * 5))
$ rotate (pi * 0.5 + argV rotd) $ rotate (pi * 0.5 + argV rotd)
-- $ color (mixColors 0.5 0.5 orange white) -- $ color (mixColors 0.5 0.5 orange white)
@@ -1658,7 +1658,7 @@ moveLaser phaseV pos dir mcid w pt
Just (p,E3x2 wl) -> createSpark 8 colID (p +.+ safeNormalizeV (sp -.- p)) Just (p,E3x2 wl) -> createSpark 8 colID (p +.+ safeNormalizeV (sp -.- p))
(reflectDir wl) Nothing (reflectDir wl) Nothing
_ -> id _ -> id
pic = pictures [ fadeLine sp (head ps) 0.5 40 yellow pic = pictures [ fadeLine sp (head ps) 0.2 40 yellow
, setLayer 2 $ color (withAlpha 0.9 white) $ vThickLine (sp:ps) , setLayer 2 $ color (withAlpha 0.9 white) $ vThickLine (sp:ps)
, setLayer 2 $ color (withAlpha 0.5 yellow) $ vvThickLine (sp:ps) , setLayer 2 $ color (withAlpha 0.5 yellow) $ vvThickLine (sp:ps)
] ]
@@ -1681,22 +1681,17 @@ moveLaser phaseV pos dir mcid w pt
-- op = lp +.+ 50 *.* normalizeV (lp -.- lp') -- op = lp +.+ 50 *.* normalizeV (lp -.- lp')
fadeLine :: Point2 -> Point2 -> Float -> Float -> Color -> Picture fadeLine :: Point2 -> Point2 -> Float -> Float -> Color -> Picture
fadeLine sp ep alph width col = setLayer 2 $ color yellow $ fadeLine sp ep alph width col = setLayer 2 $
polygon [sp +.+ n polygonCol [(sp , ca)
,sp ,(sp +.+ n , cb)
,sp -.- n ,(ep +.+ n , cb)
,ep -.- n ,(ep , ca)
,ep ,(ep -.- n , cb)
,ep +.+ n ,(sp -.- n , cb)
] ]
-- polygonCol [(sp +.+ n, col) where n = width *.* (normalizeV $ vNormal $ ep -.- sp)
-- ,(sp , col) ca = withAlpha alph col
-- ,(sp -.- n, col) cb = withAlpha 0 col
-- ,(ep -.- n, col)
-- ,(ep , col)
-- ,(ep +.+ n, withAlpha 0 col)
-- ]
where n = width *.* (normalizeV $ normV $ ep -.- sp)
-- pictures [color (withAlpha (0.8 * alph) col) $ lineOfThickness width [sp,p 0.25] -- pictures [color (withAlpha (0.8 * alph) col) $ lineOfThickness width [sp,p 0.25]
-- ,color (withAlpha (0.6 * alph) col) $ lineOfThickness width [p 0.25,p 0.5] -- ,color (withAlpha (0.6 * alph) col) $ lineOfThickness width [p 0.25,p 0.5]
-- ,color (withAlpha (0.4 * alph) col) $ lineOfThickness width [p 0.5,p 0.75] -- ,color (withAlpha (0.4 * alph) col) $ lineOfThickness width [p 0.5,p 0.75]
@@ -2076,7 +2071,7 @@ moveTeslaArc p d i w =
$ set randGen g $ set randGen g
$ createSpark 8 nc q2 (argV sv + d1) Nothing $ createSpark 8 nc q2 (argV sv + d1) Nothing
$ foldr damCrs w hitCrs $ foldr damCrs w hitCrs
where pic = pictures where pic = setLayer 2 $ pictures
[ onLayer PtLayer $ color (f2 nc) $ line ps' [ onLayer PtLayer $ color (f2 nc) $ line ps'
, onLayer UPtLayer $ color (withAlpha 0.02 cyan) $ lineOfThickness 20 ps' , onLayer UPtLayer $ color (withAlpha 0.02 cyan) $ lineOfThickness 20 ps'
, onLayer UPtLayer $ color (withAlpha 0.02 cyan) $ lineOfThickness 25 ps' , onLayer UPtLayer $ color (withAlpha 0.02 cyan) $ lineOfThickness 25 ps'
+13 -11
View File
@@ -595,28 +595,30 @@ mvGenBullet' w bt
wth = _btWidth' bt wth = _btWidth' bt
t = _btTimer' bt t = _btTimer' bt
bulLine :: Color -> Float -> [Point2] -> Drawing bulLine c w = setLayer 2 . bulLinea c w
bulLine _ _ [] = blank
bulLine _ _ (x:[]) = blank bulLinea :: Color -> Float -> [Point2] -> Picture
bulLine col width (a:b:[]) -- (a:b:[]) bulLinea _ _ [] = blank
= onLayer HPtLayer $ pictures 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 (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] ,polygonCol $ zip (lineGeom (width+1.5) a b) $ [col,col,withAlpha 0 col,withAlpha 0 col]
] ]
bulLine col width (a:b:c:[]) -- (a:b:[]) bulLinea col width (a:b:c:[]) -- (a:b:[])
= onLayer HPtLayer $ pictures = onLayer HPtLayer $ pictures $ reverse
[polygonCol $ zip (wedgeGeom width b a) $ repeat white [polygonCol $ zip (wedgeGeom width b a) $ repeat white
,polygonCol $ zip (wedgeGeom width b c) $ [white,white,withAlpha 0 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] ,polygonCol $ zip (lineGeom (width+1.5) a c) $ [col,col,withAlpha 0 col,withAlpha 0 col]
] ]
bulLine col width (a:b:_:c:[]) -- (a:b:[]) bulLinea col width (a:b:_:c:[]) -- (a:b:[])
= onLayer HPtLayer $ pictures = onLayer HPtLayer $ pictures $ reverse
[polygonCol $ zip (wedgeGeom width b a) $ repeat white [polygonCol $ zip (wedgeGeom width b a) $ repeat white
,polygonCol $ zip (wedgeGeom width b c) $ [white,white,withAlpha 0 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] ,polygonCol $ zip (lineGeom (width+1.5) a c) $ [col,col,withAlpha 0 col,withAlpha 0 col]
] ]
bulLine col width (a:b:_:_:c:_) -- (a:b:[]) bulLinea col width (a:b:_:_:c:_) -- (a:b:[])
= onLayer HPtLayer $ pictures = onLayer HPtLayer $ pictures $ reverse
[polygonCol $ zip (wedgeGeom width b a) $ repeat white [polygonCol $ zip (wedgeGeom width b a) $ repeat white
,polygonCol $ zip (wedgeGeom width b c) $ [white,white,withAlpha 0 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] ,polygonCol $ zip (lineGeom (width+1.5) a c) $ [col,col,withAlpha 0 col,withAlpha 0 col]