diff options
author | BoredGuy <osome3717@gmail.com> | 2025-01-15 18:12:03 +0300 |
---|---|---|
committer | BoredGuy <osome3717@gmail.com> | 2025-01-15 18:12:03 +0300 |
commit | 6a6f7be378bee10679e9e1ea61a70b00b4731589 (patch) | |
tree | 8017237147d72e455d6479734579df39eefd2853 /Week1-Pacman/src/pacman.c | |
parent | 5f7e0d8cf88d0adb9739e2cc7e26ba26243975f8 (diff) |
I am super proud of this one TBH
Diffstat (limited to 'Week1-Pacman/src/pacman.c')
-rw-r--r-- | Week1-Pacman/src/pacman.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/Week1-Pacman/src/pacman.c b/Week1-Pacman/src/pacman.c index 0ec6670..1ca6ca7 100644 --- a/Week1-Pacman/src/pacman.c +++ b/Week1-Pacman/src/pacman.c @@ -4,6 +4,7 @@ #include <stdbool.h> #include "pacman.h" #include "collision.h" +#include "import_resources.h" #define PACMAN_SPEED 261 #define PACMAN_SIDE 40 @@ -11,26 +12,15 @@ extern const Uint8* keyboard; -SDL_Texture* pacman_texture; - SDL_Rect* get_colliding_tile_raw(SDL_Rect*, struct map* map); SDL_Rect* get_colliding_tile(struct pacman* pacman, struct map* map); void rect_step_one_pixel(SDL_Rect* r, enum facing); -void load_pacman_spritesheet(struct demo* demo) { - if(!pacman_texture) { - pacman_texture = - IMG_LoadTexture(demo->ren, "assets/Sprites/sprites.png"); - - assert(pacman_texture); - } -} - void init_pacman(struct pacman* pacman, struct pacman_init* init) { for(int i = 0; i < 4; i++) init_animation(&pacman->animations[i], &(struct animation_init){ - .spritesheet_texture = pacman_texture, + .spritesheet_texture = character_spritesheet, .initial_angle = 90.0 * i, .initial_frame_count = 3, |