Quick question: What's best way to "reset" a player (as in, after death) if he's a node that contains other items? Currently I do this...
Inside mainscene.h:
{
//create a member variable for the player. He is a subclass of CCNode.
Player *m_player;
}
Inside mainscene.m:
//initialize player and add to scene
m_player = [Player node];
[self addChild:m_player];
Within the method to kill the player:
//likely doing this wrong...
[self removeChild:m_player];
Then I bring him back in the same way I created the first version of him, [Player node] and addChild. Something about this isn't right because I believe the new player is inheriting some of the old one's values. Is this a pointer issue, or something else I'm screwing up?
Considering making my player a singleton, which may help, but would rather be "tidy" and just have the single gamestate singleton. Lemme know what you think.