game.h 674 B

1234567891011121314151617181920212223242526
  1. #pragma once
  2. #include "engine/engine.h"
  3. #include <game/world.h>
  4. #include "flip_world.h"
  5. #include "flip_storage/storage.h"
  6. #define PLAYER_COLLISION_VERTICAL 5
  7. #define PLAYER_COLLISION_HORIZONTAL 5
  8. typedef struct
  9. {
  10. uint32_t score;
  11. } GameContext;
  12. typedef struct
  13. {
  14. Vector trajectory; // Direction player would like to move.
  15. float radius; // collision radius
  16. int8_t dx; // x direction
  17. int8_t dy; // y direction
  18. Sprite *sprite_right; // player sprite
  19. Sprite *sprite_left; // player sprite looking left
  20. bool is_looking_left; // player is looking left
  21. } PlayerContext;
  22. extern const EntityDescription player_desc;