enemy.h 1.3 KB

123456789101112131415161718192021222324252627
  1. #pragma once
  2. #include <game/game.h>
  3. #include "flip_world.h"
  4. // EnemyContext definition
  5. typedef struct
  6. {
  7. char id[64]; // Unique ID for the enemy type
  8. int index; // Index for the specific enemy instance
  9. Vector size; // Size of the enemy
  10. Sprite *sprite_right; // Enemy sprite when looking right
  11. Sprite *sprite_left; // Enemy sprite when looking left
  12. EntityDirection direction; // Direction the enemy is facing
  13. EntityState state; // Current state of the enemy
  14. Vector start_position; // Start position of the enemy
  15. Vector end_position; // End position of the enemy
  16. float move_timer; // Timer for the enemy movement
  17. float elapsed_move_timer; // Elapsed time for the enemy movement
  18. float radius; // Collision radius for the enemy
  19. float speed; // Speed of the enemy
  20. float attack_timer; // Cooldown duration between attacks
  21. float elapsed_attack_timer; // Time elapsed since the last attack
  22. float strength; // Damage the enemy deals
  23. float health; // Health of the enemy
  24. } EnemyContext;
  25. void spawn_enemy_json_furi(Level *level, GameManager *manager, FuriString *json);