Question

I am making a game given in makeagamewithus.com named "PeevedPenguins".
I put _physicsNode variable in spritebuilder for gameplay scene and put CCPhysicsNode *_physicsNode in implementation class Gameplay as given in this Link.
But get an error CBReader: Couldn't find member variable: _physicsNode

Was it helpful?

Solution

You we're not declaring your ivars correctly in your class.

Here is the problematic snippet from your code.

@implementation Gameplay
CCPhysicsNode *_physicsNode;
CCNode *_catapultArm;

You forgot the brackets, here is your corrected code.

@implementation Gameplay
{
    CCPhysicsNode *_physicsNode;
    CCNode *_catapultArm;
}

OTHER TIPS

In spritebuilder make sure the pop-up menu is set to "Doc root var". Check your capitalization and spelling. Make sure the superclass of Gameplay is CCNode.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top