48 lines
1.7 KiB
Haskell
48 lines
1.7 KiB
Haskell
module Dodge.Placement.Instance.Tank
|
|
( tankSquareDec
|
|
, roundTank
|
|
, roundTankCross
|
|
) where
|
|
import Dodge.Data
|
|
import Dodge.LevelGen.Data
|
|
import Dodge.Room.Foreground
|
|
import Dodge.Placement.Instance.Block
|
|
import Geometry
|
|
import Shape
|
|
import Color
|
|
--import LensHelp
|
|
--import Quaternion
|
|
|
|
tankSquareDec :: (Float -> Float -> Float -> Color -> Color -> Shape)
|
|
-> Color -> Color -> Placement
|
|
tankSquareDec dec = tankShape (square 20) (dec 20 20 31)
|
|
|
|
tankShape :: [Point2] -> (Color -> Color -> Shape) -> Color -> Color -> Placement
|
|
tankShape baseshape facade col col' = sps0 $ decoratedBlock (const $ facade col col') Metal col 31 baseshape
|
|
-- = sps0 $ PutBlock bl wl $ reverse baseshape
|
|
-- where
|
|
-- bl = defaultBlock
|
|
-- & blDraw .~ const (noPic $ colorSH col (upperPrismPoly 31 $ reverse baseshape) <> facade col col')
|
|
-- & blDeath .~ const id
|
|
-- wl = defaultWall
|
|
-- & wlColor .~ col
|
|
-- & wlRotateTo .~ False
|
|
-- & wlOpacity .~ SeeAbove
|
|
-- & wlMaterial .~ Metal
|
|
|
|
-- = ps0jPushPS
|
|
-- (PutShape $ colorSH col (upperPrismPoly 31 baseshape) <> facade col col')
|
|
-- $ sps0 $ PutWall baseshape defaultWall
|
|
-- {_wlUnshadowed = False, _wlColor = col, _wlRotateTo = False, _wlOpacity = SeeAbove}
|
|
|
|
roundTank :: Color -> Color -> Placement
|
|
roundTank = tankShape (polyCirc 4 20)
|
|
$ \_ c' -> colorSH c' $ foldMap toprail (take 8 [0,pi/4..])
|
|
where
|
|
toprail a = rotateSH a $ thinHighBar 31 (V2 0 20) (rotateV (pi/4) $ V2 0 20)
|
|
|
|
roundTankCross :: Color -> Color -> Placement
|
|
roundTankCross = tankShape (polyCirc 4 20)
|
|
$ \_ c -> colorSH c $ thinHighBar 31 (V2 20 0) (V2 (-20) 0)
|
|
<> thinHighBar 31 (V2 0 20) (V2 0 (-20))
|