您的位置:首页 > 移动开发 > Cocos引擎

【cocos2d-x IOS游戏开发-城市跑酷18】统计结果,主角复活Try Again!!

2013-12-15 01:28 447 查看
尊重开发者的劳动成果,转载的时候请务必注明出处:http://blog.csdn.net/haomengzhu/article/details/17327813

<捕鱼达人>回顾

【cocos2d-x
IOS游戏开发-捕鱼达人1】内容介绍

上节回顾

【cocos2d-x
IOS游戏开发-城市跑酷17】Game Over,主角死亡?+死亡特效:帽子飞起来

主角死亡时,需要点击复活:

//加入重试
_tryAgain = CCSprite::createWithSpriteFrameName("label_tryagain.png");
_tryAgain->setPosition(ccp(_screenSize.width * 0.5f, _screenSize.height * 0.7f));
_tryAgain->setVisible(false);
this->addChild(_tryAgain, kForeground);


主角死亡,显示结束界面:

_tryAgain->setVisible(true);
_scoreDisplay->setAnchorPoint(ccp(0.5f, 0.5f));
_scoreDisplay->setPosition(ccp(_screenSize.width * 0.5f,
_screenSize.height * 0.88f));


等待玩家操作:
case kGameOver:

//必须点击在精灵的有效范围内
if (_tryAgain->boundingBox().containsPoint(tap)) {
_hat->setVisible(false);
_hat->stopAllActions();
_tryAgain->setVisible(false);
_terrain->reset();
_player->reset();

resetGame();
}
break;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐