summaryrefslogtreecommitdiff
path: root/Week1-Pacman/src/pacman.h
blob: b56e95d783ec572109981ff40a407631e22dc798 (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
#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;

  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_