Forums › Programming › cocos2d support (graphics engine) › call init() function of layer everytime you switchTo: that layer
This topic contains 0 replies, has 1 voice, and was last updated by dozeone 2 years, 3 months ago.
I n my code the main menu starts the game by:
and the game over screen:
and then it switches back to the main menu.
However when i then jump back to layer 1 (the game) a second time, (it should be restarted by calling the init function again) all the sprite movements are just stopped and the score is not reseted.
is there any similar to viewDidAppear or something like that i need to use?
if( ! [super init] )
self.isTouchEnabled = YES;
self.isAccelerometerEnabled = YES;
You must be logged in to reply to this topic.
Social Widgets powered by AB-WebLog.com.