cocos2d-iphone

Problem with facebook login page and iphone keybord?

Hi All, I am developing a game in cocos2d in which I have to connect my iphone game with face-book. for that I have code FBLoginButton *button=[[[FBLoginButton alloc]init] autorelease]; [[[Director sharedDirector]openGLView] addSubview :button] ; when I click on button face-book login page is display. when I click on Username t...

Image stretching

Hi All, I want Stretch a image. For that i use sprite. I want stretch sprite & this stretching is may be Circular or curve animation. I don't understand what methode used for that. Can anyone help me? ...

How do i use cocos2d with Xcode?

Hi, I downloaded the lastest version of cocos2d but I am confused as to how to use it with my current project. Can anyone show me how to use it with xcode. I'm looking to design a 2D maze. Do i have to import something ? Any sort of help would be appreciated. ...

How to draw a human character using Cocos2d?

Hi, I'm new to Cocos2d and was wondering if anyone can show me how to create a human character or any type of character using Cocos2d for my iphone app. Also show me how to get started with a maze would be helpful. THanks ...

Check if drawn path/CGPath intersects itself in an iPhone game

I have a path drawn in OpenGL ES. I can convert it to a CGPath if needed. How would I check if it intersects itself (If the user created a complete loop)? ...

in cocos2d how can I create an array of sprites and put in a map pattern?

trying to create a space invaders game and putting the sprites in an upside down pyramid. I found this idea of using an array with a matrix to hold the pattern. array[3][5] { 11111 01110 00100 } the array has 3 rows and 5 columns. the 1's are the ships and the 0's is blank. can some...

Problem with touch in cocos2D

Hey guys, i ready many many questions about that point, but i really didn't get the right one yet. So.. this is the problem.. This is my first project with cocos2d, so sorry for that. I have one scene called Gameplay inside that i have one Layer with the name Grid and inside of this grid, have many many Block (Layer too). I need chec...

own component... functions wont work

hi, i tryed to create a own GUI component with cocos 2d... i haved written a class (extends Sprite) ... this class initialize with graphics and a lable... if I create an instance of my class .. i can see my component but i can user any functions... i wrote a setLabel function .. but the lable change... i create a instance with this cod...

My code either leaks and works, or doesn't leak and crashes. This doesn't seem like an autorelease problem...

After I finished coding the difficult parts of my game, I found some memory management bugs. objects is a NSMutableArray holding a custom class. - (void) spawnObjects { for (int index = 0; index < INITIAL_OBJECTS; index++) { [objects addObject:[[[MatchObject alloc] initWithImageNameID:(index % 3)] autorelease]]; ...

How to change the image in a cocos2d sprite from an array?

Hello! I'm trying to change the image that a sprite from an array is displaying. Here is the code I'm using: ((Sprite *)[enemiesArray objectAtIndex:index]).image = baseImage; I get the error message: error: request for member 'image' in something not a structure or union What am I doing wrong? Thanks for reading. ...

Better way to check an area touched rather than just a rectangle

Just wondering if there was another way to check a touched area using a polygon of a particular shape rather than just using CGRectMake. Here's the same code for this example: CGPoint location = [[Director sharedDirector] convertCoordinate: [touch locationInView: [touch view]]]; CGRect mySurface = CGRectMake(x, y, temp.contentSize.widt...

iphone cocos2d sprites disappearing

I've been working on a game and implementing the physics stuff with chipmunk. All was going fine on the cocos2d part until the integration with chipmunk. A bit of background: The game is a game with blocks. Levels are defined in a property list, where positions, size of the blocks, gravitational forces, etc., are all defined for each bl...

input a string then return it compressed(deflated) using zlib.h

Greetings It sounds easy, but it's giving me a hard time. I am trying to create a method that inputs a string then return it compressed(deflated) using zlib.h (the one from zlib.net) I've read the zlib.h a couple times, no success :/ I think I need to use the deflateInit2() function, but woah, look at its complex definition: #define ...

How do you do an equivalent scaling call in cocos2d as this Core Animation scale?

I'm looking for something that does a similar call, but using cocos2d... the idea is to enlarge the sprite and then fade it out... Here's is a similar call in core animation: [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:ANIM_NORMAL]; someView.alpha = 0.0; someView.transform = CGAffineTransformMakeScale (3.0, 3....

How to change the app preference settings through code?

Hi All, I have listed my app in the device setting app.Now I can change my app settings through the device app settings app. Now what I am trying to do is the reverse. I am trying to make a app so that it can itself change its preferences in the device settings app if I change the preferences of my app from within the app. Any ideas Fri...

How to add cocos 2d in application? - iphone dev

Hello! I am the "From Scratch / Beginner / new bie - Game Developer for iPhone". I would like to develop a tetris like game in iPhone. I have started with following link. http://monoclestudios.com/cocos2d%5Fwhitepaper.html I am using iPhone simulator 3.0. & xCode 3.1.3. I have followed each step correctly. However error occurs. Don...

Releasing a CocosNode and adding its children to Layer in Cocos2d

I'm working on a Tetris clone in Cocos2d for the iPhone and I'm using a Block class of Sprites for the individual blocks and a Tetromino CocosNode class that the user controls in order to move the Blocks. All of these Blocks move around in a 20 by 10 grid of empty Blocks on the GameBoardLayer. When the block finishes falling, I'd like ...

Guide for Cocos2d and Box2d on iphone?

I'm new to the world of game programming but wanted to build a simple physics-based game for the iPhone. Does anyone know of any tutorials for Cocos2D and/or Box2D on the iPhone? The documentation is kind of confusing. ...

Moving Sprites (more then one) at a time

From my Question here, http://iphonegamedev.stackexchange.com/questions/82/moving-sprites-more-then-one-at-a-time -(void)moveBox:(NSTimer*)myTimer{ float endx=[[[myTimer userInfo] valueForKey:@"endX"] floatValue]; float endy=[[[myTimer userInfo] valueForKey:@"endY"] floatValue]; float timing=[[[myTimer userInfo] valueForKey:@"ti...

Box2d Documentation - Outdated, any better api refs?

Hi guys, I am working with cocos2d + box2d and as I look through the 'Hello World' tutorial and attempt others I am finding many constructs which do not seem to be documented in the latest api ref. Would anybody be able to shed some light on what's going on? or point me in the right direction to someone who has covered the new construc...