void entity_update_all() { int i; for (i = 0; i < MaxEntities;i++) { if (!EntityList[i].inuse) { continue; } vec2d_add(EntityList[i].position,EntityList[i].velocity,EntityList[i].position); if (!EntityList[i].update) { continue; } EntityList[i].update(&EntityList[i]); } }
void entity_update_all() { int i; int j; Entity *e; for (i = 0; i < MaxEntities;i++) { e = &EntityList[i]; if(EntityList[i].cleanUp) { entity_free(&e); continue; } if (!EntityList[i].inuse) { continue; } vec2d_add(EntityList[i].position,EntityList[i].velocity,EntityList[i].position); if (!EntityList[i].update) { continue; } EntityList[i].update(&EntityList[i]); for(j=0;j < EntityList[j].inuse && j != i;j++) { if(EntityList[i].touch != NULL) { (*EntityList[i].touch)(&EntityList[i],&EntityList[j]); } } } }
static inline vec2d enemy_pos_desired(jumpnrun_enemy const *self) { return vec2d_add(enemy_pos_hitbox(self), self->base.inertia); }