I started to learn Objective-C and use cocos2D about 1 month ago.
I want to replace three different layers by tapping buttons.
At first, I tried to use "CCLayerMultiplex." Then, use "if sentence." But then the layers just overlap or crash when the…
I started experimenting with Cocos2D with Tiled, and had the player sprite and actions coded within a CCLayer along with everything else. Before continuing on, I wanted to subclass the player into a CCLayer, which I hope is correct.
My header and…
Can any one tell me how to move a CClayer. Like DoodleJump when object will move upward the background will also move upward.Plz Explain me with some sample code.
Im building a game using eclipse and now I wanted to use Cocos2d engine. My problem is I want to merge my done program and sliding menu of cocos2d engine. And now my question is how can I extend my Menu Class to Activity class so I can call onCreate…
I want to create a Game Over Pop Up, with two buttons and a high score label etc.. This pop up will be visible when the game over event happens and the gameplay scene will be paused.
I tried to implement a game over scene (a separate GameOver class)…
CCSprite class reference
I need an object in which I can draw and it also has fixed rect size with position. It seems CCSprite has everything I need but it can be initialized with picture only.
CCLayer can be initialized without picture but it…
I have one layer called alayer, and there is a button called abutton, when click the button, another layer called blayer will show in alayer, not replaceScene, please look at the following code,
alayer.m
-(void)abuttonclicked:(id)sender
{
blayer…
I have a CClayer class, called GridLayer I add the gesture recognizers (Pan ,Pinch and Rotate) to the view and it works fine, but if i add a CCMenuItem is paste to the view so is affected by the rotate and pinch gestures , my question is who…
My main screen is Main.ccbi, it contains 3 CCSprite. Now I want that when user clicks on a CCSprite I should know on which he has clicked?
I want to calculate in CCMotionBegin method that on which CCSprite user has clicked.
I have 2 CCLayers that needs to communicate with each other in separate .m files
Level1.m (CCScene with Level1 CCLayer) - Holds tiled map and player sprite
HUDLayer.m (links to top of Level1.m) - Holds all buttons
How can I get the following code…
I have a crashing bug in my app.
It happens in the same place, but not all the time. I haven't found the problem.
Here are two crash logs:
Incident Identifier: EB73AE61-00FB-4282-8F1D-B8ECEC19E02D
CrashReporter Key: …
I have a cocos2d CCLayer class that has both CCSprites as well as UIButtons. I would like the player to be able to touch and drag the UIButtons around on the screen, when the finger is released I want to perform some action.
Here is the snippet of…
In my cocos2d game I am needing to share a common header and footer that will appear on every game layer.
The header contains things like cash, and sprites -- whereas the footer contains CCMenuItem buttons to move between the different game…
I have been trying to implement a standard pinch/zoom on a CCLayer in cocos2d (using the Kobold2D gesture recognisers) but with only partial success.
Below is my code which does make pinch/zoom work, so long as the pinch point doesn't move. However…
I want to know that how can we capture image using AVFoundation framework, I have managed to activate the camera and my Cocos2D view is over the camera and is tranparent. I have tried using some tutorials but I am unable to capture the images( Still…