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

How do I load a TMX Map from my Documents Directory?

I'm downloading the TMX map and the Tileset from my server, and saving them into the iOS apps documents directory: - (void)downloadMap:(void (^)(NSURL *filePath))callback; { NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration…
Ethan Mick
  • 9,517
  • 14
  • 58
  • 74
2
votes
2 answers

This app is incompatible with your device after testing on the same device?

I have successfully converted my game that I made with SpriteBuilder to a working Android version. When I run apportable load the app loads up onto my Moto G and runs as desired. Since then I have submitted my game to the Google Play Store. However…
Josh
  • 254
  • 3
  • 19
2
votes
1 answer

Admob in Cocos2d and SpriteBuilder

Hello! My game is almost done. But now I want to add ads. I use ADMob. I red the instructions but I don't have a ViewController. Because I am coding in Cocos2d & using SpriteBuilder to connect everything I only have a MainScene.m and MainScene.h. I…
Jonte
  • 23
  • 3
2
votes
2 answers

MouseJoint in cocos2d V3 for iOS

I'm looking for "MouseJoints" or an equivalent in the new version of cocos2d (3.0) for iOS which use the Chipmunk physics library instead of Box2d. Is there anything like this? Thanks in advance!
2
votes
1 answer

CCLayerColor for Cocos2d v3

It seems CCLayerColor not found in Cocos2d 3.0 Here is my Cocos2d 2.0 code, I used CCLayerColor with 20% opacity. ccColor4B color = {0,0,0,255}; CCLayerColor *fadeLayer = [CCLayerColor layerWithColor:color]; [self addChild:fadeLayer…
Guru
  • 21,652
  • 10
  • 63
  • 102
2
votes
2 answers

Cocos2d - Change CCNode Image Programmatically

Does anyone know how to change a CCNode's image programmatically? I'm using SpriteBuilder to make a simple game.
Jude Michael Murphy
  • 1,198
  • 2
  • 12
  • 23
2
votes
1 answer

Can I use blendFunc in CCAnimation?

Recently I need improve my visual effect of my app by using blendFunc in CCSprite. But I don't know how to use it in CCAnimation. Here is my implementation: CCSprite * test=[CCSprite node]; test.position=CGPointMake(100,…
Ah Wen
  • 115
  • 8
2
votes
1 answer

Statusbar orientation changes after dismissing modal view

My statusbar orientation is landscape, I have a cocos2d view that only supports portrait orientation(it is OK since it handles transformations). I have another view that is presented as a modal by cocos2d controller, its orientation is landscape,…
M. Utku ALTINKAYA
  • 2,254
  • 23
  • 29
2
votes
2 answers

Present GKGameCenterViewController in a Cocos2d 3 project

I'm trying to make a leaderboard for a game I created using SpriteBuilder. I have the following code. if (gameCenterController != nil) { gameCenterController.gameCenterDelegate = self; gameCenterController.viewState =…
Jude Michael Murphy
  • 1,198
  • 2
  • 12
  • 23
2
votes
1 answer

cocos2d animation stops when returning from background

I have a problem with a cocos2d 3.0 project for iPhone, where basically the animation stops when the app is sent to the background and does not start again when re-launching the app. The whole Xcode project was copied exactly from another of mine…
ttarik
  • 3,824
  • 1
  • 32
  • 51
2
votes
2 answers

Cocos2dv3: Renaming project causes Objective Chipmunk to not be found

I clicked on the blue xcode project name in the TopLeft of the Project Navigator, and changed the name from "A" to "B", and now I'm getting an e-rror called : ObjectiveChipmunk - 1 issue cpSpaceQuery.c ! Lexical or Preprocessor Issue…
user3271769
2
votes
0 answers

How to prevent building / compiling files that have not changed in Xcode?

I am using the cocos2d template in Xcode. I initially made some changes to some of the cocos2d files, to comment out class I don't use that are deprecated, and which produce warnings. It is unlikely I am going to make any more changes to any of the…
Rahul Iyer
  • 19,924
  • 21
  • 96
  • 190
2
votes
2 answers

SimpleAudioEngine in Cocos2d 3.0

Cocos2d 2.0 and below works with this: [[SimpleAudioEngine sharedEngine] playBackgroundMusic:@"SaveInMe.mp3"]; Which class plays music in Cocos2d 3.0 ?
iPhoneChip
  • 658
  • 1
  • 7
  • 15
2
votes
1 answer

Cocos2d 3.0 Set Portrait orientation

Already added below code in AppDelegate.m but still not working in portrait. -(NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait; } -…
Guru
  • 21,652
  • 10
  • 63
  • 102
2
votes
1 answer

iOS 7 iAd cocos2d deprecated

Im trying to get iAd implemented to a iOS 7 game I made with cocos2d, I added iad framework in xcode and have the setup below in @implementation I have set ADBannerView *_bannerView; then -(id)init { if( (self= [super init]) ) { …
1 2 3
99
100