Start projectile refactor
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
module Dodge.Projectile.Draw where
|
||||
import Dodge.Data
|
||||
import Geometry
|
||||
import Picture
|
||||
import Shape
|
||||
import ShapePicture
|
||||
|
||||
drawProjectile :: ProjectileDraw -> Prop -> SPic
|
||||
drawProjectile pd = case pd of
|
||||
DrawShell -> drawShell
|
||||
DrawRemoteShell -> drawRemoteShell
|
||||
|
||||
drawShell :: Prop -> SPic
|
||||
drawShell pj = noPic
|
||||
. translateSHz 18
|
||||
. uncurryV translateSHf (_prPos pj)
|
||||
$ rotateSH (argV $ _pjAcc pj) shellShape
|
||||
shellShape :: Shape
|
||||
shellShape = colorSH black $ upperPrismPoly 4 $ map toV2 [(-6,4),(-6,-4),(6,-4),(8,0),(6,4)]
|
||||
drawRemoteShell :: Prop -> SPic
|
||||
drawRemoteShell pj
|
||||
| rem (t+200) 20 < 9
|
||||
= doposition $ noPic shellShape
|
||||
| otherwise = doposition $ remoteShellShape col
|
||||
where
|
||||
col | t > (-99) = green
|
||||
| otherwise = red
|
||||
t = _pjTimer pj
|
||||
doposition = translateSPz 18 . uncurryV translateSPf (_prPos pj) . rotateSP (_pjDir pj)
|
||||
remoteShellShape :: Color -> SPic
|
||||
remoteShellShape col = (shellShape
|
||||
, setLayer BloomNoZWrite . setDepth 4.5 . color col $ circleSolid 3
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user