game.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #pragma once
  2. #include "engine/engine.h"
  3. // Screen size
  4. #define SCREEN_WIDTH 128
  5. #define SCREEN_HEIGHT 64
  6. // World size (3x3)
  7. #define WORLD_WIDTH 384
  8. #define WORLD_HEIGHT 192
  9. // from https://github.com/jamisonderek/flipper-zero-tutorials/blob/main/vgm/apps/air_labyrinth/walls.h
  10. typedef struct
  11. {
  12. bool horizontal;
  13. int x;
  14. int y;
  15. int length;
  16. } Wall;
  17. #define WALL(h, y, x, l) \
  18. (Wall) \
  19. { \
  20. h, x * 2, y * 2, l \
  21. }
  22. typedef struct
  23. {
  24. uint32_t score;
  25. } GameContext;
  26. typedef enum
  27. {
  28. // system draw objects
  29. DRAW_DOT, // canvas_draw_dot
  30. DRAW_LINE, // canvas_draw_line
  31. DRAW_BOX, // canvas_draw_box
  32. DRAW_FRAME, // canvas_draw_frame
  33. DRAW_CIRCLE, // canvas_draw_circle
  34. DRAW_XBM, // canvas_draw_xbm
  35. // custom draw objects
  36. DRAW_ICON_EARTH, // canvas_draw_icon
  37. DRAW_ICON_HOME, // canvas_draw_icon
  38. DRAW_ICON_INFO, // canvas_draw_icon
  39. DRAW_ICON_MAN, // canvas_draw_man
  40. DRAW_ICON_PLANT, // canvas_draw_icon
  41. DRAW_ICON_TREE, // canvas_draw_icon
  42. DRAW_ICON_WOMAN, // canvas_draw_icon
  43. } FlipWorldDrawObjects;