Restructuring, #9
This commit is contained in:
parent
2055ef234e
commit
dab6fadad4
41 changed files with 941 additions and 680 deletions
|
@ -5,33 +5,18 @@ module RPGEngine
|
|||
( playRPGEngine
|
||||
) where
|
||||
|
||||
import RPGEngine.Data.Defaults
|
||||
import RPGEngine.Render
|
||||
import RPGEngine.Input
|
||||
import RPGEngine.Config ( bgColor, winDimensions, winOffsets )
|
||||
import RPGEngine.Render ( initWindow, render, initGame )
|
||||
import RPGEngine.Input ( handleAllInput )
|
||||
|
||||
import Graphics.Gloss (
|
||||
Color(..)
|
||||
, white
|
||||
, play
|
||||
)
|
||||
|
||||
----------------------------- Constants ------------------------------
|
||||
|
||||
-- Dimensions for main window
|
||||
winDimensions :: (Int, Int)
|
||||
winDimensions = (1280, 720)
|
||||
|
||||
-- Offsets for main window
|
||||
winOffsets :: (Int, Int)
|
||||
winOffsets = (0, 0)
|
||||
import Graphics.Gloss ( play )
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
-- This is the gameloop.
|
||||
-- This is the game loop.
|
||||
-- It can receive input and update itself. It is rendered by a renderer.
|
||||
playRPGEngine :: String -> Int -> IO()
|
||||
playRPGEngine title fps = do
|
||||
play window bgColor fps initGame render handleInputs step
|
||||
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.
|
||||
handleInputs = handleAllInput
|
||||
step _ g = g -- TODO Do something with step? Check health etc.
|
Reference in a new issue