<legend id='iECDg'><style id='iECDg'><dir id='iECDg'><q id='iECDg'></q></dir></style></legend>
  • <i id='iECDg'><tr id='iECDg'><dt id='iECDg'><q id='iECDg'><span id='iECDg'><b id='iECDg'><form id='iECDg'><ins id='iECDg'></ins><ul id='iECDg'></ul><sub id='iECDg'></sub></form><legend id='iECDg'></legend><bdo id='iECDg'><pre id='iECDg'><center id='iECDg'></center></pre></bdo></b><th id='iECDg'></th></span></q></dt></tr></i><div id='iECDg'><tfoot id='iECDg'></tfoot><dl id='iECDg'><fieldset id='iECDg'></fieldset></dl></div>

      <small id='iECDg'></small><noframes id='iECDg'>

      <tfoot id='iECDg'></tfoot>

          <bdo id='iECDg'></bdo><ul id='iECDg'></ul>

        Cocos2D 中的评分系统

        时间:2024-08-12

          • <bdo id='phD5s'></bdo><ul id='phD5s'></ul>
              <tbody id='phD5s'></tbody>
            1. <legend id='phD5s'><style id='phD5s'><dir id='phD5s'><q id='phD5s'></q></dir></style></legend>
            2. <tfoot id='phD5s'></tfoot>

              <small id='phD5s'></small><noframes id='phD5s'>

              <i id='phD5s'><tr id='phD5s'><dt id='phD5s'><q id='phD5s'><span id='phD5s'><b id='phD5s'><form id='phD5s'><ins id='phD5s'></ins><ul id='phD5s'></ul><sub id='phD5s'></sub></form><legend id='phD5s'></legend><bdo id='phD5s'><pre id='phD5s'><center id='phD5s'></center></pre></bdo></b><th id='phD5s'></th></span></q></dt></tr></i><div id='phD5s'><tfoot id='phD5s'></tfoot><dl id='phD5s'><fieldset id='phD5s'></fieldset></dl></div>

                • 本文介绍了Cocos2D 中的评分系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我的游戏有一个碰撞检测,当我的导弹击中敌人时,敌人就会消失.我想添加一个评分系统,每次我的导弹击中敌人时加 1 分.我将在下面发布我的游戏代码(我使用了 HelloWorldLayer.m)**

                  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 enemy. I'll post my game code below (I used the HelloWorldLayer.m)**

                  代码如下:

                  链接 - http://pastebin.com/iGP83SCv

                  在碰撞部分,我只想让它在每次弹丸击中敌人萌芽"时加 1 分,并在标签中显示分数.示例:得分:0000

                  In the collision section i just want it to add 1 point every time the projectile hits the enemy "sprout" and display the score in label. Example: Score:0000

                  PS,请尽可能简单地解释一下.

                  PS, please explain it as easy as possible.

                  推荐答案

                  @synthesize int 类型的 "score" 属性和类型的 "scoreLabel" 属性CCLabelTTF.

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

                  -(void)init

                  在第 126 行,将score"属性加 1,并将该值设置为 CCLabelTTF.

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

                  这篇关于Cocos2D 中的评分系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Cocos2d中Sprites在两点之间画一条线Sprite 下一篇:在 Box2D 中获取世界的contactListener

                  相关文章

                  <tfoot id='wJ9sS'></tfoot>

                    <small id='wJ9sS'></small><noframes id='wJ9sS'>

                    <i id='wJ9sS'><tr id='wJ9sS'><dt id='wJ9sS'><q id='wJ9sS'><span id='wJ9sS'><b id='wJ9sS'><form id='wJ9sS'><ins id='wJ9sS'></ins><ul id='wJ9sS'></ul><sub id='wJ9sS'></sub></form><legend id='wJ9sS'></legend><bdo id='wJ9sS'><pre id='wJ9sS'><center id='wJ9sS'></center></pre></bdo></b><th id='wJ9sS'></th></span></q></dt></tr></i><div id='wJ9sS'><tfoot id='wJ9sS'></tfoot><dl id='wJ9sS'><fieldset id='wJ9sS'></fieldset></dl></div>

                      <legend id='wJ9sS'><style id='wJ9sS'><dir id='wJ9sS'><q id='wJ9sS'></q></dir></style></legend>
                      • <bdo id='wJ9sS'></bdo><ul id='wJ9sS'></ul>