Пример #1
0
void FlipChanger::draw(std::ostream &oss){
	auto ssp = m_owner->SSP();
	bool x,y;
	ssp->getFlip(&x, &y);
	
	oss << "flip: current=(" << x << "," << y << ") --> (" << m_flipX << "," << m_flipY << ")" << endl;
}
Пример #2
0
void Boss::render(const double cameraX_, const double cameraY_){

	const double dx = this->x - cameraX_;
	const double dy = this->y - cameraY_;
	
	if(this->sprite != nullptr){
		SDL_RendererFlip flip = getFlip();

		if(flip == SDL_FLIP_HORIZONTAL){
			this->sprite->render(dx - 120, dy, &this->animationClip, false, 0.0, nullptr, flip);
		}
		else{
			this->sprite->render(dx, dy, &this->animationClip, false, 0.0, nullptr, flip);
		}
	}
	
		// Shield render.
	if(this->hasShield){
		SDL_RendererFlip flip = getFlip();
		if(flip == SDL_FLIP_HORIZONTAL){
			this->shield->render(dx, dy, &this->shieldClip);
		}
		else{
			this->shield->render(dx -120, dy, &this->shieldClip);
		}
	}

	const double pdx = this->powerX - cameraX_;
	const double pdy = this->powerY - cameraY_;

	if(this->power != nullptr && this->powerIsActivated){
		
		if(this->powerFlip == SDL_FLIP_HORIZONTAL){
			this->power->render(pdx - this->powerClip.w, pdy, &this->powerClip, false, 0.0, nullptr, this->powerFlip);
		}
		else{
			this->power->render(pdx, pdy, &this->powerClip, false, 0.0, nullptr, this->powerFlip);
		}
	}

    for (auto potion : this->potions) {
        potion->render(cameraX_, cameraY_);
    }
}