aboutsummaryrefslogtreecommitdiff
path: root/Demos/Pong/Main.hs
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2024-08-20 18:53:46 -0700
committer3gg <3gg@shellblade.net>2024-08-20 18:53:46 -0700
commitfd8d1268d2f347bb56400ac3f16f48dc7c22d1b0 (patch)
tree0356620a6afc6bb1bdfdf011f741f940f3936ff6 /Demos/Pong/Main.hs
parentc6afd90485fe19e6b5b3f78df173aae819e2624b (diff)
Tidy.
Diffstat (limited to 'Demos/Pong/Main.hs')
-rw-r--r--Demos/Pong/Main.hs17
1 files changed, 8 insertions, 9 deletions
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
53 } 53 }
54 return (not $ exitRequested inputEvents) 54 return (not $ exitRequested inputEvents)
55 55
56processInput :: Window -> Game GameState [GameEvent]
57processInput window = processKeys window
58 [ (KEY_A, MoveLeft)
59 , (KEY_D, MoveRight)
60 ]
61
62exitRequested = elem (KeyDown KEY_ESC)
63
56render :: Game GameState () 64render :: Game GameState ()
57render = do 65render = do
58 gameState <- getGameState 66 gameState <- getGameState
@@ -113,12 +121,3 @@ resize (ResizeEvent w h) =
113 modifyGameState $ \state -> state { 121 modifyGameState $ \state -> state {
114 viewProjection = Matrix4.ortho left right bottom top (-1) 1 122 viewProjection = Matrix4.ortho left right bottom top (-1) 1
115 } 123 }
116
117
118processInput :: Window -> Game GameState [GameEvent]
119processInput window = processKeys window
120 [ (KEY_A, MoveLeft)
121 , (KEY_D, MoveRight)
122 ]
123
124exitRequested = elem (KeyDown KEY_ESC)