Make "tanks" into Blocks

This commit is contained in:
2022-06-18 23:28:17 +01:00
parent cc93fc83d7
commit bae0f7dcad
10 changed files with 38 additions and 19 deletions
+20 -4
View File
@@ -4,6 +4,7 @@ module Dodge.Placement.Instance.Tank
, roundTankCross
) where
import Dodge.Data
import Dodge.Default.Block
--import Dodge.Placement.PlaceSpot
import Dodge.LevelGen.Data
import Dodge.Room.Foreground
@@ -11,7 +12,9 @@ import Dodge.Default.Wall
--import Dodge.Placement.TopDecoration
import Geometry
import Shape
import ShapePicture
import Color
import LensHelp
--import Quaternion
tankSquareDec :: (Float -> Float -> Float -> Color -> Color -> Shape)
@@ -19,10 +22,23 @@ tankSquareDec :: (Float -> Float -> Float -> Color -> Color -> Shape)
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}
tankShape baseshape facade col col'
= sps0 $ PutBlock bl wl $ reverse baseshape
where
bl = defaultBlock
& blDraw .~ (\bl' -> (noPic $ uncurryV translateSHf (_blPos bl') $ rotateSH (_blRot bl') $ colorSH col (upperPrismPoly 31 $ reverse baseshape) <> facade col col'))
& blDeath .~ const id
wl = defaultWall
& wlDraw .~ False
& wlColor .~ col
& wlRotateTo .~ False
& wlOpacity .~ SeeAbove
& wlMaterial .~ Metal
-- = 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)
+1 -1
View File
@@ -2,7 +2,7 @@ module Dodge.Placement.Instance.Wall
where
import Dodge.Data
import Dodge.Default.Block
import Dodge.Block.Debris
--import Dodge.Block.Debris
import Dodge.LevelGen.Data
import Dodge.Default.Wall
--import Dodge.Wall.DamageEffect