Scoring System In Cocos2D

前端 未结 1 932
生来不讨喜
生来不讨喜 2021-01-28 20:19

My game has a collision detection where when my missile hits the enemy the enemy disappears. I want to add a scoring system that adds 1 point every time my missile hits the enem

相关标签:
1条回答
  • 2021-01-28 21:04

    @synthesize a "score" property of type int, and a "scoreLabel" property of type CCLabelTTF.

    initialize your score property to "0" in -(void)init

    On line 126, increment your "score" property by 1, and set that value into your CCLabelTTF.

    0 讨论(0)
提交回复
热议问题