aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2024-05-08 16:49:31 +0530
committerAryadev Chavali <aryadev@aryadevchavali.com>2024-05-08 16:49:31 +0530
commit3679b80216741e6c2c03080762865872daff967b (patch)
treef7173bae39575b53ef9241718e11f1a23135181e /src/main.cpp
parentd0d61cbc1523986409eef734fd95d9ee018ab22a (diff)
downloadsnek-3679b80216741e6c2c03080762865872daff967b.tar.gz
snek-3679b80216741e6c2c03080762865872daff967b.tar.bz2
snek-3679b80216741e6c2c03080762865872daff967b.zip
Added up down left right keys to controls
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp
index e3d69fb..4e2b8d3 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -441,13 +441,13 @@ int main(void)
{
time_cur = Clock::now();
bool fast = false;
- if (IsKeyPressed(KEY_J))
+ if (IsKeyPressed(KEY_J) || IsKeyPressed(KEY_DOWN))
dir = Direction::DOWN;
- else if (IsKeyPressed(KEY_K))
+ else if (IsKeyPressed(KEY_K) || IsKeyPressed(KEY_UP))
dir = Direction::UP;
- else if (IsKeyPressed(KEY_H))
+ else if (IsKeyPressed(KEY_H) || IsKeyPressed(KEY_LEFT))
dir = Direction::LEFT;
- else if (IsKeyPressed(KEY_L))
+ else if (IsKeyPressed(KEY_L) || IsKeyPressed(KEY_RIGHT))
dir = Direction::RIGHT;
else if (IsKeyDown(KEY_SPACE))
fast = true;