Refactor, try to limit dependencies

This commit is contained in:
2022-07-28 00:59:56 +01:00
parent 8aa5c17ab9
commit 160560af5f
418 changed files with 15104 additions and 13342 deletions
+19 -11
View File
@@ -1,5 +1,7 @@
module Dodge.Projectile.Draw where
import Dodge.Data
import Dodge.Data.Item.Use.Consumption.Ammo
import Dodge.Data.Projectile
import Geometry
import Picture
import Shape
@@ -11,25 +13,31 @@ drawProjectile prj = case _prjDraw prj of
DrawRemoteShell -> drawRemoteShell prj
DrawDrone -> drawShell prj
DrawBlankProjectile -> mempty
drawShell :: Proj -> SPic
drawShell pj = noPic
. translateSHz 18
. uncurryV translateSHf (_prjPos pj)
$ rotateSH (argV $ _prjAcc pj) shellShape
drawShell pj =
noPic
. translateSHz 18
. uncurryV translateSHf (_prjPos pj)
$ rotateSH (argV $ _prjAcc pj) shellShape
shellShape :: Shape
shellShape = colorSH black $ upperPrismPoly 4 $ map toV2 [(-6,4),(-6,-4),(6,-4),(8,0),(6,4)]
shellShape = colorSH black $ upperPrismPoly 4 $ map toV2 [(-6, 4), (-6, -4), (6, -4), (8, 0), (6, 4)]
drawRemoteShell :: Proj -> SPic
drawRemoteShell pj
| rem (t+200) 20 < 9
= doposition $ noPic shellShape
| rem (t + 200) 20 < 9 =
doposition $ noPic shellShape
| otherwise = doposition $ remoteShellShape col
where
col | t > (-99) = green
col
| t > (-99) = green
| otherwise = red
t = _prjTimer pj
doposition = translateSPz 18 . uncurryV translateSPf (_prjPos pj) . rotateSP (_prjDir pj)
remoteShellShape :: Color -> SPic
remoteShellShape col = (shellShape
remoteShellShape col =
( shellShape
, setLayer BloomNoZWrite . setDepth 4.5 . color col $ circleSolid 3
)