I have a game in the works in Cocos2d. I have enemies that spawn every 0.8 seconds. I would like to have a DIFFERENT type of enemy s开发者_JAVA技巧pawn after, say, 25 spawn. How do I tell how many times a selector has been called? Any help is appreciated. Thanks!
so this might be a really simple answer, but I feel I should ask it, can't you just use a counter that you increment on each creation? Is there any reason why you aren't doing this?
I'm totally agree with Mark, but want also to suggest you to create a class Generator, which will be responsible for spawning enemies, will have the counter and any other logic you need to specify which monster you need to create.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论