Cocos2d Bubble Shooting Game

杀马特。学长 韩版系。学妹 提交于 2020-01-06 09:56:34

问题


I have worked with cocos2d before, that was simple game with moving objects (CCSprite), but now I want to make a bubbleshooter game , Can anyone briefly give me idea how it will work, the flow of game and what should I use, like as I think there will be on layer, and CCSprite over it, but still not clear idea in mind

I would be thankful if someone will describe the whole flow, and classes, more briefly I will specify some major points

  1. What are bubbles used in game? (Image with CCSprites or something else)
  2. How would I know the direction of shooting.
  3. How would I know the collision is occured, and other balloons of same color connect to hitting balloon will also be vanished.

I would be thankful if someone provide the related task tutorials or source codes, so that I would get better idea about it.


回答1:


  1. Bubbles are sprite Images.
  2. Read this link http://www.raywenderlich.com/692/rotating-turrets it gives how to find the direction of Touch position.
  3. collision detection as usual.In scheduler method find if the Moving ball is collide with other ball.

     -(void)checkCollision
    {
       for(CCSprite *ball In ballArray)
     {
        if(CGRectIntersectRect([ball boundingBox],[movingBall boundingBox]))
         {
    
             CCLOG(@"collision Occurs");
    
              }
       }
    }
    


来源:https://stackoverflow.com/questions/8076096/cocos2d-bubble-shooting-game

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!