Simplify block drawing further, store shape of block

This commit is contained in:
2025-10-24 19:39:44 +01:00
parent ffea3a1694
commit 95b4105f52
9 changed files with 143 additions and 163 deletions
+4 -25
View File
@@ -1,5 +1,7 @@
module Dodge.Room.Tanks where
import Color
import Control.Monad
import Dodge.Base.CardinalPoint
import Dodge.Data.GenWorld
import Dodge.LevelGen.PlacementHelper
@@ -14,7 +16,6 @@ import Geometry
import LensHelp
import RandomHelp
import Shape
import Control.Monad
randomTank :: RandomGen g => State g Placement
randomTank =
@@ -37,18 +38,7 @@ randEdgeTank = do
return $
basetank
& plType . putBlock . blDraw
%~ ( \bd ->
BlockDraws
[ bd
, BlockDrawBlSh
( colorSH
orange
( verticalPipe 80
<> horPipe 80 0 (70 *.* cardVec edge)
)
)
]
)
<>~ colorSH orange (verticalPipe 80 <> horPipe 80 0 (70 *.* cardVec edge))
-- %~ fmap (<> noPic ( colorSH orange (verticalPipe 80
-- <> horPipe 80 0 (70 *.* cardVec edge))))
-- 70 is a guess, the true value depends on the distance to the wall
@@ -67,18 +57,7 @@ randEdgeTanks i = do
replicate i $
basetank
& plType . putBlock . blDraw
%~ ( \bd ->
BlockDraws
[ bd
, BlockDrawBlSh
( colorSH
orange
( verticalPipe 80
<> horPipe 80 0 (70 *.* cardVec edge)
)
)
]
)
<>~ colorSH orange (verticalPipe 80 <> horPipe 80 0 (70 *.* cardVec edge))
-- 70 is a guess, the true value depends on the distance to the wall
& plSpot
.~ rprBool