|
|
- #ifndef IS_ACTOR_H_
- #define IS_ACTOR_H_
-
- #include <stdint.h>
-
- #include "mob.h"
-
- typedef enum {
- DIR_LEFT,
- DIR_RIGHT,
- } actor_dir_t;
-
- typedef enum {
- ANIM_STAND,
- // TODO: Put JUMP at end later
- ANIM_JUMP,
- ANIM_WALK,
- ANIM_ATTACK,
- ANIM_HURT,
- ANIM_CLIMB,
- } actor_anim_state_t;
-
- typedef struct {
- uint8_t active;
- uint8_t flip;
- uint8_t mob_anim_idx;
- actor_anim_state_t anim;
- uint8_t frame_idx;
- uint8_t frame_counter;
- uint8_t x;
- uint8_t y;
- } actor_t;
-
- typedef struct {
- uint8_t *anims[ANIM_HURT + 1];
- } sprite16_mob;
-
- typedef struct {
- uint8_t *anims[ANIM_CLIMB + 1];
- } sprite16_player;
-
- void actor_init(void);
-
- /**
- * @brief Clear all actor data.
- */
- void actor_reset(void);
-
- /**
- * @brief Register an actor for a mob.
- * @param id The ID of the mob to create
- * @return A pointer to the new actor or NULL if one could not be created
- */
- actor_t *actor_create_mob(mob_id_t id);
-
- /**
- * @brief Remove an actor from the screen.
- * @param a The actor to remove
- */
- void actor_remove(actor_t *a);
-
- /**
- * @brief Update the internal state of each actor.
- */
- void actor_update(void);
-
- extern actor_t *PLAYER_ACTOR;
- extern sprite16_player player_anim_data;
-
- #endif
|