MCPcopy Create free account
hub / github.com/Open-GD/OpenGD / hitGround

Method hitGround

Source/PlayerObject.cpp:943–964  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

941}
942
943void PlayerObject::hitGround(bool reverseGravity)
944{
945 m_dYVel = 0.0f;
946
947 if (!isOnGround() && !reverseGravity)
948 {
949 landEffect1->setPosition(getPosition() + Vec2 {0.f, flipMod() * -15.f});
950 landEffect1->resetSystem();
951 landEffect1->start();
952 }
953
954 if (_currentGamemode == PlayerGamemodeBall && !isOnGround()) runBallRotation();
955
956 _queuedHold = false;
957 setIsOnGround(true);
958
959 if (getActionByTag(0)) stopRotation();
960
961 m_obLastGroundPos = getPosition();
962
963 if (_currentGamemode != PlayerGamemode::PlayerGamemodeShip) deactivateStreak();
964}
965
966float PlayerObject::flipMod() { return this->m_bGravityFlipped ? -1.0f : 1.0f; }
967

Callers 1

checkCollisionsMethod · 0.80

Calls 1

setPositionMethod · 0.80

Tested by

no test coverage detected