Made input work on fixed timesteps primarily.

This commit is contained in:
2025-11-04 08:41:18 -06:00
parent 6ea4132ff9
commit c9608ad7a7
11 changed files with 136 additions and 53 deletions

View File

@@ -26,19 +26,7 @@ void entityInit(entity_t *entity, const entitytype_t type) {
entity->id = (uint8_t)(entity - ENTITIES);
entity->type = type;
// Init. I did use a callback struct but it was not flexible enough.
switch(type) {
case ENTITY_TYPE_PLAYER:
playerInit(entity);
break;
case ENTITY_TYPE_NPC:
npcInit(entity);
break;
default:
break;
}
if(ENTITY_CALLBACKS[type].init != NULL) ENTITY_CALLBACKS[type].init(entity);
}
void entityUpdate(entity_t *entity) {
@@ -66,7 +54,6 @@ void entityTurn(entity_t *entity, const entitydir_t direction) {
entity->animFrame = ENTITY_ANIM_TURN_DURATION;
}
void entityWalk(entity_t *entity, const entitydir_t direction) {
// TODO: Animation, delay, etc.
entity->direction = direction;