aboutsummaryrefslogtreecommitdiff
path: root/src/entities.h
blob: 169e5823c470b2fb4a9e4b5331fd3a1dbf02344f (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
36
#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 erase;
    uint16_t ox;
    uint16_t oy;
    uint8_t dir;
    uint8_t frame;
    uint8_t delay;
    uint8_t gravity;
    uint8_t flags;
    uint16_t counter;
    /* 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_draw();
void entities_warp_out_all();

#endif /* _ENTITIES_H */