diff options
Diffstat (limited to 'Week1-Pacman/src/main.c')
-rw-r--r-- | Week1-Pacman/src/main.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/Week1-Pacman/src/main.c b/Week1-Pacman/src/main.c index 90e085b..041dfb8 100644 --- a/Week1-Pacman/src/main.c +++ b/Week1-Pacman/src/main.c @@ -10,7 +10,6 @@ #define WINDOW_HEIGHT 600 int main() { - int counter = 0; SDL_Init(SDL_INIT_EVERYTHING); struct demo demo = {0}; @@ -64,6 +63,8 @@ int main() { } }); pacman.facing = FACING_DOWN; + pacman.xpos = 100; + pacman.ypos = 200; int then = SDL_GetTicks(); @@ -81,26 +82,11 @@ int main() { then = now; SDL_RenderClear(demo.ren); - update_pacman(&pacman, dt); + update_pacman(&pacman, dt, &map); update_demo(&demo); draw_map(&demo, &map); draw_pacman(&demo, &pacman); SDL_RenderPresent(demo.ren); - - SDL_Rect r = { - .x = pacman.xpos, - .y = pacman.ypos, - .w = 40, - .h = 40 - }; - - for(int i = 0; i < map.collider_count; i++) { - if(is_colliding(&r, &map.colliders[i])) { - printf("%d: Collision!\n", counter); - counter++; - break; - } - } } SDL_DestroyRenderer(demo.ren); |