summaryrefslogtreecommitdiff
path: root/Week1-Pacman/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'Week1-Pacman/src/main.c')
-rw-r--r--Week1-Pacman/src/main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Week1-Pacman/src/main.c b/Week1-Pacman/src/main.c
index 0fe38bf..5d2439a 100644
--- a/Week1-Pacman/src/main.c
+++ b/Week1-Pacman/src/main.c
@@ -35,6 +35,8 @@ int main(int argc, char** argv) {
struct map map = {0};
load_map("assets/Maps/maze.csv", &map);
+ const char* keyboard =
+ SDL_GetKeyboardState(NULL);
for(int i = 0; i < 4; i++)
init_animation(&pacman.animations[i], &(struct animation_init){
@@ -76,10 +78,10 @@ int main(int argc, char** argv) {
if(e.type == SDL_QUIT) {
running = false;
}
-
- handle_pacman_input(&e, &pacman, &map);
}
+ handle_pacman_input(keyboard, &pacman, &map);
+
int now = SDL_GetTicks();
float dt = (float)(now - then) / 1000;
then = now;