From 1d1554652888fa4f0cd12a51fda8d9bd54dbcee6 Mon Sep 17 00:00:00 2001 From: BoredGuy Date: Thu, 2 Jan 2025 10:53:09 +0300 Subject: Movement Finished - Smooth edge turning means that movement is now convincingly (pacmanny) --- Week1-Pacman/src/main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'Week1-Pacman/src/main.c') diff --git a/Week1-Pacman/src/main.c b/Week1-Pacman/src/main.c index 5d2439a..66e1278 100644 --- a/Week1-Pacman/src/main.c +++ b/Week1-Pacman/src/main.c @@ -9,6 +9,8 @@ #define WINDOW_WIDTH 800 #define WINDOW_HEIGHT 600 +const Uint8* keyboard; + int main(int argc, char** argv) { (void)argc; (void)argv; @@ -35,7 +37,7 @@ int main(int argc, char** argv) { struct map map = {0}; load_map("assets/Maps/maze.csv", &map); - const char* keyboard = + keyboard = SDL_GetKeyboardState(NULL); for(int i = 0; i < 4; i++) @@ -80,8 +82,6 @@ int main(int argc, char** argv) { } } - handle_pacman_input(keyboard, &pacman, &map); - int now = SDL_GetTicks(); float dt = (float)(now - then) / 1000; then = now; @@ -98,5 +98,4 @@ int main(int argc, char** argv) { SDL_DestroyWindow(demo.win); SDL_Quit(); return 0; - } -- cgit v1.2.3