game.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * Copyright 2025 Ivan Barsukov
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation, either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. #pragma once
  18. #include <stdint.h>
  19. #include "engine/engine.h" // IWYU pragma: keep
  20. #define SCREEN_WIDTH 128
  21. #define SCREEN_HEIGHT 64
  22. #define GAME_NAME "Quadrastic"
  23. #define WIN_SCORE 15
  24. typedef enum
  25. {
  26. DifficultyEasy,
  27. DifficultyNormal,
  28. DifficultyHard,
  29. DifficultyInsane,
  30. DifficultyCount,
  31. } Difficulty;
  32. typedef enum
  33. {
  34. StateOff,
  35. StateOn,
  36. StateCount,
  37. } State;
  38. typedef enum
  39. {
  40. GameEventSkipAnimation,
  41. } GameEvent;
  42. typedef struct
  43. {
  44. Level* menu;
  45. Level* game;
  46. Level* game_over;
  47. Level* settings;
  48. Level* about;
  49. } Levels;
  50. typedef struct NotificationApp NotificationApp;
  51. typedef struct
  52. {
  53. NotificationApp* notification;
  54. Levels levels;
  55. Difficulty difficulty;
  56. uint32_t best_score;
  57. uint32_t score;
  58. State sound;
  59. State vibro;
  60. State led;
  61. } GameContext;