1 Replies - 198 Views - Last Post: 08 April 2013 - 06:42 PM Rate Topic: -----

#1 lifeinbinary  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 158
  • Joined: 15-February 11

Cocos2d (obj-c) CCMenu question

Posted 07 April 2013 - 10:50 PM

I'm feeling really stupid (or maybe just tired!)... I have two CCMenus called possiblePlayers and addedPlayers. When a user clicks on a CCMenuItemImage in the possiblePlayers menu, it adds the corresponding CCMenuItemImage to the addedPlayers menu. When the user is finnished chosing the players to play (players are just colors) they click on a startGame button that changes the scene to the board game scene. Before changing scenes I need to go thru the addedPlayers menu and update the LocalMatch class to include which colors (players) are playing.

The problem is there doesn't seem to be an objectAtIndex or anything similar in the CCMenu class. Here is what I'd like it to do written in Java:


for(int i = 0; i < addedPlayers.size(); i++)
{
   if(addedPlayers.get(i).tag == 1)
      match.players.add(new Player("red"));
   else if(addedPlayers.get(i).tag == 2)
      match.players.add(new Player("blue"));
   [...]
}



or something similar with switch or whatever! I just can't seem to find out how to "get" a CCMenuItemImage!

I know this seems stupid but i've been coding for close to 24hrs and my brain is mush :P

Is This A Good Question/Topic? 0
  • +

Replies To: Cocos2d (obj-c) CCMenu question

#2 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: Cocos2d (obj-c) CCMenu question

Posted 08 April 2013 - 06:42 PM

It might be a good idea to return to it when your brain isn't mush?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1