52 lines
1.4 KiB
Haskell
52 lines
1.4 KiB
Haskell
module Dodge.Initialisation where
|
|
import Dodge.Default.World
|
|
import Dodge.Data
|
|
import Dodge.Data.Menu
|
|
import Dodge.Creature
|
|
--import Dodge.Base
|
|
import Dodge.Floor
|
|
import Dodge.Layout
|
|
import Dodge.Story
|
|
import Dodge.WorldEvent.Cloud
|
|
import Dodge.SoundLogic
|
|
import Dodge.SoundLogic.Synonyms
|
|
import Geometry.Data
|
|
|
|
import System.Random
|
|
import qualified Data.Set as S
|
|
import qualified Data.IntMap.Strict as IM
|
|
import qualified Data.Map as M
|
|
|
|
firstWorld :: IO World
|
|
firstWorld = do
|
|
-- i <- randomRIO (0,5000)
|
|
let i = 2
|
|
putStrLn $ "Seed for level generation: " ++ show ( i :: Int)
|
|
return $ generateLevelFromRoomList levx $ initialWorld {_randGen = mkStdGen i}
|
|
|
|
initialWorld :: World
|
|
initialWorld = defaultWorld
|
|
{ _keys = S.empty
|
|
, _cameraCenter = V2 0 0
|
|
, _cameraRot = 0
|
|
, _cameraZoom = 10
|
|
, _creatures = IM.fromList [(0,startCr)]
|
|
, _projectiles = IM.empty
|
|
, _walls = IM.empty
|
|
, _forceFields = IM.empty
|
|
, _floorItems = IM.empty
|
|
, _randGen = mkStdGen 2
|
|
, _mousePos = V2 0 0
|
|
, _testString = []
|
|
, _yourID = 0
|
|
, _worldEvents = soundOncePos foamSprayFadeOutSound (V2 0 0) . foldr ((.) . makeStartCloudAt) id
|
|
[V3 x y 5 | x <- [-5,-3..5] , y <- [-5,-3..5]]
|
|
, _pressPlates = IM.empty
|
|
, _buttons = IM.empty
|
|
, _sounds = M.empty
|
|
, _decorations = IM.empty
|
|
, _storedLevel = Nothing
|
|
, _menuLayers = [TerminalMessage 300 rezText']
|
|
, _worldState = M.empty
|
|
}
|