37 lines
1.3 KiB
Haskell
37 lines
1.3 KiB
Haskell
module Dodge.Placement.Instance.Tank
|
|
( tankSquareDec
|
|
, roundTank
|
|
, roundTankCross
|
|
) where
|
|
import Dodge.Data
|
|
--import Dodge.Placement.PlaceSpot
|
|
import Dodge.LevelGen.Data
|
|
import Dodge.Room.Foreground
|
|
import Dodge.Default.Wall
|
|
--import Dodge.Placement.TopDecoration
|
|
import Geometry
|
|
import Shape
|
|
import Color
|
|
--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' = ps0jPushPS
|
|
(PutShape $ colorSH col (upperPrismPoly 31 baseshape) <> facade col col')
|
|
$ sps0 $ PutWall baseshape defaultWall
|
|
{_wlDraw = 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))
|