aboutsummaryrefslogtreecommitdiff
path: root/src/entities.h
blob: 016dcd2214483ab02a791c8553e1a4b06577d128 (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
31
32
33
34
#ifndef _ENTITIES_H
#define _ENTITIES_H

#define DIR_RIGHT 0
#define DIR_LEFT 1

#define WALK_DELAY 8

typedef struct entity_s
{
    uint8_t used;
    uint16_t x;
    uint16_t y;
    uint8_t dir;
    uint8_t frame;
    uint8_t delay;
    uint8_t gravity;
    uint8_t flags;
    uint8_t bg[16 * 16];
    /* expected to be 2 directions per 4 frames max; 8 Rect */
    const Rect *frames;
    void (*update)(struct entity_s *e);
} Entity;

void entities_init();

Entity *entities_new();

void entities_update();

void entities_erase();
void entities_draw();

#endif /* _ENTITIES_H */