Skip to content

Commit

Permalink
platformer!!!!
Browse files Browse the repository at this point in the history
  • Loading branch information
RayDeeUx committed Mar 14, 2024
1 parent 167b588 commit 42b56c4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ class $modify(MyEndLevelLayer, EndLevelLayer) {
float windowWidth = getChildByIDRecursive("background")->getContentSize().width;
float windowHeight = CCDirector::get()->getWinSize().height;
float offset = getChildByIDRecursive("background")->getPositionX();
if (auto starContainer = getChildByIDRecursive("star-container")) {
auto starContainer = getChildByIDRecursive("star-container");
if (starContainer == nullptr) auto starContainer = getChildByIDRecursive("moon-container");
if (starContainer) {
if (theLevel->m_stars.value() == 1) starContainer->setPositionX((windowWidth * 0.5f) + offset);
else starContainer->setPositionX((windowWidth * 0.25f) + offset);
starContainer->setPositionY(windowHeight * (285.f / 320.f));
Expand Down

0 comments on commit 42b56c4

Please sign in to comment.