blob: 567fc1dfbd685ec89f1bc54a114f68be8a40236d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#ifndef PACMAN_H_
#define PACMAN_H_
#include <SDL2/SDL.h>
#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_
|