dodatna logika
This commit is contained in:
@@ -11,6 +11,14 @@ namespace Game::AGame {
|
||||
|
||||
void Trash::update(float deltaTime) {
|
||||
(void)deltaTime;
|
||||
if (mSeaOnly) {
|
||||
const float landBoundaryX = GameManager::getSharedData<float>("terrainLandBoundaryX");
|
||||
const float margin = 25.f;
|
||||
const float halfWidth = getTexture() ? getTexture()->getWidth() * mTransform.adjustedScaleX() / 2.f : 0.f;
|
||||
if (mTransform.x - halfWidth < landBoundaryX + margin) {
|
||||
mTransform.x = landBoundaryX + margin + halfWidth;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user