Simplify tank decorations
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
module Dodge.Placement.Instance.Block where
|
||||
module Dodge.Placement.Instance.Block (
|
||||
decoratedBlock,
|
||||
lowBlock,
|
||||
) where
|
||||
|
||||
import Shape
|
||||
import Color
|
||||
import Dodge.Data.GenWorld
|
||||
import Dodge.Default.Block
|
||||
import Dodge.Default.Wall
|
||||
import Geometry
|
||||
import LensHelp
|
||||
import Shape
|
||||
|
||||
decoratedBlock :: Shape -> Material -> Color -> Float -> [Point2] -> PSType
|
||||
decoratedBlock decf mat col h ps = PutBlock bl wl $ reverse ps
|
||||
|
||||
@@ -13,24 +13,25 @@ import Geometry
|
||||
import Shape
|
||||
|
||||
tankSquareDec ::
|
||||
(Float -> Float -> Float -> Color -> Color -> Shape) ->
|
||||
(Float -> Float -> Float -> Color -> Shape) ->
|
||||
Color ->
|
||||
Color ->
|
||||
Placement
|
||||
tankSquareDec dec = tankShape (reverse . orderPolygon $ square 20) (dec 20 20 31)
|
||||
--tankSquareDec dec = tankShape (reverse . orderPolygon $ square 20) (dec 20 20 31)
|
||||
tankSquareDec dec = tankShape (orderPolygon $ square 20) (dec 20 20 31)
|
||||
|
||||
tankShape :: [Point2] -> (Color -> Color -> Shape) -> Color -> Color -> Placement
|
||||
tankShape baseshape facade col col' = sps0 $ decoratedBlock (facade col col') Metal col 31 baseshape
|
||||
tankShape :: [Point2] -> (Color -> Shape) -> Color -> Color -> Placement
|
||||
tankShape baseshape facade col col' = sps0 $ decoratedBlock (facade col') Metal col 31 baseshape
|
||||
|
||||
roundTank :: Color -> Color -> Placement
|
||||
roundTank = tankShape (polyCirc 4 20) $
|
||||
\_ c' -> colorSH c' $ foldMap toprail (take 8 [0, pi / 4 ..])
|
||||
\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 ->
|
||||
\c ->
|
||||
colorSH c $
|
||||
thinHighBar 31 (V2 20 0) (V2 (-20) 0)
|
||||
<> thinHighBar 31 (V2 0 20) (V2 0 (-20))
|
||||
|
||||
Reference in New Issue
Block a user