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?
title Cocos2d-x Main Flow
actor User #Blue
User-> AppDelegate : applicationDidFinishLaunching()
AppDelegate -> FirstScene : scene()
FirstScene -> FirstScene : init()
FirstScene --> AppDelegate : CCScene*
AppDelegate -> CCDirector : replaceScene()
CCDirector --> AppDelegate :
User -> FirstScene : ccTouchesEnded()
activate FirstScene #LightBlue
FirstScene -> SecondScene : scene()
SecondScene -> SecondScene : init()
activate SecondScene #DarkSalmon
SecondScene --> FirstScene : CCScene*
FirstScene -> CCDirector : replaceScene()
CCDirector --> 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()
CCDirector -> User : Game App Exit
Cocos2d-x_Main_Flow.png (37.4 KB)