| 941 | } |
| 942 | |
| 943 | void 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 | |
| 966 | float PlayerObject::flipMod() { return this->m_bGravityFlipped ? -1.0f : 1.0f; } |
| 967 |
no test coverage detected