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
14
votes
2 answers

cocos2d-x-2.1.4 : error: format not a string literal and no format arguments [-Werror=format-security]

I am working on a game on cocos2d-x-2.1.4, however, when I try to build it on Android, it failed with the error: format not a string literal and no format arguments [-Werror=format-security] on the file CCCommon.cpp However, when I check the…
Jenny Kim
  • 1,505
  • 2
  • 16
  • 25
14
votes
2 answers

How to enable multi touch in cocos2d?

Could anyone show me how to enable multi touch in cocos2d application please? I am new to this. Really appreciate any help.
Rocker
  • 1,467
  • 5
  • 14
  • 20
14
votes
4 answers

Multiple ParticleSystems in cocos2d

I wonder about what road I should go with ParticleSystem. In this particular case I want to create 1-20 small explosions at the same time but with different positions. Right now I'm creating a new ParticleSystem for each explosion and then release…
Mattias Akerman
  • 363
  • 4
  • 14
13
votes
2 answers

No Co-Ordination Between Layers while Bakground Moves with Different Speed

I am developing an iPhone Game using COCOS2d Framework and Objective-C (in Landscape mode/view). For the game, I am using a Background which has Four Layers ('Sky' on Top, 'Mountain' below sky, 'Hill' below Mountain and 'Foreground' extreme below).…
NSExpression
  • 721
  • 5
  • 18
13
votes
1 answer

When to use CCSpriteBatchNode?

in Cocos2d I will be playing an animation. The animation has about 12 frames, and each frame is rather big. In fact, the -hd version of each frame is quite huge. Anyway, first, I created it by putting all 12 frames in a texture using Zwoptex. The…
Saturn
  • 17,888
  • 49
  • 145
  • 271
13
votes
7 answers

ERROR: The application bundle does not contain a valid identifier

I'm getting this error "The application bundle does not contain a valid identifier" after my application successfully compiles.This error prevents my game from launching on the phone or the simulator. I have no idea how to fix this as I was…
lampShade
  • 4,361
  • 8
  • 34
  • 50
13
votes
1 answer

Point in Tilt Direction - iPhone

In my cocos2d game, I have my player sprite and I want to have him move in the direction I tilt my iPhone. I can deal with that, the hardest bit which I can't work out is: How do I make my sprite rotate to point in the direction I am tilting? This…
Josh Kahane
  • 16,765
  • 45
  • 140
  • 253
13
votes
1 answer

How to subscribe self on the event of Device Orientation(not interface orientation)?

in my app i want to call some method in CCScene myscene in the case of device rotation(orientation change).I disabled the autorotation(because i want it not to happen). The issue is: i want to change gravity in the scene depending on my device…
Alexander Tkachenko
  • 3,221
  • 1
  • 33
  • 47
13
votes
2 answers

How to implement HD "Retina Display" graphics in Cocos2D

I am not quite sure how use HD images for sprites in cocos2d. I looked through the documentation, and downloaded the newest beta which supports points instead of pixels, but I don't understand the whole -hd suffix idea. In other word I need help…
tallen11
  • 1,387
  • 2
  • 17
  • 33
13
votes
2 answers

Cocos2d: Move a Sprite along a path/bezier?

I need to move a sprite from one CGPoint to another using Cocos2d for the Iphone. The problem is that the animation should be along a bezier. Basically I would use this : id move = [CCMoveTo actionWithDuration:.5f position:ccp(100,200)]; [sprite…
eemceebee
  • 2,656
  • 9
  • 39
  • 49
13
votes
2 answers

Repeating OpenGL-es texture bound to hills in cocos2d 2.0

ORIGINAL ARTICLE I am in the process of trying to implement raywenderlich's tutorial on generating hills with repeating striped coordinates using cocos2d, This article was written for Cocos2D 1.0, and as I am trying to port it to Cocos2D 2.0 This…
simonthumper
  • 1,834
  • 2
  • 22
  • 44
13
votes
4 answers

Cocos2D 2.1: "Delegate" deprecated in iOS 6. How do I set the delegate for this AVAudioSession?

Started a Cocos2D 2.1 template (with no physics engine) in Xcode 4.5, targeted for iOS 6 and iPad. In the CDAudioManager.m file, the following code... AVAudioSession* session = [AVAudioSession sharedInstance]; session.delegate = self; // Which is…
baptzmoffire
  • 589
  • 2
  • 4
  • 20
13
votes
2 answers

Cocos2d 2.0 - 3 numbers on the bottom left

I have 3 numbers on the bottom left part of the screen on my Cocos2D 2.0 project: 82 0.016 60.0 60 is probably FPS and what about the other two? As I remember, previous versions of Cocos had just the FPS number. Any clues? thanks
Duck
  • 34,902
  • 47
  • 248
  • 470
12
votes
3 answers

Does cocos2d support ARC?

I am using Xcode 4.2 and building a game for iphone (from iOS 3.0 - 5.0). Does cocos2d support ARC? What modifications needs to be made to convert code written in previous versions? If I use the strong and weak keywords for variables and set…
12
votes
4 answers

UITextField Example in Cocos2d

Can anyone please suggest some links for using UITextField in cocos2d. I want to press on label, then the UITextField should get selected and I need to edit on that UITextField.
Bhanu