I draw cocos2d-x sequence diagram. Is it right? please teach me!

I draw cocos2d-x sequence diagram. Is it right? please teach me!
0.0 0


I don’t know cocos2d-x life time with method.

For example, I always have a question like “when do live Appdelegate and CCDirector in memory?”

I draw a sequence diagram or UML… anyway.

It is for Cocos2d-x Scene Flow.

please comment me Why it is not correct diagram

important lifeline! I want to know each class lifeline! when finished? when started. is it can division lifeline?

I use tool for drawing sequence diagram
download site is http://plantuml.sourceforge.net/download.html
menual is http://plantuml.sourceforge.net/sequence.html

`startuml img/Cocos2d-x_Main_Flow.png

title Cocos2d-x Main Flow
actor User #Blue

User-> AppDelegate : applicationDidFinishLaunching()
activate AppDelegate
AppDelegate -> FirstScene : scene()
activate FirstScene
FirstScene -> FirstScene : init()
FirstScene --> AppDelegate : CCScene*
deactivate FirstScene

AppDelegate -> CCDirector : replaceScene()
CCDirector --> AppDelegate :
deactivate AppDelegate
destroy AppDelegate

User -> FirstScene : ccTouchesEnded()
activate FirstScene #LightBlue
FirstScene -> SecondScene : scene()
activate SecondScene
SecondScene -> SecondScene : init()
activate SecondScene #DarkSalmon
deactivate SecondScene

  SecondScene --> FirstScene : CCScene*

deactivate SecondScene

FirstScene -> CCDirector : replaceScene()
CCDirector --> FirstScene :
deactivate FirstScene
destroy FirstScene

User -> SecondScene : ccTouchesMoved()
activate SecondScene #LightBlue
loop Schedule MenuSelect()
group Menu Select
else Menu = Play
SecondScene -> SecondScene :Play()
else Menu = Exit
SecondScene --> CCDirector : end()
deactivate SecondScene
destroy SecondScene

CCDirector -> User : Game App Exit


Cocos2d-x_Main_Flow.png (37.4 KB)