aboutsummaryrefslogtreecommitdiff
path: root/src/entities.h
blob: d7a6a835f152b0419b8b4c5cd5760bce074d757d (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
35
#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;
    uint16_t counter;
    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 */