Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Player::updateYPos(int iN) {
- bool bLEFT, bRIGHT;
- if (iN > 0) {
- bLEFT = CCore::getMap()->checkCollisionLB((int)(fXPos - CCore::getMap()->getXPos() + 2), (int)fYPos + iN, getHitBoxY(), true);
- bRIGHT = CCore::getMap()->checkCollisionRB((int)(fXPos - CCore::getMap()->getXPos() - 2), (int)fYPos + iN, getHitBoxX(), getHitBoxY(), true);
- if (!bLEFT && !bRIGHT) {
- fYPos += iN;
- } else {
- if (jumpState == 2) {
- jumpState = 0;
- }
- updateYPos(iN - 1);
- }
- } else if(iN < 0) {
- bLEFT = CCore::getMap()->checkCollisionLT((int)(fXPos - CCore::getMap()->getXPos() + 2), (int)fYPos + iN, false);
- bRIGHT = CCore::getMap()->checkCollisionRT((int)(fXPos - CCore::getMap()->getXPos() - 2), (int)fYPos + iN, getHitBoxX(), false);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement