Made input work on fixed timesteps primarily.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user