Commit mid block refactor

This commit is contained in:
2022-06-18 11:07:17 +01:00
parent a1c7abedaf
commit 781e337cad
10 changed files with 78 additions and 64 deletions
+8 -6
View File
@@ -1,6 +1,8 @@
module Dodge.Placement.Instance.Wall
where
import Dodge.Data
import Dodge.Default.Block
import Dodge.Block.Debris
import Dodge.LevelGen.Data
import Dodge.Default.Wall
--import Dodge.Wall.DamageEffect
@@ -56,7 +58,7 @@ midWall ps = ps0j (PutShape . colorSH col $ upperPrismPoly 50 ps)
singleBlock :: Point2 -> [Placement]
singleBlock a =
[sPS a 0
$ PutBlock StoneBlock 100 baseBlockPane
$ PutBlock defaultBlock baseBlockPane
$ reverse
$ square 10
]
@@ -65,20 +67,20 @@ Places a line of blocks between two points.
Width 9, also extends out from each point by 9.
-}
blockLine :: Point2 -> Point2 -> Placement
blockLine a b = sps0 $ PutLineBlock baseBlockPane StoneBlock 9 9 a b
blockLine a b = sps0 $ PutLineBlock baseBlockPane 9 9 a b
{-
Places an breakable window between two points.
Width 8, also extends out from each point by 8.
-}
windowLine :: Point2 -> Point2 -> Placement
windowLine a b = sps0 $ PutLineBlock defaultWindow GlassBlock 8 8 a b
windowLine a b = sps0 $ PutLineBlock defaultWindow 8 8 a b
{-
Places an unbreakable window between two points.
Width 7, also extends out from each point by 7.
-}
crystalLine :: Point2 -> Point2 -> Placement
crystalLine a b = sps0 $ PutLineBlock defaultCrystalWall CrystalBlock 7 7 a b
crystalLine a b = sps0 $ PutLineBlock defaultCrystalWall 7 7 a b
--crystalLine a b = sps0 $ PutWall ps defaultCrystalWall
-- where
-- ps =
@@ -104,7 +106,7 @@ wallLine a b = sps0 $ PutWall ps defaultWall
up = vNormal left
windowLineType :: Point2 -> Point2 -> PSType
windowLineType = PutLineBlock defaultWindow GlassBlock 8 8
windowLineType = PutLineBlock defaultWindow 8 8
baseBlockPane :: Wall
baseBlockPane = defaultWall
@@ -151,7 +153,7 @@ putBlockRect' w h = ps0jPushPS (aline tl tr)
tr = V2 w h
br = V2 w (-h)
bl = V2 (-w) (-h)
aline = PutLineBlock baseBlockPane StoneBlock 9 9
aline = PutLineBlock baseBlockPane 9 9
putBlockRect :: Float -> Float -> Float -> Float -> [Placement]
putBlockRect a x b y =