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

iPhone Cocos2d Loading Scenes

I copied the code from the ParticleDemo implementation into my project and tried to make it work. I want that when I click an image it should change/replace the scene. For some reason the scene is not getting replaced. Here is my…
azamsharp
  • 19,710
  • 36
  • 144
  • 222
2
votes
1 answer

moving CCCamera

I am having trouble finding a tutorial on CCCamera. And have even heard from others there is no CCCamera tutorial. But, to the point, the thing that I really want to know is simply: How do I move the coordinates of the cammera? I tried this after…
thyrgle
2
votes
2 answers

cocos2dx detect intersection with polygon sprite

I am using cocos2d-x 3.8. I try to create two polygon sprites with the following code. I know we can detect intersect with BoundingBox but is too rough. Also, I know we can use Cocos2d-x C++ Physics engine to detect collisions but doesn't it waste a…
Phyerh
  • 21
  • 4
2
votes
1 answer

Cocos2D-JS can't load json file exported from CocosStudio

I'm trying to load a json file exported from cocosstudio v2.3.2 var myScene = ccs.sceneReader.createNodeWithSceneFile('res/Scene.json'); I got this code from sample-cocos2d-js-scene-gui-master The problem is, i get this error: Can't find the…
cessmestreet
  • 2,298
  • 3
  • 22
  • 42
2
votes
1 answer

What's the difference between `cocos run` and an XCode build?

I'm using Cocos2d-x v3.9 and I'm seeing certain behaviour in the iOS Simulator which only appears when I execute the command cocos run -p mac. If I build the project through XCode I don't see the same behaviour. What are the differences between the…
aardvarkk
  • 14,955
  • 7
  • 67
  • 96
2
votes
1 answer

How to restart a level in an iPhone game

I want to restart the current scene i am on. I thought of using replaceScene and replace it with itself. Is that ok to do ? Level2Scene *scene = [Level2Scene node]; [[CCDirector sharedDirector] replaceScene:scene]; Level2Scene is the current scene…
AbhinavVinay
  • 303
  • 6
  • 18
2
votes
2 answers

Invalid initializer, CGPoint

i have this code and on the second line it gives me an error that says invalid initialzer this is the code: -(void)setPlayerPosition:(CGPoint)position { CGPoint tileCoord = [self tileCoordForPosition:position]; int tileGid = [_meta…
retsrif
  • 35
  • 1
  • 6
2
votes
2 answers

2D-iPhone-Game with side-scrolling & platforms like Super Mario with Cocos2D?

I want to create a game where the player only can run and jump on platforms. I think Cocos2D would be great for that but i haven't found any tutorials for cocos2d and side-scrolling. Where I have to start?
tharkay
  • 5,913
  • 2
  • 26
  • 33
2
votes
1 answer

iPhone Cocos2D CCColorLayers

I am currently building a simple game in cocos2d. I wish to have a CCColorLayer which has a transparent background, but has visible children CCSprites. Is this possible, and if so how? Many Thanks, nonono
123hal321
  • 2,080
  • 4
  • 24
  • 25
2
votes
1 answer

cocos2d errors: No such file or directory

I am following the tutorial http://www.bit-101.com/blog/?p=2115. In this tutorial I found a project template and go through it to begin. I have downloaded cocos2d-iphone-0.99.1 add the subdirectory cocos2d to project….but when I built I got 9 error…
Rony
  • 1,229
  • 4
  • 22
  • 42
2
votes
1 answer

Updating cocos2d in xcode, add kazmath

So I have an existing cocos2d project and wanted to upgrade cocos2d version. I right click on my project in xcode and selected "Add files...." option. Then I choose kazmath folder from the cocos2d extracted folder. I selected copy items if needed…
2
votes
1 answer

How can I use more than one sprite sheet? cocos2d/iPhone

I'm trying to use more than one sprite sheet because I can't fit them all on one and having two makes my ordering them easier (sprite sheet one sprites are in the back and have a lower zOrder). I'm currently doing: spriteSheet1 = [[CCSpriteSheet…
Scott Pfeil
  • 416
  • 5
  • 15
2
votes
1 answer

Cocos2d: Clipping Question

What is the recommended way to do basic clipping with cocos2d? I am developing a tab control for an educational product and I want the items on a tab page to be clipped by that tab page. So any CCSprites on the CCNode that IS the tab page should be…
poundev23
  • 807
  • 3
  • 11
  • 18
2
votes
2 answers

What is the best way to set up menus with cocos2d?

I'm new to development and I have played around with a few tutorials. I wonder what the best way to set up a menu for a game with cocos2d? I want a MainMenu with a Startbutton, SettingsButton, HighScoresButton and a little info/creditsButton in the…
David Holmes
  • 223
  • 1
  • 2
  • 12
2
votes
1 answer

How to detect movements of objects on iPhone by blowing air?

I was just finding something on web I come to know that we can provide movements to different objects by blowing air on iphone from mouth. I tried but could not get how to do such things. so do any one know that how to move objects by blowing air…
V.V
  • 3,082
  • 7
  • 49
  • 83