| 1234567891011121314151617181920212223242526272829303132333435 |
- #pragma once
- #include "game_engine.h"
- #include "director.h"
- #include <stdlib.h>
- #ifdef __cplusplus
- extern "C" {
- #endif
- typedef struct Entity Entity;
- typedef struct {
- float x;
- float y;
- } Vector;
- #define VECTOR_ZERO ((Vector){0, 0})
- typedef struct {
- void (*start)(Entity* entity, Level* level, void* context);
- void (*stop)(Entity* entity, Level* level, void* context);
- void (*update)(Entity* entity, Director* director, void* context);
- void (*render)(Entity* entity, Director* director, Canvas* canvas, void* context);
- size_t context_size;
- } EntityDescription;
- Vector entity_pos_get(Entity* entity);
- void entity_pos_set(Entity* entity, Vector position);
- void* entity_context_get(Entity* entity);
- #ifdef __cplusplus
- }
- #endif
|