Temporary de-randomisation of random seed
This commit is contained in:
+34
-34
@@ -36,41 +36,41 @@ lev1 = do
|
|||||||
++ [return $ connectRoom corridor
|
++ [return $ connectRoom corridor
|
||||||
,return $ connectRoom door
|
,return $ connectRoom door
|
||||||
,glassSwitchBack >>= randomiseLinks]
|
,glassSwitchBack >>= randomiseLinks]
|
||||||
++ [return $ connectRoom corridor
|
-- ++ [return $ connectRoom corridor
|
||||||
,return $ connectRoom door]
|
-- ,return $ connectRoom door]
|
||||||
++ [miniRoom3]
|
-- ++ [miniRoom3]
|
||||||
++ [return $ connectRoom corridor
|
-- ++ [return $ connectRoom corridor
|
||||||
,return $ connectRoom door]
|
-- ,return $ connectRoom door]
|
||||||
++ [roomCCrits]
|
-- ++ [roomCCrits]
|
||||||
++ [return $ connectRoom corridor
|
-- ++ [return $ connectRoom corridor
|
||||||
,return $ connectRoom door]
|
-- ,return $ connectRoom door]
|
||||||
++[roomMiniIntro]
|
-- ++[roomMiniIntro]
|
||||||
++ [longRoom >>= randomiseLinks]
|
-- ++ [longRoom >>= randomiseLinks]
|
||||||
++ [return $ connectRoom corridor
|
-- ++ [return $ connectRoom corridor
|
||||||
,return $ connectRoom door]
|
-- ,return $ connectRoom door]
|
||||||
++ firstWeapon
|
++ firstWeapon
|
||||||
++ [return $ connectRoom corridor
|
-- ++ [return $ connectRoom corridor
|
||||||
,return $ connectRoom door]
|
-- ,return $ connectRoom door]
|
||||||
++ [randomiseLinks =<< pistolerRoom]
|
-- ++ [randomiseLinks =<< pistolerRoom]
|
||||||
++ [return $ connectRoom door]
|
-- ++ [return $ connectRoom door]
|
||||||
++ [randomiseLinks =<< shooterRoom]
|
-- ++ [randomiseLinks =<< shooterRoom]
|
||||||
++ (replicate 3 $ randomiseLinks corridor)
|
-- ++ (replicate 3 $ randomiseLinks corridor)
|
||||||
++ [return $ connectRoom (set rmPS [PS (20,40) 0 basicLS] corridor)]
|
-- ++ [return $ connectRoom (set rmPS [PS (20,40) 0 basicLS] corridor)]
|
||||||
++ [return $ connectRoom corridor]
|
-- ++ [return $ connectRoom corridor]
|
||||||
++ (replicate 3 $ randomiseLinks corridor)
|
-- ++ (replicate 3 $ randomiseLinks corridor)
|
||||||
++ [return $ connectRoom corridor]
|
-- ++ [return $ connectRoom corridor]
|
||||||
++[return $ connectRoom corridor,return $ connectRoom door]
|
-- ++[return $ connectRoom corridor,return $ connectRoom door]
|
||||||
++ [shootingRange]
|
-- ++ [shootingRange]
|
||||||
++ (replicate 3 $ randomiseLinks corridor)
|
-- ++ (replicate 3 $ randomiseLinks corridor)
|
||||||
++[roomMiniIntro]
|
-- ++[roomMiniIntro]
|
||||||
++ (replicate 3 $ randomiseLinks corridor)
|
-- ++ (replicate 3 $ randomiseLinks corridor)
|
||||||
++ [return $ connectRoom corridor
|
-- ++ [return $ connectRoom corridor
|
||||||
,return $ connectRoom door
|
-- ,return $ connectRoom door
|
||||||
,slowDoorRoom]
|
-- ,slowDoorRoom]
|
||||||
++ [return $ connectRoom corridor
|
-- ++ [return $ connectRoom corridor
|
||||||
,spawnerRoom
|
-- ,spawnerRoom
|
||||||
,return $ connectRoom corridor
|
-- ,return $ connectRoom corridor
|
||||||
]
|
-- ]
|
||||||
)
|
)
|
||||||
$ randomiseLinks corridor
|
$ randomiseLinks corridor
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,10 @@ initializeWorld :: World -> World
|
|||||||
initializeWorld w = w
|
initializeWorld w = w
|
||||||
|
|
||||||
firstWorld :: IO World
|
firstWorld :: IO World
|
||||||
firstWorld = return $ generateFromTree lev1 $ initialWorld
|
firstWorld = do
|
||||||
|
i <- randomRIO (0,5000)
|
||||||
|
putStrLn $ "Random seed for level generation: " ++ show ( i :: Int)
|
||||||
|
return $ generateFromTree lev1 $ initialWorld {_randGen = mkStdGen i}
|
||||||
|
|
||||||
initialWorld :: World
|
initialWorld :: World
|
||||||
initialWorld = defaultWorld
|
initialWorld = defaultWorld
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import Control.Lens
|
|||||||
|
|
||||||
import Data.Function (on)
|
import Data.Function (on)
|
||||||
|
|
||||||
|
import Data.Graph
|
||||||
import Data.List
|
import Data.List
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
import qualified Data.IntMap as IM
|
import qualified Data.IntMap as IM
|
||||||
@@ -48,10 +49,10 @@ checkWallLeft (x,y) wls = case filter (\(a,b) -> b == x ) wls of
|
|||||||
-- ie returns a new set of walls with a hole determined by anticlockwise ordering of the points
|
-- ie returns a new set of walls with a hole determined by anticlockwise ordering of the points
|
||||||
cutWalls' :: [Point2] -> [WallP] -> [WallP]
|
cutWalls' :: [Point2] -> [WallP] -> [WallP]
|
||||||
cutWalls' qs walls =
|
cutWalls' qs walls =
|
||||||
nub
|
-- nub
|
||||||
. filter (not.wallIsZeroLength)
|
-- . filter (not.wallIsZeroLength)
|
||||||
. fuseWallsWith zs
|
-- . fuseWallsWith zs
|
||||||
. addPolyWalls rs
|
addPolyWalls rs
|
||||||
-- . removeWallsInPolygon ps
|
-- . removeWallsInPolygon ps
|
||||||
-- . filter (not.wallIsZeroLength)
|
-- . filter (not.wallIsZeroLength)
|
||||||
-- . fuseWallsWith zs
|
-- . fuseWallsWith zs
|
||||||
@@ -161,6 +162,22 @@ wallIsZeroLength (x,y) = x == y
|
|||||||
removeWallsInPolygon :: [Point2] -> [WallP] -> [WallP]
|
removeWallsInPolygon :: [Point2] -> [WallP] -> [WallP]
|
||||||
removeWallsInPolygon ps walls = filter (not . cond) walls
|
removeWallsInPolygon ps walls = filter (not . cond) walls
|
||||||
where
|
where
|
||||||
cond wall = pointInsidePolygon (fst wall) ps
|
cond wall = pointInsidePolygon (0.5 *.* (fst wall +.+ snd wall)) ps
|
||||||
&& pointInsidePolygon (snd wall) ps
|
-- pointInsidePolygon (fst wall) ps
|
||||||
|
-- && pointInsidePolygon (snd wall) ps
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
--pairElems :: Eq a => [(a,a)] -> [a]
|
||||||
|
--pairElems = concatMap flat2
|
||||||
|
-- where
|
||||||
|
-- flat2 (x,y) = [x,y]
|
||||||
|
--
|
||||||
|
--findLinkedPairs :: Eq a => (a,a) -> [(a,a)] -> [(a,a)]
|
||||||
|
--findLinkedPairs (x,y) = ( (x,y) : ) . filter f
|
||||||
|
-- where
|
||||||
|
-- f (a,b) = b == x || a == y
|
||||||
|
--
|
||||||
|
--
|
||||||
|
--combineListsWithID :: Eq a => [[a]] -> [[a]]
|
||||||
|
--combineListsWithID (x:
|
||||||
|
|||||||
Reference in New Issue
Block a user