Fix dependency loop
This commit is contained in:
parent
b7278d6afc
commit
f529fc5237
25 changed files with 251 additions and 199 deletions
|
@ -2,16 +2,15 @@ module RPGEngine.Render.LevelSelection
|
|||
( renderLevelSelection
|
||||
) where
|
||||
|
||||
import RPGEngine.Config ( resolution, zoom )
|
||||
import RPGEngine.Data ( Game (..), State (..) )
|
||||
import RPGEngine.Data.Level ( getLevelList )
|
||||
import RPGEngine.Render.Core ( Renderer )
|
||||
import RPGEngine.Render.Core (Renderer)
|
||||
|
||||
import Graphics.Gloss
|
||||
( pictures, text, translate, blank, Picture, color )
|
||||
import Graphics.Gloss.Data.Picture (scale)
|
||||
import RPGEngine.Input.Core (ListSelector (..))
|
||||
import RPGEngine.Config (resolution, zoom)
|
||||
import RPGEngine.Data (State (..))
|
||||
|
||||
import Graphics.Gloss ( pictures, color, text, translate, blank )
|
||||
import Graphics.Gloss.Data.Color (red)
|
||||
import Graphics.Gloss.Data.Picture (scale)
|
||||
import RPGEngine.Input.Core (ListSelector(..))
|
||||
|
||||
------------------------------ Exported ------------------------------
|
||||
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
module RPGEngine.Render.Lose
|
||||
module RPGEngine.Render.Lose
|
||||
( renderLose
|
||||
) where
|
||||
|
||||
import RPGEngine.Render.Core ( Renderer )
|
||||
import RPGEngine.Render.Core (Renderer)
|
||||
|
||||
import RPGEngine.Data ( State )
|
||||
import Graphics.Gloss ( text )
|
||||
import RPGEngine.Data (State)
|
||||
|
||||
----------------------------------------------------------------------
|
||||
import Graphics.Gloss (text)
|
||||
|
||||
------------------------------ Exported ------------------------------
|
||||
|
||||
-- TODO
|
||||
renderLose :: Renderer State
|
||||
renderLose _ = text "Win"
|
||||
renderLose _ = text "You lose"
|
|
@ -2,12 +2,13 @@ module RPGEngine.Render.Menu
|
|||
( renderMenu
|
||||
) where
|
||||
|
||||
import RPGEngine.Render.Core ( Renderer )
|
||||
import RPGEngine.Render.Core (Renderer)
|
||||
|
||||
import RPGEngine.Data (State)
|
||||
|
||||
import RPGEngine.Data ( State )
|
||||
import Graphics.Gloss (text)
|
||||
|
||||
----------------------------------------------------------------------
|
||||
------------------------------ Exported ------------------------------
|
||||
|
||||
-- TODO
|
||||
renderMenu :: Renderer State
|
||||
|
|
|
@ -2,13 +2,12 @@ module RPGEngine.Render.Paused
|
|||
( renderPaused
|
||||
) where
|
||||
|
||||
import RPGEngine.Render.Core ( Renderer, overlay )
|
||||
import RPGEngine.Render.Core (Renderer, overlay)
|
||||
|
||||
import RPGEngine.Data ( State (..) )
|
||||
import Graphics.Gloss ( pictures, scale, text )
|
||||
import RPGEngine.Render.Playing ( renderPlaying )
|
||||
import Graphics.Gloss.Data.Picture (color)
|
||||
import Graphics.Gloss.Data.Color (white)
|
||||
import RPGEngine.Data (State(..))
|
||||
import RPGEngine.Render.Playing (renderPlaying)
|
||||
|
||||
import Graphics.Gloss (pictures, white, color, Color(..), text, scale)
|
||||
|
||||
------------------------------ Exported ------------------------------
|
||||
|
||||
|
|
|
@ -2,22 +2,13 @@ module RPGEngine.Render.Playing
|
|||
( renderPlaying
|
||||
) where
|
||||
|
||||
import RPGEngine.Render.Core ( Renderer, getRender, setRenderPos )
|
||||
import RPGEngine.Render.Core (Renderer, getRender, setRenderPos)
|
||||
|
||||
import RPGEngine.Data
|
||||
( Player(..),
|
||||
Entity(..),
|
||||
Item(..),
|
||||
Physical(..),
|
||||
Layout,
|
||||
Level(..),
|
||||
State(..),
|
||||
Game(..) )
|
||||
import Graphics.Gloss ( Picture, pictures )
|
||||
import Graphics.Gloss.Data.Picture (translate)
|
||||
import RPGEngine.Config (resolution, zoom)
|
||||
import Graphics.Gloss (text)
|
||||
import Graphics.Gloss (blank)
|
||||
import RPGEngine.Data (State(..), Player (..), Game (..), Level (..), Layout, Physical (..), Item (..), Entity (..))
|
||||
|
||||
import Graphics.Gloss ( pictures, Picture, translate )
|
||||
import Graphics.Gloss.Data.Picture (blank)
|
||||
|
||||
------------------------------ Exported ------------------------------
|
||||
|
||||
|
@ -42,6 +33,7 @@ focusPlayer Game{ state = Playing{ player = Player{ position = (x, y) }}} = move
|
|||
where move = translate centerX centerY
|
||||
centerX = resolution * zoom * fromIntegral (negate x)
|
||||
centerY = resolution * zoom * fromIntegral (negate y)
|
||||
focusPlayer _ = id
|
||||
|
||||
------------------------------- Level --------------------------------
|
||||
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
module RPGEngine.Render.Win
|
||||
module RPGEngine.Render.Win
|
||||
( renderWin
|
||||
) where
|
||||
|
||||
import RPGEngine.Render.Core ( Renderer )
|
||||
import RPGEngine.Render.Core (Renderer)
|
||||
|
||||
import RPGEngine.Data (State)
|
||||
|
||||
import RPGEngine.Data ( State )
|
||||
import Graphics.Gloss (text)
|
||||
|
||||
----------------------------------------------------------------------
|
||||
------------------------------ Exported ------------------------------
|
||||
|
||||
-- TODO
|
||||
renderWin :: Renderer State
|
||||
renderWin _ = text "Win"
|
||||
renderWin _ = text "You win!\nPress any key to return to the menu."
|
Reference in a new issue