diff options
author | 3gg <3gg@shellblade.net> | 2024-05-24 10:12:29 -0700 |
---|---|---|
committer | 3gg <3gg@shellblade.net> | 2024-05-24 10:12:29 -0700 |
commit | 3abf8ad3308407f70a32c8cc840973172c3d84d7 (patch) | |
tree | 8a1b0d12aab22f155c636969db3dfafcd4772be7 | |
parent | 9553955a151e369f23dc6fa2f532a82b280879cc (diff) |
WASD controls.
-rw-r--r-- | Demos/Pong/Main.hs | 10 |
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 | ||
115 | translateEvents = mapMaybe translateEvents' | 115 | translateEvents = 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 | ||
122 | exitRequested = elem (KeyDown KEY_ESC) | 122 | exitRequested = elem (KeyDown KEY_ESC) |