Questions tagged [cocos2d-iphone]

Objective-C version for iOS & OS X of Cocos2d. Cocos2d is a framework for building 2D games and graphical applications.

Cocos2D for iPhone is an framework for building 2D games and graphical applications for iOS devices and Mac OS X computers. Cocos2D for iPhone was ported from the Cocos2D Python-based framework.

"Cocos2D for iPhone" (project name: cocos2d-iphone) is a free and open source project published under an MIT License.

"Cocos2D" (project name: cocos2d) is the "grandfather" of all Cocos2D game engines. Cocos2D is written in Python and allows developers to create games and applications for Windows, Linux and Mac OS X. Cocos2D is published under a BSD License.

There are a number of other Cocos2D based game engines, the most actively updated and most widely used are:

ShinyCocos (Ruby), CocosNet (C#) and Cocos2D for Windows (C++) haven't been updated in a long time, these Cocos2D versions are considered defunct. Cocos3D is a 3D extension to Cocos2D. See the Cocos2D Game Engines list for a complete overview.

The immense popularity of Cocos2D for iPhone has the effect that most developers use the term "Cocos2D" when referring to the Cocos2D for iPhone framework.

It is recommended to use the following tags appropriately:

  • Use the tag on questions referring to the Python based framework
  • Use the tag on questions referring to the Objective-C based framework
  • Use the tag on questions referring to the C++ based cross-platform framework
  • Use the tag on questions referring to the JavaScript based framework
  • Use the tag on questions referring to the C#-MonoGame Framework.
  • Use the tag on questions referring to the Java based frameworks
  • Don't use any of the above tags together in the same question, unless your question refers to more than one Cocos2D engine. For example, if you ask "How to port from cocos2d-iphone to cocos2d-x?" you should include both and tags.

Books:

10198 questions
10
votes
3 answers

Integrate Gamecenter in cocos2d game

Is there any one who knows how to integrate game center in Cocos2d. Please tell me steps so i can integrate that in my Game.
Vivek2012
  • 772
  • 1
  • 13
  • 25
10
votes
1 answer

Cocos2D Bezier curve around object as if by gravity

I'm trying to manipulate an object. When it gets near another object, let's say a globe, I want the globe to have a gravitational pull on the original object. I know I'm supposed to use CCBezierTo, so this isn't so much a programming question as it…
switz
  • 24,384
  • 25
  • 76
  • 101
10
votes
2 answers

How to delete photos added in specific albums but not in others?

I wonder in swift and xcode: how do I delete photos added in specific albums but not in others. For example photos added in camera rolls but not in other albums? I know in principle, apple make it only a reference link of the same photo in camera…
user1314404
  • 1,253
  • 3
  • 22
  • 51
10
votes
1 answer

Difference between CCNode and CCLayer?

What is the difference between CCNode and CCLayer in Cocos2D?
user141302
10
votes
2 answers

collision detection in cocos2d

i want to detect collision detection two times in same row. for example:-(see the below image) the ellipse and rectangle or detcted. after that my ellipse will travelling in the straight line path to down and detect the another rectangle. first…
Sri
  • 827
  • 8
  • 34
10
votes
2 answers

What is a good framework for creating interactive books on the iPad?

I was wondering if anyone knew the best way to create interactive books for the iPad (such as the Alice in Wonderland and Dr. Seuss books currently available in the App Store)? I am looking at using Cocos2D which seems like it could be a good…
Tim
  • 196
  • 1
  • 8
10
votes
3 answers

How to draw a background fast in cocos2d?

I'm toying with a small game on my iPad using cocos2d and I've run into some performance worries. I have a 512x512 image tiled as my background. That gives me around 40fps with 20 sprites (in a CCSpriteBatchNode), the code for the background is…
grapefrukt
  • 27,016
  • 6
  • 49
  • 73
10
votes
1 answer

How to get winSize in Cocos2d 3.0

I used below code in Cocos2d 1.0 and Cocos2d 2.0, but it seems not found in Cocos2d 3.0 CGSize s = [[CCDirector sharedDirector] winSize]; How to get screen size in Cocos2d 3.0 ?
iPhoneProcessor
  • 4,980
  • 6
  • 27
  • 49
10
votes
2 answers

How to hide navigation bar in iOS 7 specifically for cocos2D?

My app is made with cocos2D 2.1, and I am using Xcode 5. After compiling, the UINavigationBar appears in my app on the top. How can it be hidden? I have tried the other generic iOS 7 codes that seem to work for native iOS 7 Apps: // None of the…
Simon
  • 141
  • 1
  • 7
10
votes
2 answers

Line Drawing + Intersection of that line with self and also detect CCSprites inside that drawn Line

I am drawing the line using following code, it works just amazing, http://www.merowing.info/2012/04/drawing-smooth-lines-with-cocos2d-ios-inspired-by-paper/ Now I want to..... 1> Detect if the line Intersect with itself. 2) Detect if CCSprite is…
Anand
  • 1,129
  • 7
  • 29
10
votes
3 answers

cocos2d-x CCTouchDispatcher - no sharedDispatcher

I'm currently porting an ObjC cocos2d game to cocos2d-x, but I'm encountering some problems when trying to create a registerWithTouchDispatcher method, at the moment I'm doing void GameLayer::registerWithTouchDispatcher() { …
Rory Harvey
  • 2,579
  • 2
  • 22
  • 27
10
votes
4 answers

Xcode : How To Set App To Be iPhone Only?

We have set the following app settings to be iPhone only, but in the App Store the app is listed as iPhone/iPad compatible. As you can see in the following image, the device family is set to be just iPhones: Here is App:…
Guru
  • 21,652
  • 10
  • 63
  • 102
9
votes
2 answers

sharedDispatcher is missing from CCTouchDispatcher (Cocos2D 2.0 beta2), what should I use instead?

When I try to call [CCTouchDispatcher sharedDispatcher];, it shows an error that the class method sharedDispatcher is missing. I go to the .h file of CCTouchDispatcher and found that sharedDispatcher is really missing! I am using Cocos2D 2.0 beta2.…
Hlung
  • 13,850
  • 6
  • 71
  • 90
9
votes
2 answers

Convert multiple .wav to .caf

I'm making an iPhone app and I have a ton of .wav files I need to convert to .caf I can use this for each file: afconvert -f caff -d LEI8@22050 walking.wav walking.caf But that would take ages, so I'm trying to convert all files with: for i in…
FBryant87
  • 4,273
  • 2
  • 44
  • 72
9
votes
3 answers

Math/Calculations for infinite/repeating world with rotation

How do I make a infinite/repeating world that handles rotation, just like in this game: http://bloodfromastone.co.uk/retaliation.html I have coded my rotating moving world by having a hierarchy like this: Scene   - mainLayer (CCLayer)      -…
Neigaard
  • 3,726
  • 9
  • 49
  • 85