From ebc3c130ed4d8ee6c44fc902bc4ee955799d1ac5 Mon Sep 17 00:00:00 2001 From: BoredGuy Date: Fri, 13 Dec 2024 16:22:39 +0300 Subject: Initial Commit --- Week1-Pacman/src/pacman.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Week1-Pacman/src/pacman.h (limited to 'Week1-Pacman/src/pacman.h') diff --git a/Week1-Pacman/src/pacman.h b/Week1-Pacman/src/pacman.h new file mode 100644 index 0000000..567fc1d --- /dev/null +++ b/Week1-Pacman/src/pacman.h @@ -0,0 +1,30 @@ +#ifndef PACMAN_H_ +#define PACMAN_H_ + +#include +#include "animation.h" + +enum facing { + FACING_UP, + FACING_DOWN, + FACING_LEFT, + FACING_RIGHT +}; + +struct pacman { + int xpos; + int ypos; + + SDL_Texture* pacman_texture; + enum facing facing; + float frame_time; + + /* One for each face */ + struct animation animations[4]; +}; + +void handle_pacman_input(SDL_Event* e, struct pacman* pacman); +void update_pacman(struct pacman* pacman, float dt); +void draw_pacman(SDL_Renderer* ren, const struct pacman* pacman); + +#endif // PACMAN_H_ -- cgit v1.2.3