This commit is contained in:
2025-10-09 15:07:07 -05:00
parent 7622f81309
commit c4c43b23ad
11 changed files with 162 additions and 32 deletions

View File

@@ -24,6 +24,7 @@ void entityInit(entity_t *entity, const entitytype_t type) {
);
memoryZero(entity, sizeof(entity_t));
entity->id = (uint8_t)(entity - ENTITIES);
entity->type = type;
// Init. I did use a callback struct but it was not flexible enough.
@@ -54,7 +55,7 @@ void entityUpdate(entity_t *entity) {
for(uint8_t i = 0; i < WORLD_DIMENSIONS; i++) {
if(entity->velocity[i] == 0) continue;
worldChunkPosAdd(&entity->position[i], entity->velocity[i]);
worldPosAddSubtile(&entity->position[i], entity->velocity[i]);
// Friction
worldsubtile_t v = entity->velocity[i];