From fd8d1268d2f347bb56400ac3f16f48dc7c22d1b0 Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Tue, 20 Aug 2024 18:53:46 -0700 Subject: Tidy. --- Demos/Pong/Main.hs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'Demos/Pong/Main.hs') diff --git a/Demos/Pong/Main.hs b/Demos/Pong/Main.hs index ee55622..c863a55 100644 --- a/Demos/Pong/Main.hs +++ b/Demos/Pong/Main.hs @@ -53,6 +53,14 @@ step elapsed dt inputEvents = do } return (not $ exitRequested inputEvents) +processInput :: Window -> Game GameState [GameEvent] +processInput window = processKeys window + [ (KEY_A, MoveLeft) + , (KEY_D, MoveRight) + ] + +exitRequested = elem (KeyDown KEY_ESC) + render :: Game GameState () render = do gameState <- getGameState @@ -113,12 +121,3 @@ resize (ResizeEvent w h) = modifyGameState $ \state -> state { viewProjection = Matrix4.ortho left right bottom top (-1) 1 } - - -processInput :: Window -> Game GameState [GameEvent] -processInput window = processKeys window - [ (KEY_A, MoveLeft) - , (KEY_D, MoveRight) - ] - -exitRequested = elem (KeyDown KEY_ESC) -- cgit v1.2.3