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
2
votes
1 answer

UItextfield text alignment issue in cocos2D iPhone

Please take a look of the following screen shot. alt text http://img442.imageshack.us/img442/8027/img0402k.png Here is my code, I am using cocos2D CGAffineTransform transform = CGAffineTransformMakeRotation(3.14159/2); _view = [[CCDirector…
SST
  • 2,040
  • 5
  • 26
  • 42
2
votes
1 answer

Cocos2D SpriteSheet animation problem, my number of frames is much larger

I am trying to use SpriteSheet to run an animation. My frames are of 320x480 in size each, So I am able to put max 6 frames on the texture image. But my animation consists of frame number ranging from 50 to 200 sometimes, and all are of size…
user327613
  • 21
  • 2
2
votes
2 answers

How do you install cocos2d-iphone on the Mac?

There are no good instructions for installing cocos2d for iPhone on the mac. I downloaded the current build from git, a folder called "cocos2d-iphone-0.99.1". i put this folder in /Developer/Libary. Q: is this right? I tried running the file called…
johnfromberkeley
  • 21
  • 1
  • 1
  • 3
2
votes
2 answers

Problem with migrating from Texture2D to CCTexture2D (Setting CCSprite texture)

My problem is that whenever I change the texture of a sprite, the new texture will retain the size of the original sprite's texture. I have this code: mySprite = [CCSprite spriteWithFile:@"mySprite.png"]]; ... // change current stage here…
marie
  • 101
  • 1
  • 4
2
votes
0 answers

How to install the the lattest cocos2d-swift-3.2.1 in xcode 6.0.1?

I am trying to install the latest cocos2d as a template in xcode 6.0.1 but there is no install-template.sh file.I am not getting how to install it.I really appreciate if i can have some helpfull link or helpfull command in terminal. thanks in…
2
votes
1 answer

Using Chipmunk physics - how can I tell the force of two colliding objects

If I have two objects in chipmunk (I'm using cocos2d-iphone), once I've detected that they collided, how can I tell how hard they are hitting each other? I want their force (vs. the velocity) to know the damage of the collision. I've seen…
JJ Rohrer
  • 2,671
  • 5
  • 29
  • 37
2
votes
0 answers

Cocos2d CocosDenshion Sound Engine stop error

Thanks for taking the time to look as this question, I am very new to programming and am having a problem with the following error. Any help would be really appreciated. I am currently learning via Ray Wenderlichs 'Learning Cocos2D' book but also…
Rob noob
  • 57
  • 6
2
votes
0 answers

'Dtrace' error . Cocos2d-iphone 3.3 + SpriteBuilder + Chipmunk

I was making a game, ran it many times and it worked just perfect.Once this issue appeared, I can't even understand what was the reason.Missing any files? Cocos2d-iphone 3.3 + SpriteBuilder + Chipmunk …
user3475724
2
votes
2 answers

COCOS2D spotlight icon not showing on iPhone 6

I have just created a new set of icons and added them to my project. While everything works in the simulator, including iPhone 6 and 6 plus. When I run my game on my iPhone 6, the spotlight icon is still the COCOS2D icon. Any ideas why it works in…
virgil debique
  • 357
  • 2
  • 11
2
votes
2 answers

How to apply a force which should not be continuos

I have a body which I move with the help of a button, here is what I'm doing: -(void) step: (ccTime) delta { int steps = 2; CGFloat dt = delta/(CGFloat)steps; for(int i=0; i
user176845
2
votes
1 answer

Animating sprites in Cocos2d

How do I avoid unneccesary deallocation? I'm running this code: CCSpriteFrameCache * cache = [CCSpriteFrameCache sharedSpriteFrameCache]; [cache addSpriteFramesWithFile:@"boosttexture.plist"]; CCAnimation * animation = [[CCAnimation alloc]…
CBudtz
  • 113
  • 7
2
votes
1 answer

How to add seperate iPad and iPhone images in spritebuilder- Cocos2d 3.2

I love that Spritebuilder takes the retina iPad image and automatically makes the scaled down iPhone images. I make one image (ipad retina), And spritebuilder makes the iPhone ones automatically: But for certain buttons/sprites, I wanted to make…
Stan Tatarnykov
  • 691
  • 9
  • 17
2
votes
1 answer

iOS 8 autorotate rotates images off the screen

So I recently heard word from my customers about a strange issue. The screen will go black on them when they try to rotate their screen. This appears to be an iOS 8 thing only since my latest release was just to add iOS 8 to the mix. From my…
PWiggin
  • 956
  • 2
  • 12
  • 24
2
votes
0 answers

game is not proper display using xcode 6 GM seed on ipad

I am trying to build and test my game on iPad mini iOS 8 using Xcode 6 GM seed all i am seeing is this half way screen. I don't know why Xcode 6 is not showing the full screen. However same code if play on Xcode 5.1.1 then it works fine on ipad and…
preciouslogic
  • 65
  • 2
  • 7
2
votes
1 answer

CCSprite following a sequence of CGPoints

I'm developing a line drawing game, similar to Flight Control, Harbor Master, and others in the appstore, using Cocos2D. For this game, I need a CCSprite to follow a line that the user has drawn. I'm storing a sequence of CGPoint structs in an…
pgb
  • 24,813
  • 12
  • 83
  • 113