Mirai's Miscellaneous Misadventures

M30 / include / mimimi / sprites.h

// copyright 2022 zamfofex
// license: AGPLv3 or later

#ifndef MIMIMI_SPRITES_H
#define MIMIMI_SPRITES_H

struct mimimi_behavior;
struct mimimi_allocator;
struct mimimi_ground;
struct mimimi_position;

struct mimimi_physics
{
	int dx, dy;
	char airborne;
	int width, height;
	int gravity;
};

struct mimimi_life
{
	int knocked_time;
	int immunity_time;
	int pristinity;
	int max_pristinity;
	int recovery_time;
};

struct mimimi_fall
{
	int max_speed;
	int knocked_time;
};

struct mimimi_walk
{
	int ground_speed;
	int airborne_speed;
	int direction;
};

struct mimimi_sprite
{
	struct mimimi_position *position;
	struct mimimi_physics *physics;
	struct mimimi_life *life;
	struct mimimi_fall *fall;
	struct mimimi_walk *walk;
	struct mimimi_behavior *awake_behavior;
	struct mimimi_behavior *behavior;
};

struct mimimi_behavior *mimimi_physics(struct mimimi_physics *physics,struct mimimi_position *position, struct mimimi_ground *ground, struct mimimi_allocator *allocator);
struct mimimi_behavior *mimimi_life(struct mimimi_life *life, struct mimimi_allocator *allocator);
struct mimimi_behavior *mimimi_fall(struct mimimi_fall *fall, struct mimimi_physics *physics, struct mimimi_life *life, struct mimimi_allocator *allocator);
struct mimimi_behavior *mimimi_walk(struct mimimi_walk *walk, struct mimimi_physics *physics, struct mimimi_allocator *allocator);

#endif