Exemple #1
0
CShip::CShip()
{
	alpha_ = 255;
	spriteType_ = SHIP;
	
	/* Imageresourcen manager */
	CImageResource* imageResource = GetGameClass()->GetImgResource();

	/* Load picture of the ship model TODO example! */
	miniImage_ = imageResource->Get( "images/ship/human/hunter-001.png" );
	backgroundStatic_ = new sf::Sprite (  *(imageResource->Get( "images/ship/human/hunter-001.png" )) );
	
	/* Add to graphic list */
	graphics_.Add ( backgroundStatic_ );
	
	/* Set properties */
	this->SetZoomFactor( 0.04 );
	this->SetZoomLevel ( 1 );
}
Exemple #2
0
CPlanet::CPlanet()
{
	spriteType_ = PLANET;
	
	/* Imageresourcen manager */
	CImageResource* imageResource = GetGameClass()->GetImgResource();
	
	/* load pictures */
	backgroundStatic_ = new sf::Sprite ( *imageResource->Get ( "images/planet/002.png" ) );

	this->SetCenter ( backgroundStatic_->GetSize().x * 0.5, backgroundStatic_->GetSize().y * 0.5 );
	backgroundStatic_->SetCenter ( GetCenter() );
	
	shadow_ = new sf::Sprite ( *imageResource->Get ( "images/planet/shadow.png" ) );
	shadow_->SetCenter ( GetCenter() );
	
	cloud1_ = new sf::Sprite ( *imageResource->Get ( "images/planet/clouds_001.png" ) );
	cloud1_->SetCenter ( GetCenter() );
	
	cloud2_ = new sf::Sprite ( *imageResource->Get ( "images/planet/clouds_002.png" ) );
	cloud2_->SetCenter ( GetCenter() );
	
	atmosphere_ = new sf::Sprite ( *imageResource->Get ( "images/planet/atmosphere_001.png" ) );
	atmosphere_->SetCenter ( GetCenter() );
	
	/* Set color of planet TODO EXAMPLE DATA! */
	planetColor_ = sf::Color ( 160, 220, 255, 255 );
	
	backgroundStatic_->SetColor ( planetColor_ );
	atmosphere_->SetColor ( planetColor_ );
	
	/* Add to graphic list */
	graphics_.Add ( backgroundStatic_ );
	graphics_.Add ( atmosphere_ );
	graphics_.Add ( cloud1_ );
	graphics_.Add ( cloud2_ );
	graphics_.Add ( shadow_ );
	
	/* Set properties */
	this->SetZoomFactor( 0.1 );
	this->SetZoomLevel ( 0.2 );
}