Cocos2D is a Python based open source framework for building 2D games and graphical applications for Windows, Mac and Linux desktop computers. Cocos2D is published under a BSD license.

learn more… | top users | synonyms

0
votes
0answers
4 views

Chartboost moregames page

How to avoid duplicate games entry in chart boost more games section? Here is my code, and added more than one campaign to fill entries….is there any way to restrict duplicate? ...
0
votes
0answers
3 views

Cocos2d insert sprite (child of layer) between other children without z management

Imagine a pack of cards seen from above (this is a metaphor, not the real thing). What I do currently is adding cards on top of another to my layer using addChild. This is one of the rules of drawing ...
0
votes
0answers
27 views

Filenotfound Exception after resizing .png image

i have an .png image so according to my requirment changed the size, but now in the logcat i'm getting filenotfound exception even though the image is in asset folder, and also there is no capital ...
0
votes
1answer
17 views

CCParticleSystemQuad removed prematurely - ios

I have an ios app that uses cocos2d v1.1.0-beta2b, and encountered a very strange condition with emitters' auto removal. My question is: Is there any way that an infinite duration ...
0
votes
0answers
9 views

Advanced Spritesheeting - using a spritesheet in multiple classes

So after taking a little break after being very frustrated for months on end with this issue, I am now back and attempting to solve my issue once and for all. I’m not going to post code, because the ...
0
votes
1answer
21 views

updating a box2d fixture position frame-by-frame for an animation

The sprites I am using in my game have complex shapes and animations. Also I'm only interested in setting contact listeners for certain parts of the sprite. I would like to set fixtures for the ...
0
votes
1answer
15 views

Multiple Object creation in Cocos3d

I am creating here 3 objects using a for loop .But touch event is only available to one object.Please find a solution for this ... for(int i=0;i<3;i++){ nodef = [CC3PODResourceNode ...
0
votes
0answers
21 views

calling a method when a particular CCAnimationFrame is displayed using CCAnimationFrameDisplayedNotification

I would like to call a method that rotates a sprite when a particular frame in displayed. I got a few ideas from this post but I am having issues as to how I should implement it. How would I define my ...
0
votes
1answer
18 views

How to use activity in cocos2d-android?

i'm currently working on cocos2d-android project where the interaction between the sprite is done using 'scenes' havent used xml files, so now to do some other tasks i'm using xml layout files on ...
0
votes
0answers
14 views

How Can we rotate the ENDLESS SCROLLING of background from downward to Upward in cocos2d android?

private void animateBackground() { _oddBackground = CCSprite.sprite("sky.png"); _evenBackground = CCSprite.sprite("sky.png"); /*from Upward to Downward direction background rotation */ ...
0
votes
0answers
20 views

Changing the color of an entire tile layer in Cocos2D for iOS

In Coco2D, I can loop through every tile, and apply a color to each tile individually. Problem is, that it is slow loading the map. if([blocksCollidable tileAt:tileCoord]!=nil){ [blocksCollidable ...
0
votes
2answers
18 views

Cocos2d not automatically detecting @2x retina sprite images

Whenever I use sprite = [CCSprite spriteWithFile:@"image.png"]; Cocos2d has always been intelligent enough to look for "image.png" on non retina devices and "[email protected]" for retina devices. But ...
0
votes
1answer
154 views

Avoiding parallel arrays with Objective-C and C++

Some context: I am writing a 2D Destructible terrain library for Cocos2D/Box2D which involves a hybrid of C++ and Objective-C. I recently encountered a situation that has stumped me where I can't ...
0
votes
2answers
28 views

How can I rotate ( moving ) the Background cocos2d-android?

I have a background and I just want to repeat my background From : 1.) Upward to Downward Direction 2.) Downward to Upward Direction 3.) Right to Left Direction 4.) Left to Right Direction What ...
0
votes
0answers
10 views

Everyplay: preloadBackgroundMusic and playBackgroundMusic crash with message “no other audio is playing”

I'm developing a game using cocos2d + box2d I have removed CocosDension and SimpleAudioEngine thinking that was the problem, but when I try to preload a background music (or try to play it without ...
0
votes
0answers
33 views

Apportable conversion VerdeActivity error

Hi all and thanks in advance, i'm new with apportable and i'm trying to port my iOS app. I can build the app with no error but when i try to "load"(apportable load) or "debug" (apportable debug) on ...
0
votes
2answers
27 views

move sprite from point to point at same speed

What I am doing is when I drag my finger on the screen, it stores the points into an array using ccTouchesMoved(CCSet* touches, CCEvent* event). that works Then in the update method if have it call ...
0
votes
1answer
29 views

Reskinning Cocos2d iOS/iphone/ipad app : Cant replace images with TexturePacker

I have source code of a iOS game built in cocos2d and working on reskinning it. Optimized sprite sheets are made by TexturePacker which are generated by script and are taken from .plist file. While ...
0
votes
0answers
21 views

Cocos2d 2.1 with CCLayerPanZoom : _scheduler not found

I started upgrading cocos2d sdk from Cocos2d 2.0 to Cocos2d 2.1 (COCOS2D_VERSION 0x00020100) For CCLayerPanZoom it is showing error. I just took new CCLayerPanZoom and still same error Here is ...
-1
votes
0answers
32 views

How to update int value from singleton in cclayer? [on hold]

I’d like to know if there is any way to update a int value in my singleton from a cclayer? Eg: Having my cclayer calculate the angle and then tell my singleton a current int value to store.
0
votes
0answers
23 views

Continuous rotation of sprite in cocos2d android

To make the sprite rotate by 180, i'm using CCTouchesMoved() and related code within it, but when the sprite is moved, it continously gets rotated by 360 deg not on touch move, behind the gun sprite ...
0
votes
1answer
6 views

Best way to have animated background in cocos2d

I have seen some similar questions asked but no definitive answer. I have a background image that I'm using for my main menu for a cocos2d game. I plan to have it animated but not sure what is the ...
1
vote
0answers
17 views

BPM detection in iOS

Is there any way to do BPM detection that anyone knows of inside cocos2d or directc? Does that, as a concept, even make sense? I'm wondering why I've never seen any mp3 visualizers on iPad.
0
votes
1answer
5 views

Changing texture: unexpected scale results

I can't get my head around what's going on here and I know I'm being stupid, but here's whats going on: I have two images, one is 1024x768, one is 2048x1536. They are "background" textures. I'm ...
3
votes
1answer
46 views

How to limit frame rate to 30fps in OS X with Cocos2D

I'm porting an iOS game of mine over to OS X, using Cocos2D 1.0.1 (results are the same in Cocos2D 2.0), and I'm having trouble limiting the frame rate to 30fps. Calling setAnimationInterval limits ...
1
vote
0answers
16 views

cocos2d & CAShapeLayer objects

My class X is interited from CCLayer. @interface X : CCLayer Then in X, I added an instance variable of type CAShapeLayer. CAShapeLayer *_Circle I drew the Circle using UIBezierPath. Now if I ...
0
votes
2answers
28 views

passing userData via ccmenuitem with ARC enabled

I'm trying to pass an NSString via a menuitem using the following code CCMenuItem * buyButton = [CCMenuItemLabel itemWithLabel:buyLabel target:self selector:@selector(buyItem:)]; buyButton.userData = ...
1
vote
0answers
18 views

How to remove sprite after the completion on Animation?

I am using the CCAnimation class for using animation with more than one CCSprite . What I want is : " Just Remove the sprite after the animation complete " If anybody work on this, Please Let me ...
0
votes
1answer
18 views

set cocos2-x project to portrait orientation

I am trying to set up my project with portrait orientation, but I am just getting landscape. I am using cocos2d-x (2.1.4). I have set, as said here: At RootViewController.mm: - ...
2
votes
2answers
85 views

how to determine when specific animation frames are running

I would like to know when certain frames of an animation are running in order to set various conditions. In the code below, how can I use a counter or set conditions to determine when specific ...
-2
votes
0answers
10 views

What is the best way updating from cocos2d 0.99 to 2.1 lastest version

I developed a project by cocos2d 0.99 version. Now I must update that lastest cocos2d engine. I tried many time for updating engine... But It just feel like in the hell.. Somebody Help me some ...
-2
votes
0answers
17 views

Unable to fetch products from iTunes? [on hold]

I am facing a strange behaviour while fetching products from iTunes. Though it was working fin till yesterday but after that I am not getting response from iTunes. I am making an ipad game for China ...
1
vote
0answers
15 views

How to add NSTableView to a CCLayer in cocos2D

I'm developing an App. It is compatible with iOS and MacOS. Obviously I'm using preprocessing definitions to establish some code conditions. I'm using Cocos2D. (v.2.1) My question is related to ...
0
votes
1answer
25 views

Running two Cocos2D action sequences at the same time not working

I am attempting to move the camera with two action sequences in a box2d world. The objective is to have a smooth transitions that lets the user see the whole game space as the camera pans. The first ...
-2
votes
0answers
12 views

View's background color set to clear color but still shows up to be black [on hold]

1.Call custom xib file from cocos2d layer 2.xib file got two view,let say:A and B,A is the background View,B embed to A,and i set A's background color to clear color,Only need B to be visibile 3.also ...
2
votes
0answers
29 views

Cannot instantiate the type class name in cocos2d

I created new class and added scene in cocos2d-android but in main class getting this error in class name Cannot instantiate the type Trr where Trr is the name of the class. by googling i found the ...
0
votes
1answer
10 views

CCFollow does not stopping following

Hi this is my first question in cocos2d! I am using this code to follow the ball : [self runAction:[CCFollow actionWithTarget:ball]]; i need a code the action will be stopped before we can see a ...
0
votes
1answer
26 views

two contact listeners? (iOS, cocos2d, box2d)

I am develop game using cocos2d and box2d.This game have some similarity with angry birds (not so much, but i hope it helps me to explain my question). I have special objects that I throwing (like ...
2
votes
0answers
22 views

How to implement in-app purchase in cocos2d android

I implemented a game using cocos2d android and it is almost getting done. I stuck at implementing in-app purchase for it. I searched all the way in google. but not found any clue to do it using ...
0
votes
2answers
42 views

Is there anyway to “cast” a CCSprite into a subclass?

I have class "Character," which is a subclass of CCSprite. "Character" has only one property, int "extraTag." I am using method getChildByTag:, which returns a CCSprite casted into a CCNode. What I ...
0
votes
0answers
14 views

Cocos2D SpriteBatchNode vrs. SpriteFrameCache… I do not see any performance difference

I have tried using both ways... adding the .png file on the cache with SpriteFrameCache.. adding .plist with spritebatchnode adding the correspoding .png file, I didnt see any performance ...
1
vote
1answer
46 views

understanding sprite sheet memory consumption

I would like to know how each of the marked lines of code affect memory consumption. Given that my sprite sheet takes say 4MB in memory. CCSpriteBatchNode *spritesBgNode; // Line 1 spritesBgNode ...
0
votes
1answer
35 views

How to make HTML5 Canvas full page size with Cocos2D

I'm new to Cocos2D-HTML5 (and HTML5 itself) and I'm trying to get the canvas to be the full size of the page. I'm confused by how few issues are documented about this on the internet, so I hope it's ...
0
votes
2answers
24 views

Restarting default cosos2d project causes “Thread 1: signal SIGBRT 1” error

I want to create a game using Cocos2d in Iphone 6.1 simulator but when I create the default probject and tries to run it it starts up fine. But if I just restart it a couple of times i crashes and ...
0
votes
0answers
15 views

Getting a reference to my CCLayer from UITableViewController

I am adding a UITableViewto my game by using a UITableViewController<UITableViewDataSource, UITableViewDelegate> and using the delegate’s – (NSIndexPath *)tableView:(UITableView ...
0
votes
1answer
13 views

ccsprite rotation offset when it rotates to touch location

I'm rotating a sprite(rect) to face the touch location on the screen. The code works but there is an offset of a couple of degrees that becomes bigger the more vertical the sprite gets. I have added ...
3
votes
5answers
40 views

Issue with switch case in android

In order increase the levels after 10 ProjectilesDestroyed, i have set switch case, where for the 1st level after 10 projectiles Destroyed 2nd level is displayed but from 2nd level its increased for ...
0
votes
0answers
11 views

CCScene's Animation hangs up while touching view added in CCDirector's view [duplicate]

Again I have come up with a head scratching issue. Hope you geeks can pull me up. I have few objects moving randomly in my MainScene via CCMoveTo method and I am adding a UIView in the CCDirector's ...
0
votes
1answer
36 views

cocos2d landscape game present portrait viewcontroller

my game uses cocos2d landscape mode. when I need to present view controllers, they are also in landscape mode, for example, game center and store view controller. Store view controller works for ...
1
vote
1answer
33 views

changing box2d body fixtures during an animation

I have read a few posts that confirmed that a b2body's shape can be destroyed and recreated though none of them showed how. Also I want to change the fixtures during my animation. Not during every ...

1 2 3 4 5 90
15 30 50 per page