hyperultra/src/entity.h

32 lines
540 B
C

#pragma once
#include "player.h"
#include <stdbool.h>
struct Game;
typedef enum {
ET_NONE,
ET_PLAYER
} EntityType;
typedef struct Entity Entity;
struct Entity {
unsigned long uuid;
void (*update)(Entity *this, struct Game *g);
void (*draw)(Entity *this, struct Game *g);
unsigned int type;
int id;
int pos[2];
double vel[2];
double rem[2];
int width;
int height;
bool solid;
union {
Player player;
};
};
bool entity_collide(Entity *this, struct Game *g, int ox, int oy);
void entity_move(Entity *this, struct Game *g);