Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7589345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:08:13+00:00 2026-05-30T20:08:13+00:00

I am using 3 CCLayers in one Scene and I want simultaneous game play

  • 0

I am using 3 CCLayers in one Scene and I want simultaneous game play on all three layers, while user will play the game by switching between these layers. I can switch between these layers easily but my scheduled methods are not being called at all

Thats how I am doing it in the init() method of my scene and the line [self schedule:@selector(gameLogic:) interval:1.0]; is not working for me

Please help me where I am getting it wrong.

    layer1 = [CCLayer node];
    layer2 = [CCLayer node];
    layer3 = [CCLayer node];

    // add layer as a child to scene
    [self addChild:layer1];
    [self addChild:layer2];
    [layer2 setVisible:NO];
    [self addChild:layer3];
    [layer3 setVisible:NO];

    CCLabelTTF *layer1Label = [CCLabelTTF labelWithString:@"Layer1" fontName:@"Marker Felt" fontSize:64];
    CGSize size = [[CCDirector sharedDirector] winSize];
    layer1Label.position =  ccp( size.width /2 , size.height/2 );
    [layer1 addChild: layer1Label];

    CCLabelTTF *layer2Label = [CCLabelTTF labelWithString:@"Layer2" fontName:@"Marker Felt" fontSize:64];
    layer2Label.position =  ccp( size.width /2 , size.height/2 );
    [layer2 addChild: layer2Label];

    CCLabelTTF *layer3Label = [CCLabelTTF labelWithString:@"Layer3" fontName:@"Marker Felt" fontSize:64];
    layer3Label.position =  ccp( size.width /2 , size.height/2 );
    [layer3 addChild: layer3Label];

    [self schedule:@selector(gameLogic:) interval:1.0];

}
return self;

}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T20:08:14+00:00Added an answer on May 30, 2026 at 8:08 pm

    Ohh dear I got it set myself. The problem was nowhere in init(). [super onEnter] was missing in -(void)onEnter method. Now all my scheduled methods are doing fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using cocos2d and i want to play a movie. I've created a CCLayer
I want to use in my game effect of perspective view by using few
In my game, which is using cocos2d, there is going to be many different
I want to swap out one view with another by pushing the old view
Using mercurial, I've run into an odd problem where a line from one committer
How do I restart cocos2d scene and clean memory after the previous one? [director
I have this main scene in a game and I have called the menu
In a game I'm starting to make using cocos2d, I have a subclass of
Using the http://www.ifans.com/forums/showthread.php?t=132024 post from another question i am allowing the user to enter
Using PHP and MySQL, I want to query a table of postings my users

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.