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 4009298
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:51:39+00:00 2026-05-20T08:51:39+00:00

I am pretty to cocos2D. i am working in a small game which has

  • 0

I am pretty to cocos2D. i am working in a small game which has a one scene which is called intro scene. the intro scene has 3 layers.I declared some variables in scene and i want to use it in layers which is child to the intro scene. In oops there is way to access the parent variable in child. but i struggled how to inherit the variables . is there any access specifier to limit the variable scope. Provide some example and explanation.

Thanks

  • 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-20T08:51:39+00:00Added an answer on May 20, 2026 at 8:51 am
    YourScene *parentScene = (YourScene*)self.parent;
    

    /* access some variables in the scene from child layer */

    I follow the above code to access the instance variable declared in scene.for instance i did the changes in my code but i doesn,t work.

    CCTMXTileMap *tileMap=(CCTMXTiledMap *) parentScene.tTileMap;

    where tTileMap declared and added into the scene ;

    how to access the variable (declared in parent scene) in Layer as a child to the parent Scene.

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

Sidebar

Related Questions

I'm trying to get the MKStoreKit working with my Cocos2D game. It look pretty
I'm trying out some game engines for android and came across cocos2d-android-1 . I've
Pretty much every product I've worked on over the years has involved some level
Pretty simple question. I have a few ASP RequiredFieldValdators checking some text boxes. Out
Pretty simple question. I've got some Polygons and GroundOverlays defined in KML. Is there
I'm pretty new to cocos2d development and ran into a problem of getting a
I'm about to release my app (based on the Cocos2d game engine ) on
The title is pretty self explanatory. I am currently trying to make a cocos2d
I am doing a game with cocos2d and using chipmunk to manage the physics.
I'm currently building a game for the iPhone with cocos2d and have the following

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.