paper.h 657 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef PAPER_H
  2. #define PAPER_H
  3. #include <gui/gui.h>
  4. #define PAPER_START_X 8
  5. #define PAPER_START_Y 15
  6. #define BASE_GRAVITY 4
  7. #define PAPER_MIN_ROTATION -3
  8. #define PAPER_MAX_ROTATION 3
  9. #define ROTATION_MULTIPLIER 2
  10. /*
  11. x, and y are based on screen
  12. width and height / 8, map uses
  13. this grid system too.
  14. */
  15. typedef struct Paper {
  16. const Icon* icon;
  17. float x, y;
  18. int rotation;
  19. } Paper;
  20. void update_sprite_rotation(Paper* dest);
  21. void rotate_left(Paper* dest);
  22. void rotate_right(Paper* dest);
  23. void paper_init(Paper* dest);
  24. void update_position(Paper* dest, int delta_time_ms);
  25. int get_gravity_from_rotation(int rotation);
  26. #endif