Skip to main content
1 of 2
bummzack
  • 22.7k
  • 5
  • 64
  • 87

I think you have a flaw in your architecture there. The Player should not be a subclass of CCNode (or any cocos2d node class for that matter).

The CCNode is only the visual representation of your player-character, therefore your Player class should have a CCNode as member (or property as it's called in Objective-C). This makes your architecture much more flexible. You could implement a component-based architecture, where your node is part of a "VisualComponent", or you could have an inheritance-based architecture where you inherit from a "GameEntity" base-class etc. But inheriting from CCNode is a bad idea and will definitely hurt you in the long run.

bummzack
  • 22.7k
  • 5
  • 64
  • 87