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
3 answers

How to use accelerometer in cocos2d 3.0?

I am programming with Cocos2d 3.0 now, In Cocos2d 2.0, we can use the following code to add accelerometer to app, but this example was based on class CCLayer which has deprecate in Cocos2d 3.0, and UIAccelerometer also replaced by CMMotionManager in…
zdd
  • 8,258
  • 8
  • 46
  • 75
2
votes
0 answers

Cocos2D v3 Calculate the distance after collision

Is it possible to calculate distance at which the body will fly off in method -(BOOL)ccPhysicsCollisionBegin:typeA:typeB I need the exact point, where the body would end up after collision. In other words, will it fly off towards boundary or not;…
Vitalii Vashchenko
  • 1,777
  • 1
  • 13
  • 23
2
votes
1 answer

how to run process in background in ios7

I want to run my process in fore ground and background continuously.I've implemented the following code self.updateTimer = [NSTimer scheduledTimerWithTimeInterval:10.0 target:self …
Aruna M
  • 386
  • 3
  • 12
2
votes
3 answers

CCSprite with image from URL in cocos2d v3

I'm trying to get Facebook profile image, but I'm not able to transform the data that I get from facebook into a Texture, NSData *data = [NSData dataWithContentsOfURL:url]; UIImage *image = [UIImage imageWithData:data]; NSLog(@"sprite nao…
Filipe Ferminiano
  • 8,373
  • 25
  • 104
  • 174
2
votes
1 answer

After migrating to cocos2d v3 background image is scaled 2x

I have strange problem in cocos2d v3, probably some misconfiguration which I was unable to find in google. I'm adding background for iphone5 which is 640X1136 CCSprite *background = [CCSprite…
Grixol
  • 63
  • 5
2
votes
2 answers

Cocos2D V3 does not have CCCallFuncND How pass structure address to selector?

With Cocos2D V3 after action has completed on a sprite I need to update data contained in a structure. How can I pass a data structure address to a selector that executes after my sprite action has completed? Any help much appreciated.
2
votes
1 answer

Cocos2d V3 How change z order of child? reorderChild is not available in V3

Cocos2D V3 does not contain CCNode reorderChild:z: How can I change the z order of a CCNode in V3? Any help much appreciated.
2
votes
1 answer

How to implement update method which runs every frame

I'm trying to update my project to Cocos2d v3. I wonder how to implement update method which runs every frame. Here https://www.makegameswith.us/gamernews/359/cocos2d-30-a-brief-transition-guide there is info that no [self scheduleUpdate]; call is…
Grixol
  • 63
  • 5
2
votes
3 answers

Cocos2d v3 & chipmunk collision detection issues

First try at Chipmunk. Not getting collision detection registering is the problem. My code: @implementation MainPlayScene { CCPhysicsNode *_physics; CCNode *MyPhysicsBody; CCNode *bottomBody; } + (instancetype)scene { return [[self…
J C
  • 63
  • 1
  • 7
2
votes
1 answer

Cocos2D Get nodes at a certain point

How can I get the nodes at a certain point in cocos2d? In SpriteKit I can do the following: [parentNode nodesAtPoint:aPoint]; and it returns an array with all the nodes at that position. Is there something similar in Cocos2d (3)?
Matthijn
  • 3,126
  • 9
  • 46
  • 69
2
votes
1 answer

Action When Button is Pressed Down Cocos2d 3.0

How would i trigger - (void)onRightButtonClicked:(id)sender when the button is being pressed, not when it has been pressed (let go). This is the code for the button rightButton = [CCButton buttonWithTitle:@"" spriteFrame:[CCSpriteFrame…
Crazycriss
  • 315
  • 1
  • 5
  • 19
2
votes
3 answers

unable to getChildByTag

I'm following along with the Lynda.com iOS tutorial for game development which uses cocos2d (version 2). The instructor uses the following code to make the sprite image increase in size upon a touch event. The log statement in the code below is…
BrainLikeADullPencil
  • 11,313
  • 24
  • 78
  • 134
2
votes
2 answers

How to setup a CCTextField in Cocos2d v3

This is what I got so far: enterName = [CCTextField textFieldWithSpriteFrame:[CCSpriteFrame frameWithImageNamed:@"Tile.png"]]; enterName.fontSize = 16.0f; enterName.positionType = CCPositionTypeNormalized; enterName.position = ccp(0.5f,…
carljalal
  • 637
  • 6
  • 16
2
votes
5 answers

Compiling cocos2d-iphone v2.x including arm64

An error occurs when compiling cocos2d-iphone v2.x and including arm64 architecture. The error is in the assembly code for kazmath. Is there a fix for this? (other than removing arm64) libs/kazmath/src/neon_matrix_impl.c: Unknown register name 'q0'…
Jonny
  • 15,955
  • 18
  • 111
  • 232
2
votes
0 answers

Error With Chartboost (Undefined symbols for architecture _crypto_sign)

I have got some linker errors while building my client app which is not developed by me. But I still solved many build errors and linker errors for other third party errors. When I added chartboost to the project I got these errors which I have…
Kumar C
  • 525
  • 6
  • 21
1 2 3
99
100