-
Notifications
You must be signed in to change notification settings - Fork 0
/
actor.h
69 lines (51 loc) · 1.26 KB
/
actor.h
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef ACTOR_H
#define ACTOR_H
#define SCREEN_W (256)
#define SCREEN_H (192)
#define SCROLL_H (224)
#define SCREEN_CHAR_W (32)
#define SCREEN_CHAR_H (24)
#define SCROLL_CHAR_H (28)
#define PATH_FLIP_X (0x01)
#define PATH_FLIP_Y (0x02)
#define PATH_2X_SPEED (0x04)
typedef union _fixed {
struct {
unsigned char l;
signed char h;
} b;
int w;
} fixed;
typedef struct _path_step {
signed char x, y;
} path_step;
typedef struct _path {
signed char x, y;
char flags;
path_step *steps;
} path;
typedef struct actor {
char active;
int x, y;
int spd_x;
char facing_left;
char char_w, char_h;
char pixel_w, pixel_h;
unsigned char animation_delay, animation_delay_max;
unsigned char base_tile, frame_count;
unsigned char frame, frame_increment, frame_max;
char path_flags;
path_step *path, *curr_step;
unsigned char state;
int state_timer;
char group;
char col_x, col_y, col_w, col_h;
unsigned int score;
} actor;
void draw_meta_sprite(int x, int y, int w, int h, unsigned char tile);
void init_actor(actor *act, int x, int y, int char_w, int char_h, unsigned char base_tile, unsigned char frame_count);
void move_actor(actor *act);
void draw_actor(actor *act);
void wait_frames(int wait_time);
void clear_sprites();
#endif /* ACTOR_H */