From 20dda2b1cc32109d8ec6d6c127a96470873e81bc Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Wed, 1 Mar 2023 07:56:36 +0000 Subject: Better comments --- src/Game.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Game.hs b/src/Game.hs index 8f921e9..d1552d0 100644 --- a/src/Game.hs +++ b/src/Game.hs @@ -184,14 +184,17 @@ gameLoop = do updated <- E.updateAll =<< readIORef entities entities $= updated - -- update the map viewport + -- to update the map viewport let (px, py) = E.playerPosition updated -- render map and entities void $ do + -- set the SDL viewport viewport <- M.viewport renderer map' px py (fromIntegral gameWidth) (fromIntegral gameHeight - H.height) M.render renderer map' viewport E.renderVisible renderer updated viewport + + -- reset viewport to draw the HUD SDL.rendererViewport renderer $= Nothing H.render renderer hud -- cgit v1.2.3