aboutsummaryrefslogtreecommitdiff
path: root/Demos/Pong/Main.hs
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2024-05-24 10:12:29 -0700
committer3gg <3gg@shellblade.net>2024-05-24 10:12:29 -0700
commit3abf8ad3308407f70a32c8cc840973172c3d84d7 (patch)
tree8a1b0d12aab22f155c636969db3dfafcd4772be7 /Demos/Pong/Main.hs
parent9553955a151e369f23dc6fa2f532a82b280879cc (diff)
WASD controls.
Diffstat (limited to 'Demos/Pong/Main.hs')
-rw-r--r--Demos/Pong/Main.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/Demos/Pong/Main.hs b/Demos/Pong/Main.hs
index 26ceefa..9f00643 100644
--- a/Demos/Pong/Main.hs
+++ b/Demos/Pong/Main.hs
@@ -113,10 +113,10 @@ resize (ResizeEvent w h) =
113 } 113 }
114 114
115translateEvents = mapMaybe translateEvents' 115translateEvents = mapMaybe translateEvents'
116 where translateEvents' (KeyDown KEY_LEFT) = Just MoveLeft 116 where translateEvents' (KeyDown KEY_A) = Just MoveLeft
117 translateEvents' (KeyDown KEY_RIGHT) = Just MoveRight 117 translateEvents' (KeyDown KEY_D) = Just MoveRight
118 translateEvents' (KeyUp KEY_LEFT) = Just StopLeft 118 translateEvents' (KeyUp KEY_A) = Just StopLeft
119 translateEvents' (KeyUp KEY_RIGHT) = Just StopRight 119 translateEvents' (KeyUp KEY_D) = Just StopRight
120 translateEvents' _ = Nothing 120 translateEvents' _ = Nothing
121 121
122exitRequested = elem (KeyDown KEY_ESC) 122exitRequested = elem (KeyDown KEY_ESC)