Fix dependency loop
This commit is contained in:
parent
b7278d6afc
commit
f529fc5237
25 changed files with 251 additions and 199 deletions
|
@ -6,8 +6,11 @@ module RPGEngine
|
|||
) where
|
||||
|
||||
import RPGEngine.Config ( bgColor, winDimensions, winOffsets )
|
||||
import RPGEngine.Render ( initWindow, render, initGame )
|
||||
import RPGEngine.Render ( initWindow, render )
|
||||
import RPGEngine.Input ( handleAllInput )
|
||||
import RPGEngine.Input.Playing ( checkPlaying, spawnPlayer )
|
||||
import RPGEngine.Data (Game (..), State (..), Layout, Level (..), Physical (..))
|
||||
import RPGEngine.Data.Default (defaultLevel, defaultPlayer)
|
||||
|
||||
import Graphics.Gloss ( play )
|
||||
|
||||
|
@ -19,4 +22,59 @@ playRPGEngine :: String -> Int -> IO()
|
|||
playRPGEngine title fps = do
|
||||
play window bgColor fps initGame render handleAllInput step
|
||||
where window = initWindow title winDimensions winOffsets
|
||||
step _ g = g -- TODO Do something with step? Check health etc.
|
||||
step _ = checkPlaying -- TODO Do something with step? Check health etc.
|
||||
|
||||
-- TODO revert this
|
||||
-- Initialize the game
|
||||
initGame :: Game
|
||||
-- initGame = Game {
|
||||
-- state = Menu{ base = StateBase{
|
||||
-- renderer = renderMenu,
|
||||
-- inputHandler = handleInputMenu
|
||||
-- }}
|
||||
-- }
|
||||
initGame = Game{
|
||||
state = initState
|
||||
}
|
||||
where initState = Playing{
|
||||
levels = [defaultLevel, otherLevel],
|
||||
count = 0,
|
||||
level = defaultLevel,
|
||||
player = spawnPlayer defaultLevel defaultPlayer,
|
||||
restart = initState
|
||||
}
|
||||
|
||||
-- TODO remove this
|
||||
otherLayout :: Layout
|
||||
otherLayout = [
|
||||
[Blocked, Blocked, Blocked],
|
||||
[Blocked, Entrance, Blocked],
|
||||
[Blocked, Walkable, Blocked],
|
||||
[Blocked, Exit, Blocked],
|
||||
[Blocked, Blocked, Blocked]
|
||||
]
|
||||
|
||||
-- TODO remove this
|
||||
otherLevel :: Level
|
||||
otherLevel = Level {
|
||||
layout = otherLayout,
|
||||
index = [
|
||||
(0, 0, Blocked),
|
||||
(1, 0, Blocked),
|
||||
(2, 0, Blocked),
|
||||
(0, 1, Blocked),
|
||||
(1, 1, Entrance),
|
||||
(2, 1, Blocked),
|
||||
(0, 2, Blocked),
|
||||
(1, 2, Walkable),
|
||||
(2, 2, Blocked),
|
||||
(0, 3, Blocked),
|
||||
(1, 3, Exit),
|
||||
(2, 3, Blocked),
|
||||
(0, 4, Blocked),
|
||||
(1, 4, Blocked),
|
||||
(2, 4, Blocked)
|
||||
],
|
||||
items = [],
|
||||
entities = []
|
||||
}
|
Reference in a new issue