Game Development Reference
In-Depth Information
if (_player->getState() != kPlayerDying)
_player->setJumping(true);
}
return true;
}
return false;
}
Now we are in play, and if the
_player
object is falling, we either open or close
the umbrella, whichever the case may be, through a call to
setFloating
.
And if the
_player
object is not falling, nor dying, we make it jump with
setJumping(true)
.
4. With touches ended, we just need to stop any jumps:
void GameLayer::onTouchEnded(Touch* touch, Event*
event) {
_player->setJumping(false);
}