Generalise path generation for arbitrary rooms
This commit is contained in:
+16
-10
@@ -10,6 +10,7 @@ import Dodge.Room.Procedural
|
||||
import Dodge.Room.Placement
|
||||
import Dodge.Room.Link
|
||||
import Dodge.Room.Corridor
|
||||
import Dodge.Room.Path
|
||||
import Dodge.LevelGen.Data
|
||||
import Dodge.Creature
|
||||
import Dodge.Creature.State.Data
|
||||
@@ -24,16 +25,17 @@ import System.Random
|
||||
roomGlassOctogon
|
||||
:: Float -- ^ Size
|
||||
-> Room
|
||||
roomGlassOctogon x = defaultRoom
|
||||
{ _rmPolys = [rectNSWE x (-x) (-x) x
|
||||
,rectNSWE 0 (-(x + 40)) (-20) 20
|
||||
]
|
||||
, _rmLinks =
|
||||
[(V2 0 x,0)
|
||||
,(V2 0 (-(x+40)),pi)
|
||||
roomGlassOctogon x = createPathGrid $ defaultRoom
|
||||
--roomGlassOctogon x = defaultRoom
|
||||
{ _rmPolys =
|
||||
[rectNSWE x (-x) (-x) x
|
||||
,rectNSWE 0 (-(x + 40)) (-20) 20
|
||||
]
|
||||
, _rmLinks = lnks
|
||||
, _rmPath = linksAndPath lnks
|
||||
[ ( V2 0 x , V2 0 (-(x+40)))
|
||||
, ( V2 0 (-(x+40)), V2 0 x)
|
||||
]
|
||||
, _rmPath = [(V2 0 x,V2 0 (-(x+40)))
|
||||
,(V2 0 (-(x+40)),V2 0 x)]
|
||||
, _rmPS =
|
||||
[sPS (V2 fx fx) 0 putLamp
|
||||
,sPS (V2 (-fx) fx) 0 putLamp
|
||||
@@ -43,12 +45,16 @@ roomGlassOctogon x = defaultRoom
|
||||
,crystalLine (V2 x (x/2)) (V2 (x/2) x)
|
||||
,crystalLine (V2 (x/2) (-x)) (V2 x (negate (x/2)))
|
||||
,crystalLine (V2 (negate $ x/2) (-x)) (V2 (-x) (negate (x/2)))
|
||||
,blockLine (V2 (-40) (40-x)) (V2 40 (40-x))
|
||||
,blockLine (V2 (-40) (50-x)) (V2 40 (50-x))
|
||||
]
|
||||
, _rmBound = [rectNSWE x (-x) (-x) x]
|
||||
}
|
||||
where
|
||||
fx = 4 * x / 5
|
||||
lnks =
|
||||
[ (V2 0 x,0)
|
||||
, (V2 0 (-(x+40)),pi)
|
||||
]
|
||||
|
||||
bossRoom :: RandomGen g => Creature -> State g Room
|
||||
bossRoom cr = randomMediumRoom <&> rmPS %~ ( sPS (V2 0 100) (negate $ pi/2) (PutCrit cr) :)
|
||||
|
||||
Reference in New Issue
Block a user