1
-- | Main function
main :: IO()
main = do
wall <- loadBMP "wall.bmp" -- loads wall image
play initialState drawState reactEvent reactTime
-- | Function that creates the game
play :: State -> (State -> Picture) -> (Event -> State -> State) -> (Float -> State -> State) -> IO()
play initialState drawState reactEvent reactTime = play
(InWindow "Game" (900, 900) (0, 0)) -- Window ize
(greyN 0.5) -- background coloer
1 -- refresh rate
initialState -- initial state
drawState -- draws game state
reactEvent -- teacts to evente
reactTime -- reacts to time
-- | One game represenction
type State = (Map,Picture)
-- | Initial game state
initialState :: State
initialState = ((map 13 0),wall)
函数图创建我的地图。 我的游戏已经运行良好,但我需要用一些BMP图像替换我使用的表示(光泽的圆圈),但是我无法加载,甚至一个原因,当我尝试加载此墙时,它在最后一次出现错误线我在这里分享: 不在范围'墙'Haskell光泽加载.bmp
有人可以看到为什么会发生这种情况吗?
谢谢你,会尝试这一点,并告诉它如何去。 – Dost