Cocos2d泡泡射击游戏 [英] Cocos2d Bubble Shooting Game

查看:64
本文介绍了Cocos2d泡泡射击游戏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以前使用过cocos2d,那是一个带有移动对象的简单游戏(CCSprite),但是现在我想制作一个泡泡射击游戏,任何人都可以简要地告诉我它会如何工作,游戏的流程以及我应该使用什么,就像我认为将在层上使用CCSprite一样,但是仍然不清楚我的想法

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. 游戏中使用的气泡是什么?(带有CCSprites或其他图片的图片)
  2. 我怎么知道射击的方向.
  3. 我怎么知道发生了碰撞,并且其他同色气球连接到击中的气球也将消失.

如果有人提供相关的任务教程或源代码,我将不胜感激,以便让我对此有所了解.

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

推荐答案

  1. 气泡是精灵图像.
  2. 阅读此链接 http://www.raywenderlich.com/692/rotating-turrets它提供了如何找到触摸"位置的方向.
  3. 惯常的碰撞检测.在调度程序方法中,确定移动"球是否与其他球发生碰撞.

  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");

          }
   }
}

这篇关于Cocos2d泡泡射击游戏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆