Interact
This commit is contained in:
@@ -56,7 +56,7 @@ void entityUpdate(entity_t *entity) {
|
||||
|
||||
// Movement code.
|
||||
if(entity->type == ENTITY_TYPE_PLAYER) {
|
||||
playerMovement(entity);
|
||||
playerInput(entity);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,4 +108,20 @@ void entityWalk(entity_t *entity, const entitydir_t direction) {
|
||||
|
||||
entity->animation = ENTITY_ANIM_WALK;
|
||||
entity->animFrame = ENTITY_ANIM_WALK_DURATION;// TODO: Running vs walking
|
||||
}
|
||||
|
||||
entity_t * entityGetAt(const worldpos_t position) {
|
||||
entity_t *ent = ENTITIES;
|
||||
do {
|
||||
if(
|
||||
ent->type != ENTITY_TYPE_NULL &&
|
||||
ent->position.x == position.x &&
|
||||
ent->position.y == position.y &&
|
||||
ent->position.z == position.z
|
||||
) {
|
||||
return ent;
|
||||
}
|
||||
} while(++ent, ent < &ENTITIES[ENTITY_COUNT]);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
Reference in New Issue
Block a user