blob: 26c4cf1e83c51b3e176a18a3c91b819260dba499 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#include <SDL2/SDL.h>
extern SDL_Window *window;
extern SDL_Renderer *renderer;
extern unsigned input_now;
extern struct entity {
int (*update)(struct entity *self);
int (*hurt)(struct entity *self, int damage);
int (*draw)(struct entity *self, int camx, int camy);
int x, y; // unsigned results in a bunch of weird edge cases
struct velocity {
signed x, y;
} velocity;
struct hitbox {
unsigned left, right, top, bottom;
} hitbox;
unsigned state;
int hp;
int timer;
void *texture;
void *ext;
} player[1];
|