Exemple #1
0
void Camera::Update() {
	if (this->followingSprite) {
		double coordX = followingSprite->GetScreenX() - Screen::Instance().GetWidth() / 2; 
		double coordY = followingSprite->GetScreenY() - Screen::Instance().GetHeight() / 2;
		if (HasBounds()){
			if (coordX < boundx0)
				this->SetX(boundx0);
			else if (coordX > boundx1 - Screen::Instance().GetWidth())
				this->SetX(boundx1 - Screen::Instance().GetWidth());
			else
				this->SetX(coordX);

			if (coordY < boundy0)
				this->SetY(boundy0);
			else if (coordY > boundy1 - Screen::Instance().GetHeight())
				this->SetY(boundy1 - Screen::Instance().GetHeight());
			else
				this->SetY(coordY);
		}
		else {
			this->SetX(coordX);
			this->SetY(coordY);
		}
	}	
}
Exemple #2
0
void Camera::SetX(double x) {
	if ( !HasBounds() ) {
		this->x = x;
	} else {
		if ( x < GetMinX() )
			this->x = GetMinX();
		else if ( x > GetMaxX() )
			this->x = GetMaxX();
		else
			this->x = x;
	}
}
Exemple #3
0
void Camera::SetY(double y) {
	if ( !HasBounds() ) {
		this->y = y;
	} else {
		if ( y < GetMinY() )
			this->y = GetMinY();
		else if ( y > GetMaxY() )
			this->y = GetMaxY();
		else
			this->y = y;
	}
}
bool DungeonPersistentState::CanBeUnload() const
{
    // prevent unload if any bounded groups or online bounded player still exists
    return MapPersistentState::CanBeUnload() && !HasBounds() && !HasRespawnTimes();
}
Exemple #5
0
void IntBounds::Verify() const
{
    Assert(this);
    Assert(constantLowerBound <= constantUpperBound);
    Assert(HasBounds());
}