Change snake's tint based on player-id.
This commit is contained in:
@@ -25,7 +25,7 @@ typedef enum {
|
||||
typedef struct {
|
||||
bool active;
|
||||
|
||||
// TODO: SS - Maybe add an ID here.
|
||||
Entity_ID id;
|
||||
|
||||
Entity_Type type;
|
||||
|
||||
|
||||
@@ -78,6 +78,7 @@ bool game_world_create_entity(Game_World *world, Entity_Type type, uint16_t x, u
|
||||
|
||||
world->entities[id] = (Entity) {
|
||||
.active = true,
|
||||
.id = id,
|
||||
.type = type,
|
||||
.child = INVALID_ENTITY_ID
|
||||
};
|
||||
@@ -98,7 +99,7 @@ void game_world_destroy_entity(Game_World *world, Entity_ID entity_id) {
|
||||
entity_id
|
||||
);
|
||||
assert(entity != NULL);
|
||||
entity->active = false;
|
||||
memset(&entity, 0, sizeof(Entity));
|
||||
|
||||
Grid_Cell *cell = grid_get_cell(&world->grid, entity->x, entity->y);
|
||||
assert(cell != NULL);
|
||||
|
||||
Reference in New Issue
Block a user