Contenu connexe Similaire à Introduction for cocos2d (20) Introduction for cocos2d2. agenda
■ what s cocos2d for iPhone?
・そもそもcocos2d for iPhoneとは?
・twitterでフォローすべき人は?
・cocos2d for iPhoneでつくられた有名なアプリは?
・最近のトピックについて など・・・
■ cocos2d basic
・オブジェクトの表示の概念
・画面遷移
・アニメーション
・パーティクル など・・・
4. what’s cocos2d for iPhone?
■iPhone / iPadのゲーム用のフレームワーク
■無料、オープンソース
■objective-C
■バージョンは1.0.1(安定版)、2.0(評価版)
■物理演算を搭載している(Box2D、Chipmunk)
■数々のアプリ http://www.cocos2d-iphone.org/games/
10. what’s cocos2d for iPhone?
■ cocos2dでどんなものがつくれるのか知りたい人へ
Cocos2d Cookbook_Ch1-3
Cocos2d Cookbook_Ch4-6
Cocos2d Cookbook_Ch7-9
11. what’s cocos2d for iPhone?
■ cocos2dでどんなものがつくれるのか知りたい人へ
Cocos2d Cookbook_Ch1-3
Cocos2d Cookbook_Ch4-6
Cocos2d Cookbook_Ch7-9
12. what’s cocos2d for iPhone?
■ cocos2dでどんなものがつくれるのか知りたい人へ
Cocos2d Cookbook_Ch1-3
Cocos2d Cookbook_Ch4-6
Cocos2d Cookbook_Ch7-9
28. cocos2d basic
■ オブジェクトの表示概念 - Layer
CharacterLayer
PositionMarkLayer
UiLayer
StageBgLayer
GameScene StageSelectScene TitleScene GameOverScene
29. cocos2d basic
■ オブジェクトの表示概念 - Sprite
EnemySprite NinjaSprite
CharacterLayer
PositionMarkLayer
UiLayer
StageBgLayer
GameScene StageSelectScene TitleScene GameOverScene
30. cocos2d basic
■ オブジェクトの表示概念 - Sprite
EnemySprite NinjaSprite
CharacterLayer
PositionMarkLayer [self addChild:stageBgLayer];
UiLayer
StageBgLayer
GameScene StageSelectScene TitleScene GameOverScene
31. cocos2d basic
■ オブジェクトの表示概念 - Sprite
EnemySprite NinjaSprite
flashに似てる・・・
CharacterLayer
PositionMarkLayer [self addChild:stageBgLayer];
UiLayer
StageBgLayer
GameScene StageSelectScene TitleScene GameOverScene
33. cocos2d basic
■ シーンの遷移
[[CCDirector sharedDirector] replaceScene:scene];
34. cocos2d basic
■ シーンの遷移
[[CCDirector sharedDirector] replaceScene:scene];
もう少しクールに、、、
35. cocos2d basic
■ シーンの遷移
[[CCDirector sharedDirector] replaceScene:scene];
もう少しクールに、、、
CCTransitionSlideInL *tran = [CCTransitionSlideInL
transitionWithDuration:1.0 scene:targetScene];
[[CCDirector sharedDirector] replaceScene: tran];
36. cocos2d basic
■ シーンの遷移
[[CCDirector sharedDirector] replaceScene:scene];
もう少しクールに、、、
CCTransitionSlideInL *tran = [CCTransitionSlideInL
transitionWithDuration:1.0 scene:targetScene];
[[CCDirector sharedDirector] replaceScene: tran];
他にも
CCTransitionFade
CCTransitionJumpZoom
CCTransitionPageTurn
CCTransitionSlideInL, CCTransitionSlideInR
CCTransitionTurnOffTiles などなど
38. cocos2d basic
■ オブジェクトを動かしてみよう
CCMoveTo *move = [CCMoveTo actionWithDuration:3.0 position:ccp(100, 100)];
[self runAction:move];
39. cocos2d basic
■ オブジェクトを動かしてみよう
CCMoveTo *move = [CCMoveTo actionWithDuration:3.0 position:ccp(100, 100)];
[self runAction:move];
他にも
CCFadeIn, CCFadeOut
CCMoveTo, CCMoveBy
CCScaleTo
CCTintTo
CCAnimate
41. cocos2d basic
■ オブジェクトを動かしてみよう
同じアニメーションを繰り返すとき
CCRotateBy *rotate = [CCRotateBy actionWithDuration:1 angle:360];
CCRepeatForever *repeat = [CCRepeatForever actionWithAction:rotate];
[self runAction:repeat];
42. cocos2d basic
■ オブジェクトを動かしてみよう
同じアニメーションを繰り返すとき
CCRotateBy *rotate = [CCRotateBy actionWithDuration:1 angle:360];
CCRepeatForever *repeat = [CCRepeatForever actionWithAction:rotate];
[self runAction:repeat];
複数のアニメーションを処理するとき
id act1 = [CCMoveTo actionWithDuration:1.0 position:ccp(100, 100)];
id act2 = [CCMoveTo actionWithDuration:1.0 position:ccp(400, 300)];
[ninjaSprite runAction:[CCSequence actions:act1, act2, nil ]];
45. cocos2d basic
■ パーティクルによる演出
設定するプロパティ
texture
duration
posVar
positionType
startSizem startSizeVar, endSize, endSizeVar
angle, angleVar
life, lifeVar
emissionRate
startColor, startColorVar, endColor, endColorVar
・
・
・
46. cocos2d basic
■ パーティクルによる演出
設定するプロパティ
texture 多い!
duration
posVar
positionType
startSizem startSizeVar, endSize, endSizeVar
angle, angleVar
life, lifeVar
emissionRate
startColor, startColorVar, endColor, endColorVar
・
・
・
47. cocos2d basic
■ パーティクルによる演出
設定するプロパティ
texture 多い!
duration
posVar プロパティの値を変えたら
positionType
どれくらい視覚的に変化するのか
startSizem startSizeVar, endSize, endSizeVar
angle, angleVar わからない!
life, lifeVar
emissionRate
startColor, startColorVar, endColor, endColorVar
・
・
・
48. cocos2d basic
■ パーティクルによる演出
設定するプロパティ
texture 多い!
duration
posVar プロパティの値を変えたら
positionType
どれくらい視覚的に変化するのか
startSizem startSizeVar, endSize, endSizeVar
angle, angleVar わからない!
life, lifeVar
emissionRate
startColor, startColorVar, endColor, endColorVar
・
・
・
49. cocos2d basic
■ パーティクルによる演出
id particle = [CCParticleSystemQuad particleWithFile:@"ninjaSmoke.plist"];
[self addChild:deadAnimation];
50. cocos2d basic
■ パーティクルによる演出
id particle = [CCParticleSystemQuad particleWithFile:@"ninjaSmoke.plist"];
[self addChild:deadAnimation];
実演してみる!!!!
Notes de l'éditeur \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n