diff options
Diffstat (limited to 'src/update.c')
-rw-r--r-- | src/update.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/update.c b/src/update.c new file mode 100644 index 0000000..dff4368 --- /dev/null +++ b/src/update.c @@ -0,0 +1,12 @@ +void +game_update(Game *this) +{ + if (TZR_IsKeyDown(SDL_SCANCODE_LEFT)) + this->x -= 1; + if (TZR_IsKeyDown(SDL_SCANCODE_RIGHT)) + this->x += 1; + if (TZR_IsKeyDown(SDL_SCANCODE_UP)) + this->y -= 1; + if (TZR_IsKeyDown(SDL_SCANCODE_DOWN)) + this->y += 1; +} |