Game Development Reference
In-Depth Information
}
}
Whenever we change a tutorial state, we pause the game momentarily and wait
for a tap. We handle the rest of our logic inside onTouchBegan , so we'll add
that next.
7. Inside onTouchBegan , in the switch statement, add the following cases:
case kGameTutorial:
_tutorialLabel->setString("");
_tutorialLabel->setVisible(false);
_terrain->setStartTerrain ( true );
_state = kGamePlay;
break;
case kGameTutorialJump:
if (_player->getState() == kPlayerMoving) {
SimpleAudioEngine::getInstance()
->playEffect("jump.wav");
_player->setJumping(true);
}
break;
case kGameTutorialFloat:
if (!_player->getFloating()) {
_player->setFloating (true);
_running = true;
}
break;
case kGameTutorialDrop:
_player->setFloating (false);
_running = true;
break;
Search WWH ::




Custom Search