Tweak block sounds

This commit is contained in:
2021-11-18 03:50:54 +00:00
parent 94552ff658
commit 147d6098ab
12 changed files with 114 additions and 89 deletions
+9 -9
View File
@@ -1,6 +1,7 @@
{- Connecting rooms designed with a pass-through technique in mind. -}
module Dodge.Room.RoadBlock
where
import Dodge.Data
import Geometry
import Dodge.Default.Room
import Dodge.LevelGen.Data
@@ -56,8 +57,7 @@ longBlockedCorridor :: RandomGen g => State g (Tree (Either Room Room))
longBlockedCorridor = do
r <- state $ randomR (0,pi)
n <- state $ randomR (0,3)
let plmnts = [sPS (V2 20 40) r $ PutBlock [5,5,5] (V4 (150/256) (75/256) 0 (250/256))
$ reverse $ rectNSWE 10 (-10) (-10) 10
let plmnts = [sPS (V2 20 40) r $ dirtPoly $ square 10
,sPS (V2 20 15) 0 putLamp
]
sequence $ treeFromPost (replicate n $ Left <$> randomiseOutLinks corridor)
@@ -68,24 +68,24 @@ blockedCorridor :: RandomGen g => State g (Tree (Either Room Room))
blockedCorridor = do
r <- state $ randomR (0,pi)
let plmnts =
[sPS (V2 20 40) r $ PutBlock [5,5,5] (V4 (150/256) ( 75/256) 0 ( 250/256))
$ reverse $ rectNSWE 10 (-10) (-10) 10
[sPS (V2 20 40) r $ dirtPoly $ square 10
,spanLightI (V2 0 15) (V2 40 15)
]
sequence $ treeFromPost [] $ return $ Right $ set rmPmnts plmnts corridor
dirtPoly :: [Point2] -> PSType
dirtPoly = PutBlock DirtBlock [1] (V4 (150/256) ( 75/256) 0 ( 250/256)) . reverse
-- | A single corridor with a destructible block blocking it.
blockedCorridor' :: RandomGen g => State g Room
blockedCorridor' = do
r <- state $ randomR (0,pi)
theblocks <- takeOne [ [sPS (V2 20 40) r $ PutBlock [1] thecol $ reverse $ square 10]
, [ sPS (V2 5 40) r $ PutBlock [1] thecol $ reverse $ square 10
, sPS (V2 35 40) (r+0.5) $ PutBlock [1] thecol $ reverse $ square 10
theblocks <- takeOne [ [sPS (V2 20 40) r $ dirtPoly $ reverse $ square 10]
, [ sPS (V2 5 40) r $ dirtPoly $ square 10
, sPS (V2 35 40) (r+0.5) $ dirtPoly $ square 10
]
]
return $ corridor & rmPmnts .~ theblocks
where
thecol = V4 (150/256) ( 75/256) 0 ( 250/256)
lasTunnel :: Room
lasTunnel = defaultRoom
+2 -1
View File
@@ -1,4 +1,5 @@
module Dodge.Room.Room where
import Dodge.Data
import Dodge.Default.Room
import Dodge.Item.Weapon.BulletGuns
import Dodge.Item.Weapon.Launcher
@@ -146,7 +147,7 @@ miniRoom3 = do
w <- state $ randomR (300,400)
h <- state $ randomR (300,400)
let cp = V2 0 (h/2+40)
let b = PutBlock [5,20,20] (greyN 0.5) $ map toV2 [(-10,-60)
let b = PutBlock StoneBlock [5,20,20] (greyN 0.5) $ map toV2 [(-10,-60)
,( 10,-60)
,( 10,-80)
,(-10,-80)
+1 -2
View File
@@ -75,5 +75,4 @@ runPastRoom = do
critrooms :: [Tree (Either Room Room)]
critrooms = treeFromPost [Left switchdoor] (Left critroom) :
replicate (n-2) (treeFromPost [Left switchdoor] (Left linkcor))
return $ treeFromTrunk [Left door]
$ Node (Left cenroom) (controom : critrooms ++ [return $ Left aswitchroom])
return $ Node (Left cenroom) (controom : critrooms ++ [return $ Left aswitchroom])
+5 -5
View File
@@ -29,11 +29,11 @@ import System.Random
startRoom :: RandomGen g => State g (Tree (Either Room Room))
startRoom = join $ takeOne
[ -- rezBoxesWp
-- , rezBoxesThenWeaponRoom
-- , rezBoxThenWeaponRoom
-- , rezBoxesWpCrit
runPastStart
[ rezBoxesWp
, rezBoxesThenWeaponRoom
, rezBoxThenWeaponRoom
, rezBoxesWpCrit
, runPastStart
]
runPastStart :: RandomGen g => State g (Tree (Either Room Room))