I'm new to cocos2d, and to iPhone development, and Objective-C, and sort of to game development too. I was really in to game programming in high school about 5 years ago, but I haven't touched it since. I used to work with SDL and C++. The whole Scenes, Layers, Sprites stuff is new to me.
I'm having a hard time figuring out how to structure my program. Normally I would set up a game loop, make a class for my player, for my bad guys, for each item, etc. I would create instances of the player, the map, each bad guy, and everything else, and each frame I would update them all, then display them all.
The player class would contain a sprite for the player, an update method to update its state, a draw method to draw it into video memory, etc. I would have an array of bad guys, and each frame the game loop would call their update and draw methods. But working with coocs2d it seems like things should be done differently.
Who should own the instances of the player, the map, and the bad guys? Would it be a game Scene, or a specific Layer in the game Scene? Or would it make the most sense for one of the Layers be a map, and the next layer contain all the sprites? And I need to test for collision detection between the player and the map, or the player and a bad guy, where should that logic live? Should I store the player's (x,y) coordinates in a Player class and then update the Player sprite with those coordinates, or would it make sense to make the Player class inherit from the Sprite class, so the (x,y) coordinates could only be stored in one place?
I know this is a lot of vague questions, and I'm still pouring through all the example code in the wiki, but this big picture structuring of a program is what I'm most lost at.