skippy_winks
skippy_winks

Reputation: 778

How to detect how many times a selector has been performed Cocos2d?

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 spawn after, say, 25 spawn. How do I tell how many times a selector has been called? Any help is appreciated. Thanks!

Upvotes: 0

Views: 51

Answers (2)

Andrew
Andrew

Reputation: 24846

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.

Upvotes: 0

Mark
Mark

Reputation: 14950

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?

Upvotes: 2

Related Questions