Mirai's Miscellaneous Misadventures

M21 / include / mimimi / sprites.h

1// copyright 2022 zamfofex
2// license: AGPLv3 or later
3
4#ifndef MIMIMI_SPRITES_H
5#define MIMIMI_SPRITES_H
6
7struct mimimi_behavior;
8struct mimimi_allocator;
9struct mimimi_ground;
10
11struct mimimi_physics
12{
13	int dx, dy;
14	char airborne;
15	int width, height;
16	int gravity;
17};
18
19struct mimimi_life
20{
21	int knocked_time;
22	int immunity_time;
23	int pristinity;
24	int max_pristinity;
25	int recovery_time;
26};
27
28struct mimimi_fall
29{
30	int max_speed;
31	int knocked_time;
32};
33
34struct mimimi_walk
35{
36	int ground_speed;
37	int airborne_speed;
38	int direction;
39};
40
41struct mimimi_sprite
42{
43	struct mimimi_position *position;
44	struct mimimi_physics *physics;
45	struct mimimi_life *life;
46	struct mimimi_fall *fall;
47	struct mimimi_walk *walk;
48	struct mimimi_behavior *awake_behavior;
49	struct mimimi_behavior *behavior;
50};
51
52struct mimimi_behavior *mimimi_physics(struct mimimi_physics *physics,struct mimimi_position *position, struct mimimi_ground *ground, struct mimimi_allocator *allocator);
53struct mimimi_behavior *mimimi_life(struct mimimi_life *life, struct mimimi_allocator *allocator);
54struct mimimi_behavior *mimimi_fall(struct mimimi_fall *fall, struct mimimi_physics *physics, struct mimimi_life *life, struct mimimi_allocator *allocator);
55struct mimimi_behavior *mimimi_walk(struct mimimi_walk *walk, struct mimimi_physics *physics, struct mimimi_allocator *allocator);
56
57#endif