Tagged Questions
0
votes
1answer
79 views
Cocos 2d move CCsprite in array of points [closed]
I need a CCsprite to move to the points in my array those points will form a circle.I know to move CCsprite but my app crashes when i make it to move in array of points. Help me where i am making ...
0
votes
1answer
28 views
Set texture of a LHSprite that is loaded from LevelHelper
How do i set the image/texture of an LHSprite that is loaded into xCode using levelHelper & spriteHelper?
I am using sprite sheets. So i tried to load the image the old fashioned way using ...
1
vote
1answer
118 views
opengles display human face in iphone and animate it?
I need to make a human 2D face to 3D face.
I used this link to load an ".obj" file and map the textures. This example is only for cube and pyramid. I loaded a human face ".obj" file.
This loads the ...
0
votes
1answer
154 views
Using depth buffer on a sprite
I am following this guide:
http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:tiled_maps
Trying to create a tiled map that also supports multiple layers. The guide says that a way is to use ...
0
votes
1answer
102 views
DPad style movement for AI without using A*
What is the easiest way to implement DPad style movement (No diagonal) for AI without using and A* algorithm? I thought about having the enemy catch up to the player in the Y axis first then the X ...
3
votes
4answers
244 views
What is technical specs for iOS platform for a game?
I would like to know when a contractor ask you for a technical specs for iOS platform of a game, what's the description that you should give back to him?
1
vote
3answers
447 views
Wait till all CCActions have completed
I am developing a simple cocos2d game in which I want to animate two CCSprites simultaneously, and for this purpose I simply set CCActions on respective `CCSprite's as follows.
[first ...
0
votes
1answer
138 views
Copies of GameScene created when called additional times
UPDATE: It no longer crashes after removing [self removeAllChildrenWithCleanup:YES]; from onExit. The artifacts still remain though.
UPDATE 2: Found my problems. See my answer below.
I have a game ...
0
votes
1answer
217 views
Admob banner not getting remove from superview
I am developing one 2d game using cocos2d framework, in this game i am using admob for advertising, in some classes not in all classes but admob banner is visible in every class and after some time ...
2
votes
1answer
239 views
Wheel rotation, to change velocity of vehicle
I update the velocity of my vehicle like so:
[v setVelocity: ((2 * 3.14 * 100 * (wheel.getRotationValue / 360) / 30)) * gameSpeed]; // update on 60 fps this gets velocity on all frames divide by 60 ...
-2
votes
1answer
566 views
How change the size of sprite in cocos2d?
I want to change the scale of sprite like a paper in 'Paper Toss' game.
'Paper Toss' is the game is available on the App store. I want to make a sprite like a paper and change the scale of sprite ...
-1
votes
2answers
323 views
Good open source iOS games? [closed]
I would like to see how things are done in modern iOS games, I am especially interested in Cocos2D games.
I need a game that will compile (warnings are ok) and since most of the project I have seen ...
1
vote
1answer
198 views
Touch area double sized on newer device
I am developing a universal puzzle game, in which I have used separate image for iPhone4 and for iPhone3, iPhone4 image is double in size of iPhone3 image. My issue is for iPhone4, touch area of image ...
1
vote
2answers
254 views
How can I make a rectangle to an irregular shape?
I used masking for breaking an image into the below pattern. Now that it's broken into different pieces I need to make a rectangle of each piece. I need to drag the broken pieces and adjust to the ...
1
vote
0answers
209 views
Design pattern for procedural terrain assets
I'm developing a procedural terrain class at the moment and am stuck on the correct design pattern. The terrain is 2D and is constructed from a series of (x,y) points. I currently have a method that ...
3
votes
1answer
306 views
Xcode workspace with Unity3D as a sub-project?
Let's say we're developing a 2D game with Cocos2d-iPhone and UIKit and CoreAnimation. But we're also considering leveraging the 3D capabilities of Unity 3D.
Is it possible that we add the ...
0
votes
1answer
1k views
How to simulate a water splash effect?
I need to achieve the effect of a ball falling down into a pool then splashing in the water.
At first, I made a sensor to detect the collision between the ball and the water and then show the sprite ...
0
votes
1answer
374 views
Store and create game objects at positions along terrain
I have a circular character that rolls down terrain like that shown in the picture below.
The terrain is created from an array holding 1000 points. The ground is drawn one screen width infront and ...
1
vote
1answer
455 views
How To show document directory save image in thumbnail in cocos2d class [closed]
I have just implemented multiple photo selection from iphone photo library and i am saving all selected photo in document directory every time as a array, now i want to show all saved images in my ...
0
votes
1answer
282 views
Triangles in a C++ STL Vector as an Objective-C member sometimes draws incorrectly in OpenGL ES
The polygons draw correctly 80% of the time. When it fails, a vertex is dislocated. The polygon is consistently drawn with the wrong vertex. I checked that the vector is correct during initialization, ...
2
votes
2answers
505 views
Issue with removing sprites on collision
I'm trying to make a very simple collision detection procedure just for test purposes.
The problem is with the send/receive information between functions
I have these lines on the update method ...
0
votes
1answer
117 views
CCSprite x and y comparison
I have 2 CCSprites and I want to tell if their x and y are equal I tried this:
if(sam.position.x == tom.position.x && sam.position.y == tom.position.y){
NSLog(@"Hooray!");
}
Although I do ...
0
votes
0answers
154 views
Schedule update problem
This might sound pretty straightforward. I've created a method and I've called it as below in the init method.
[self createNewSpr:ccp(s.width * 0.25,s.height-200)];
[self createNewSpr:ccp(s.width * ...
4
votes
1answer
841 views
How do I break an image into 6 or 8 pieces of different shapes?
I am working on puzzle game, where the player can select an image from iPhone photo gallery. The selected image will save in puzzle page and after 3 second wait the selected image will be broken into ...
0
votes
1answer
355 views
Thread-safety in Cocos2d-iPhone?
After tinkering a bit with cocos2d, I discovered that there is no classic game loop and everything is more-or-less event driven. I guess I can wrap my head around that, no problem.
But I cannot find ...
1
vote
0answers
245 views
Zoom Layer centered on a Sprite
I am in process of developing a small game where a space-ship travels through a layer (doh!), in some situations the spaceship comes close to an enemy space ship, and the whole layer is zoomed in on ...
5
votes
3answers
1k views
How to achieve uniform speed of movement on a bezier curve?
I'm trying to move an image along Bezier curve. This is how I do it:
- (void)startFly
{
[self runAction:[CCSequence actions:
[CCBezierBy actionWithDuration:timeFlying bezier:[self ...
1
vote
3answers
2k views
How do I save data to the iPhone properly and securely?
I'm creating a game using Cocos2D (objective-c) and it has come to the point where I have to save data to local storage, like high scores and similar stuff.
I know that NSUserDefaults is not a good ...
2
votes
3answers
483 views
How do you maintain content size vs. content quality in a mobile application?
I am developing my first Cocos2d iPhone/iPad game that includes quite a few sprites, I would need approximately 80 different. As this is for both normal and HD displays I have 2x of each sprite. I am ...
1
vote
1answer
276 views
Objective - Gestures while finger touches screen
I'm creating a space cocos2d game with objetive-c. I have in the bottom left 2 arrows to move the sprite left or right. I also implemented a swipe gesture to change weapon, however it only happens ...
0
votes
2answers
658 views
Cocos2d: Adding a CCSequence to a CCArray
I have a problem with an action performed by a sprite. I have one CCSequence in a CCArray and I have an scheduled method (is called every 5 seconds) that make the sprite run the action. The action is ...
2
votes
1answer
840 views
Best Method to Create Side Scrolling Levels? - Cocos2D
I am looking to start my first side scroller project using Cocos2D, but I am curious. What is the preferred/best method of creating you levels? For large levels I see hand making it very laborious, is ...
0
votes
1answer
1k views
b2Body moves without stopping
I got a quite strange bug. It is difficult to explain it in two words, but i'll try to do this in short.
My b2Body has restitution, friction, density, mass and collision group.
I'm controlling my ...
2
votes
1answer
455 views
How can I stop the next screen from briefly displaying at the start of a CCTransitionFadeTR?
I am testing transitions in cocos2d, and am running into a problem.
I have a MainMenu screen which contains a button. The idea is that clicking on the button will trigger a CCTransitionFadeTR ...
3
votes
1answer
281 views
Cocos2d — Check if place is free before moving (all objects)
Is there a method in Cocos2d like CGRectIntersectsRect, except instead of limiting it to one sprite, it checks for ALL objects?
4
votes
1answer
662 views
Cocos2D-iPhone, how does the Game Loop work in Cocos2D?
Could anyone theoretically explain how the game loop works in Cocos2D and Objective-C?
If you need me to be more specific about what I'm asking, please read on.
I've got a rudimentary understanding ...
-2
votes
1answer
1k views
To move the object (sprite) in all direction with constant speed in touch direction and to follow the touch path
I am developing this game in cocos2d.
I want to move a object(airplane) in all direction with constant speed and it should move and flip in the direction of touch point and it should follow path make ...
0
votes
1answer
2k views
Cocos2d CCSpriteFrameCache: couldn't load texture file
I am currently doing this Cocos2d tutorial: http://www.raywenderlich.com/1271/how-to-use-animations-and-sprite-sheets-in-cocos2d
...and get the following error messages:
2011-12-30 16:36:28.536 ...
1
vote
2answers
2k views
Cocos2d Composition using CCSpriteBatchNode
I'm making a game in objective-c using cocos2d. I have the following:
@interface Player : CCNode
{
CCSprite *mySprite;
CCSpriteBatchNode *sceneSpriteBatchNode;
//...
}
@property ...
1
vote
2answers
998 views
How to animate a flip of a card in Cocos2d?
I am working on a card game and would like to ask if someone could advice me how to implement a flip of a card in Cocos2D?
2
votes
1answer
1k views
Objective-c Cocos2d moving a sprite
I hope someone knows how to do the following with cocos2d:
I want a sprite to move but not in a single line by using
[cocosGuy runAction: [CCMoveTo actionWithDuration:1 position:location]];
What ...
1
vote
1answer
827 views
Detecting right/left collisions with a bounding box
I'm building a platformer in cocos2d, my first game project. I'm working on movement and collision detection. I'm using a tilemap with a "meta" layer of invisible blocks that are designated ...
-1
votes
1answer
600 views
Help: -[GameScene spiderBelowScreen]: unrecognized selector sent to instance 0x257f50
I am currently doing the tutorials in the book: "learn iPhone and iPad cocos2d Game Development" by Steffen Itterheim and have been running into problems with the code for the DoodleDrop tutorial, ...
1
vote
3answers
2k views
How to determine an irregular area of a CCSprite?
In my simple game I use boundingBox for pick coins and other stuff, but I need use irregular area detection of Sprite(with out Alpha)... There is alternative to boundingBox?
Here is code:
...
1
vote
1answer
1k views
Count number of CCSprite added to a CCLayer
Does cocos2d has a method that returns the amount of CCSprites added to a CCLayer?
A have SceneControlLayer object, and I added some CCSprites to it.
@interface SceneControlLayer : CCLayer {
}
...
0
votes
1answer
986 views
How to make the accelerometer work in different angles
I am working on some Cocos2D tutorials (doodle drop) and have downloaded the program on my device. The program is working but I have to hold the iPhone in a very specific, and not very good, angle to ...

