I have a CCScene and several CCSprites added as nodes to it. I then have a subclass (also added to the SAME CCScene class instance), which we call here Whatever, of CCSprite that has some clever beheaviour. I'd like to allow this class to reference the CCSprite nodes added to the main scene and modify some properties of them (e.g. visibility). My current solution is to add a pointer to a NSMutableArray as member variable of Whatever class.
I use the CCScene class to trigger those action via the Whatever class. For instance I call the "TriggerAction" method in the Whatever node at specific times. This action modifies the CCSprites belonging to the same parent CCScene.
I am a newbie but it sounds like something potentially dangerous to me and I am wondering if this is a known design pattern or, worse, a known mistake.
Any experience in using a pattern like this? I have added "Flash" as tag as Cocos2D inherits some concepts from Flash.
EDIT:
Whatever is a special sprite (e.g. planet) that when touched is supposed to show LevelIcon sprites. My problem is that I want to position the levelIcons in respect to the planet position on the screen and the easiest way to do so was by adding them to the scene that contained the planets. I will now explore the solution where they are added only to the planet as Whatever sublcasses.. the problem is in this way I couple them a lot and I cannot recycle the Whatever class in other scenes where I don't require the LevelIcons.