background_assets.h 737 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef BACKGROUND_ASSETS_H
  2. #define BACKGROUND_ASSETS_H
  3. #include <stdlib.h>
  4. #include <stdbool.h>
  5. #include <gui/gui.h>
  6. #include "point.h"
  7. #include "states.h"
  8. #include "game_sprites.h"
  9. #include <jetpack_game_icons.h>
  10. #define BG_ASSETS_MAX 3
  11. typedef struct {
  12. int width;
  13. int spawn_chance;
  14. int x_offset;
  15. int y_offset;
  16. const Icon* sprite;
  17. } AssetProperties;
  18. typedef struct {
  19. POINT point;
  20. AssetProperties* properties;
  21. bool visible;
  22. } BackgroundAsset;
  23. void background_assets_tick(BackgroundAsset* const assets);
  24. void spawn_random_background_asset(BackgroundAsset* const assets);
  25. void draw_background_assets(const BackgroundAsset* assets, Canvas* const canvas, int distance);
  26. #endif // BACKGROUND_ASSETS_H