object.h 608 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef OBJECT_H_
  2. #define OBJECT_H_
  3. #include <graphx.h>
  4. #include "sprite.h"
  5. typedef struct Scale {
  6. int x;
  7. int y;
  8. } Scale;
  9. typedef void (*Object_func)(struct Object*);
  10. typedef int (*Object_func_int)(struct Object*);
  11. typedef struct Object {
  12. int id;
  13. int x;
  14. int y;
  15. Scale scale;
  16. Sprite* sprite;
  17. struct Scene* scene;
  18. Object_func_int height;
  19. Object_func_int width;
  20. Object_func draw;
  21. Object_func update;
  22. Object_func load;
  23. Object_func free;
  24. } Object;
  25. void Object_draw(Object* self);
  26. void free_Object(Object* self);
  27. Object* new_Object(int x, int y);
  28. #endif