Ejemplo n.º 1
0
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]);
    }
}
Ejemplo n.º 2
0
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]);
			}
		}
    }
}
Ejemplo n.º 3
0
static inline vec2d enemy_pos_desired(jumpnrun_enemy const *self) { return vec2d_add(enemy_pos_hitbox(self), self->base.inertia); }