Mirai's Miscellaneous Misadventures

M30 / 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;
10struct mimimi_position;
11
12struct mimimi_physics
13{
14	int dx, dy;
15	char airborne;
16	int width, height;
17	int gravity;
18};
19
20struct mimimi_life
21{
22	int knocked_time;
23	int immunity_time;
24	int pristinity;
25	int max_pristinity;
26	int recovery_time;
27};
28
29struct mimimi_fall
30{
31	int max_speed;
32	int knocked_time;
33};
34
35struct mimimi_walk
36{
37	int ground_speed;
38	int airborne_speed;
39	int direction;
40};
41
42struct mimimi_sprite
43{
44	struct mimimi_position *position;
45	struct mimimi_physics *physics;
46	struct mimimi_life *life;
47	struct mimimi_fall *fall;
48	struct mimimi_walk *walk;
49	struct mimimi_behavior *awake_behavior;
50	struct mimimi_behavior *behavior;
51};
52
53struct mimimi_behavior *mimimi_physics(struct mimimi_physics *physics,struct mimimi_position *position, struct mimimi_ground *ground, struct mimimi_allocator *allocator);
54struct mimimi_behavior *mimimi_life(struct mimimi_life *life, struct mimimi_allocator *allocator);
55struct mimimi_behavior *mimimi_fall(struct mimimi_fall *fall, struct mimimi_physics *physics, struct mimimi_life *life, struct mimimi_allocator *allocator);
56struct mimimi_behavior *mimimi_walk(struct mimimi_walk *walk, struct mimimi_physics *physics, struct mimimi_allocator *allocator);
57
58#endif