Exemplo n.º 1
0
bool Renderer::Render()
{
	const GameObjectList* backgrounds = ws->getBackgroundObjects();
	const GameObjectList* objects = ws->getAllGameObjects();
	gc->clear();

	ConstGameObjectIter itr;
	for (itr = backgrounds->begin(); itr!=backgrounds->end();itr++)
	{
		GameObject* obj = *itr;
		CL_Sprite* sprite = obj->sprite;
		sprite->set_angle(obj->displayHeading);
		sprite->draw(*gc,obj->location.x,obj->location.y);
	}

	for (itr = objects->begin(); itr!=objects->end();itr++)
	{
		GameObject* obj = *itr;
		CL_Sprite* sprite = obj->sprite;
		sprite->set_angle(obj->displayHeading);
		sprite->draw(*gc,obj->location.x,obj->location.y);
		/*
		if (obj->usesPhysics)
			obj->collisionOutline->draw(0,0,CL_Colorf::azure,*gc);*/
			
	}
	
	return true;

}
  void draw (View& view) 
  {    
    sprite.set_alpha ((life_time/max_life_time) * .3);
    sprite.set_scale (0.8f + ((1 - life_time/max_life_time)) * 4.0f,
		       0.8f + ((1 - life_time/max_life_time)) * 4.0f);
    sprite.set_angle(angle);
    view.get_sc().color().draw(sprite, pos.x, pos.y);
  }