diff options
author | Juan J. Martinez <jjm@usebox.net> | 2023-02-05 15:55:11 +0000 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2023-02-05 15:55:11 +0000 |
commit | d7a519f1aa04e489630c63318b200e89e164d280 (patch) | |
tree | 56dcd12c831b0ed0b0f00cadc7c0196b650fae30 /src/Game.hs | |
parent | f8e1b62244f011c971763c1ec60d1ff99184fac7 (diff) | |
download | space-plat-hs-d7a519f1aa04e489630c63318b200e89e164d280.tar.gz space-plat-hs-d7a519f1aa04e489630c63318b200e89e164d280.zip |
Basic gamepad support
Diffstat (limited to 'src/Game.hs')
-rw-r--r-- | src/Game.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Game.hs b/src/Game.hs index 0d5ae45..3121ddf 100644 --- a/src/Game.hs +++ b/src/Game.hs @@ -47,7 +47,7 @@ defaultRenderRect = SDL.Rectangle (SDL.P $ V2 0 0) (V2 windowWidth windowHeight) main :: IO () main = do - SDL.initialize [SDL.InitVideo] + SDL.initialize [SDL.InitVideo, SDL.InitGameController] window <- SDL.createWindow (pack $ name ++ " " ++ version) @@ -66,7 +66,7 @@ main = do renderRect <- newIORef defaultRenderRect tsTexture <- SDL.Image.loadTexture renderer "data/tiles.png" ssTexture <- SDL.Image.loadTexture renderer "data/sprites.png" - controls <- newIORef C.init + controls <- newIORef =<< C.init map' <- M.load "data/map.json" tsTexture sprites <- S.load "data/sprites.json" ssTexture entities <- newIORef ([] :: [E.Entity]) |