【发布时间】:2017-05-14 10:22:20
【问题描述】:
-- | 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 图像替换我使用的表示(来自光泽的圆圈),但是当我尝试加载这面墙时,我什至无法加载一个原因,它在最后一行出现错误我在这里分享: 不在“墙”范围内
有人知道为什么会这样吗?
【问题讨论】: