npc.h 977 B

1234567891011121314151617181920212223
  1. #pragma once
  2. #include <game/game.h>
  3. #include "flip_world.h"
  4. // NPCContext definition
  5. typedef struct
  6. {
  7. char id[64]; // Unique ID for the NPC type
  8. int index; // Index for the specific NPC instance
  9. Vector size; // Size of the NPC
  10. Sprite *sprite_right; // NPC sprite when looking right
  11. Sprite *sprite_left; // NPC sprite when looking left
  12. EntityDirection direction; // Direction the NPC is facing
  13. EntityState state; // Current state of the NPC
  14. Vector start_position; // Start position of the NPC
  15. Vector end_position; // End position of the NPC
  16. float move_timer; // Timer for the NPC movement
  17. float elapsed_move_timer; // Elapsed time for the NPC movement
  18. float radius; // Collision radius for the NPC
  19. float speed; // Speed of the NPC
  20. } NPCContext;
  21. void spawn_npc(Level *level, GameManager *manager, FuriString *json);