浏览 3111 次
锁定老帖子 主题:游戏启动画面设计
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2011-07-17
1) 游戏主画面加在完毕 2) 进程图片渐现、渐隐(Ready, Set, Go!) 3) 进入游戏 思路: 通过图片加载生成CCSprite实例后构造包含多个Action的CCSequence:
代码: CCSprite * ready = [CCSprite spriteWithFile:@"ready.png"]; [self addChild:ready z:3]; [ready setPosition:ccp(240,160)]; [ready setOpacity:0]; CCSprite * set =[CCSprite spriteWithFile:@"set.png"]; [self addChild:set z:3]; [set setPosition:ccp(240,160)]; [set setOpacity:0]; CCSprite * go = [CCSprite spriteWithFile:@"go.png"]; [self addChild:go z:3]; [go setPosition:ccp(240,160)]; [go setOpacity:0]; [ready runAction:[CCSequence actions:[CCDelayTime actionWithDuration:0.5],[CCSpawn actions:[CCFadeIn actionWithDuration:0.4],[CCScaleTo actionWithDuration:0.4 scale:1.2],nil] ,[CCDelayTime actionWithDuration:0.2],[CCFadeOut actionWithDuration:0.4],[CCCallFuncN actionWithTarget:self selector:@selector(removeSprite:)],nil]]; [set runAction:[CCSequence actions:[CCDelayTime actionWithDuration:1.5],[CCSpawn actions:[CCFadeIn actionWithDuration:0.4],[CCScaleTo actionWithDuration:0.4 scale:1.2],nil] ,[CCDelayTime actionWithDuration:0.2],[CCFadeOut actionWithDuration:0.4],[CCCallFuncN actionWithTarget:self selector:@selector(removeSprite:)],nil]]; [go runAction:[CCSequence actions:[CCDelayTime actionWithDuration:2.5],[CCSpawn actions:[CCFadeIn actionWithDuration:0.4],[CCScaleTo actionWithDuration:0.4 scale:1.2],nil] ,[CCDelayTime actionWithDuration:0.2],[CCFadeOut actionWithDuration:0.4],[CCCallFuncN actionWithTarget:self selector:@selector(removeSpriteAndBegin:)],nil]]; 代码下载: http://bruce-lin-chn-sina-cn.iteye.com/blog/1124752 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |
发表时间:2011-07-26
介也可以啊
|
|
返回顶楼 | |