Пример #1
0
void animal_draw(Entity *entity)
{
	int frame = ((SDL_GetTicks() - animal_now) * 7 / 1000) % 8;
	switch(entity->state)
	{
	case UP:
		entity->frame = frame;
		entity_draw(entity, entity->position.x, entity->position.y);
		break;
	case RIGHT:
		entity->frame = frame + 16;
		entity_draw(entity, entity->position.x, entity->position.y);
		break;
	case DOWN:
		entity->frame = frame + 32;
		entity_draw(entity, entity->position.x, entity->position.y);
		break;
	case LEFT:
		entity->frame = frame + 48;
		entity_draw(entity, entity->position.x, entity->position.y);
		break;
	case FREE:
		entity->frame = 0;
		entity_draw(entity, entity->position.x, entity->position.y);
		break;
	}
}
void player_draw(){
	//need to add other equipment
	entity_draw(player,player->position.x,player->position.y);

	player_draw_equip();
	hud_draw(graphics_get_player_cam(),player->health, player->maxhealth, player->stamina, player->stamina);
}
Пример #3
0
void entity_draw_all()
{
    int i;
    for (i = 0;i < __entity_max;i++)
    {
        if (__entity_list[i].inuse)
        {
            entity_draw(&__entity_list[i]);
        }
    }
}
void
kitten_draw(Kitten * kitty, SDL_Surface * canvas, Camera * cam)
{
	entity_draw(kitty->body, canvas, cam);
}
Пример #5
0
void grue_update(entity *self){
	Vec2dAdd(self->position, self->velocity, self->position);
	entity_draw(self,self->position.x, self->position.y);
}