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

2D topdown Water Ripple Effect (Fragment Shader)

So here's the code I found: RippleSprite.cpp void RippleEffectSprite::update(float delta) { //called per frame updateRippleParams(); // TODO: improve float rippleSpeed = 0.25f; float maxRippleDistance = 1; m_rippleDistance += rippleSpeed *…
2
votes
0 answers

Crash on devices running iOS 8.4

Can anyone help here please? I submitted version 2 of my app only to have it rejected as it crashed on a number of devices running 8.4 …. {"bundleID":"properties.axxxxxxx.xxxxxxxxx”,”app_name”:”My App”,”share_with_app_devs":false,"name”:”My…
2
votes
1 answer

Cocos2d - Changing animations after one is over

I've got a CCSprite with three animations: idle, walk and attack. I want to switch between idle and walk depending on whether or not the sprite is moving (if the joystick is beeing used). All of this works great. For the attacking animation, I want…
David Menard
  • 2,261
  • 3
  • 43
  • 67
2
votes
0 answers

ARC with cocos2d causing unbounded heap growth and eventual memory crash?

I'm trying to track down a memory-related crash in my game. The exact error, if I happen to catch it while attached to a debugger varies. One such error message is: Message from debugger: Terminated due to memory issue. No crash report is…
Zane Claes
  • 14,732
  • 15
  • 74
  • 131
2
votes
1 answer

Is it possible to build one single .exe file for my cocos2d-x game?

I managed to build a Windows executable for my cocos2d-x game using the cocos console and Visual Studio 2015 Express C++. The output, in the "Publish" folder, is my executable game and several .dll files. As well as the game resources. In other…
Saturn
  • 17,888
  • 49
  • 145
  • 271
2
votes
3 answers

Open telephone from the application (iOS)

Can Someone tell how can I open telephone with a button click? I have used this for safari and it works [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.google.com"]];
kazui
  • 141
  • 1
  • 1
  • 6
2
votes
3 answers

IPhone and Cocos2d Sprites/Layers

I am using cocos2d-iphone to place Sprites onto a Layer to setup a game playfield. At certain points in the game, certain Sprites need to be removed based upon game conditions. What I would like to do is setup an array of Sprite pointers, but I…
user21293
  • 6,439
  • 11
  • 44
  • 57
2
votes
3 answers

Connect my application with Facebook

I'm creating an application using ObjC and cocos2d, and I would like to connect my app via button with a link of the Facebook application. How can I do this? (I want that when the button is pressed, it opens the page of Facebook application.)
kazui
  • 141
  • 1
  • 1
  • 6
2
votes
1 answer

Subclass Cocos2D MenuItem with Objective-C

I'm using a CCMenu in my small project, it has three buttons in it. I need these buttons to keep triggering if they detect a touch, and as this isn't normal behaviour I decided to subclass the CCMenuItem and override a couple of methods. The two…
Andrew
  • 23
  • 4
2
votes
1 answer

Handling a latency issue in PVP game

I am building a 1 vs 1 tetris game using cocos2d-x(C++) and a node.js(websocket). Currently, I am working on a PVP feature between two players. The basic logic looks like this: 1. Client1 completes a horizontal line and destroy it. 2. In this case,…
Peter Hwang
  • 971
  • 1
  • 12
  • 25
2
votes
0 answers

CCEditbox can't use copy, select paste function

When long press the input box it can popup the system menus (like select select All or copy select paste), but when press the menu the system keyboard was directly exit. It seems that press on external area. Other platform(iphone4, iPad) words well.…
郑庆佳
  • 21
  • 1
2
votes
0 answers

Adding 64 bit fix to Cocos2d makes all CCActions act crazy

Some background: I was forced to add a 64 bit fix to a game built using Cocos2d v2 before publishing the game and I did that using different little hacks from a tutorial, which solved the problem but also led to some nasty sprite flickering on the…
marsrover
  • 715
  • 11
  • 27
2
votes
0 answers

Emoji Monotoned in CCLabelTTF

I am using cocos2d-iphone in objective-c. When I use CCLabelTTF to show text, if there are emojis in the text they are also colored to the color of the text and that's not what I want. However when I use UITextView, emojis are good. No matter what…
Chris Liu
  • 79
  • 7
2
votes
1 answer

How can I create a pop-up window using Cocos2d, SpriteBuilder and Objective-c?

So I'm trying to do exactly this: http://blog.typpz.com/2013/12/09/ios-sdk-create-a-pop-up-window/ But since I am not using SpriteKit i can't use this exact method. I imagine that there should be a way to create this same pop up window effect using…
2
votes
3 answers

How would one use Cocos2d to create a game like this

http://itunes.apple.com/us/app/angry-birds/id343200656?mt=8&ign-mpt=uo%3D6 So I am getting started with this all game dev thing on iphone and I decided that I will start playing with Cocos2d as my starting engine. Now just so i have a goal in mind,…
Obaid
  • 4,328
  • 9
  • 42
  • 42