Make more sounds positional

This commit is contained in:
2021-04-23 17:27:32 +02:00
parent ffe4a8083b
commit 4c611ba4aa
4 changed files with 75 additions and 63 deletions
+25 -32
View File
@@ -563,8 +563,8 @@ shootersRoom1 = do
x4 <- state $ randomR (60,w-60)
y4 <- state $ randomR (40,180)
p <- takeOne [(x1,y1-10),(x2,y2-10),(x3,y3-10)]
let bln x y = putBlockN (x+25) (x-25) (y+10) (y)
let blv x y = putBlockV (x+25) (x-25) (y+10) (y)
let bln x y = putBlockN (x+25) (x-25) (y+10) y
let blv x y = putBlockV (x+25) (x-25) (y+10) y
let plmnts = bln x1 y1 ++ bln x2 y2 ++ bln x3 y3 ++ blv x4 y4
++ [PS p (-pi/2) $ PutCrit autoCrit
,PS (w/2,200) 0 putLamp
@@ -582,8 +582,8 @@ shootersRoom = do
y3 <- iterateWhile (\y' -> abs (y1 - y2) < 60 && abs (y2 - y') < 60) $ state $ randomR (250,560)
x4 <- state $ randomR (60,w-60)
y4 <- state $ randomR (40,180)
let bln x y = putBlockN (x+25) (x-25) (y+10) (y)
let blv x y = putBlockV (x+25) (x-25) (y+10) (y)
let bln x y = putBlockN (x+25) (x-25) (y+10) y
let blv x y = putBlockV (x+25) (x-25) (y+10) y
let plmnts = bln x1 y1 ++ bln x2 y2 ++ bln x3 y3 ++ blv x4 y4
++ [PS (x1,y1-10) (-pi/2) $ PutCrit autoCrit
,PS (x2,y2-10) (-pi/2) $ PutCrit autoCrit
@@ -602,7 +602,7 @@ pistolerRoom = do
f <- takeOne [f2]
h <- state $ randomR (400,800)
let w = h
i <- takeOne [4,6,8]
i <- takeOne [3,4,5]
let j = fromIntegral (i+1)
-- the 20+etc here is to correct for the pathfinding grid, which matches up to
-- edges based on the size of doors (i.e. the line next to the wall is 20
@@ -617,22 +617,15 @@ pistolerRoom = do
let plmnts = [PS (ps !! 0) aa $ PutCrit pistolCrit
,PS (ps !! 1) ab $ PutCrit pistolCrit
,PS (ps !! 2) ac $ PutCrit pistolCrit
-- ,PS (w-5,h/2) 0 $ putLamp
-- ,PS (5,h/2) 0 $ putLamp
-- ,PS (w/2,h-5) 0 $ putLamp
-- ,PS (w/2,5) 0 $ putLamp
-- ,PS (w-50,h/2) 0 $ putLamp
-- ,PS (50,h/2) 0 $ putLamp
,PS (w/2,h-50) 0 $ putLamp
,PS (w/2,50) 0 $ putLamp
,PS (w-5,h-5) 0 $ putLamp
,PS (5,h-5) 0 $ putLamp
,PS (w-5,5) 0 $ putLamp
,PS (5,5) 0 $ putLamp
,PS (w/2,h/2) 0 $ putLamp
,PS (w/2,h-50) 0 putLamp
,PS (w/2,50) 0 putLamp
,PS (w-5,h-5) 0 putLamp
,PS (5,h-5) 0 putLamp
,PS (w-5,5) 0 putLamp
,PS (5,5) 0 putLamp
,PS (w/2,h/2) 0 putLamp
]
++
-- f (w*0.25) (h*0.5)
concat [f x y | x<-xs,y<-ys]
return
$ set rmPS plmnts $ roomRect' w h (max i 2) (max i 2)
@@ -654,16 +647,16 @@ shootingRange = do
spawnerRoom :: RandomGen g => State g (Tree (Either Room Room))
spawnerRoom = do
x <- state $ randomR (250,300)
y <- state $ randomR (300,400)
wl <- takeOne [PS (0,0) 0 $ PutWindow (rectNSWE (y-60) 0 (x/2-10) (x/2+10))
$ withAlpha 0.5 aquamarine
,windowLine (x/2,0) (x/2,y-60)
]
let plmnts = [PS (x/4, y/4) (pi/2) $ PutCrit spawnerCrit
,wl
,PS (x/2, y-10) 0 putLamp
]
let f ((lx,_),_) = lx < x/2-5
roomWithSpawner <- (fmap connectRoom . randomiseOutLinks) =<< (filterLinks f $ set rmPS plmnts $ roomRect' x y 2 2)
return $ treeTrunk [Left (airlock 0)] roomWithSpawner
x <- state $ randomR (250,300)
y <- state $ randomR (300,400)
wl <- takeOne [PS (0,0) 0 $ PutWindow (rectNSWE (y-60) 0 (x/2-10) (x/2+10))
$ withAlpha 0.5 aquamarine
,windowLine (x/2,0) (x/2,y-60)
]
let plmnts = [PS (x/4, y/4) (pi/2) $ PutCrit spawnerCrit
,wl
,PS (x/2, y-10) 0 putLamp
]
let f ((lx,_),_) = lx < x/2-5
roomWithSpawner <- (fmap connectRoom . randomiseOutLinks) =<< filterLinks f (set rmPS plmnts $ roomRect' x y 2 2)
return $ treeTrunk [Left (airlock 0)] roomWithSpawner