cocos2d-iphone

How to make a Sudoku iPhone game?

I'm asking a lot of questions and this time I would like to know how to make a Sudoko game for the iPhone, is there anyone with experience from this? Can you help me out? David (newbie with lots of questions) ...

Add cocos2d scene to UIViewController..

Hi, I use the following code to add cocos2d scene to a viewcontroller - (void)viewDidLoad { self.view = [[UIView alloc] initWithFrame:CGRectMake(0,0,320,480)]; if( ! [CCDirector setDirectorType:CCDirectorTypeDisplayLink] ) [CCDirector setDirectorType:CCDirectorTypeDefault]; [[CCDirector sharedDirector] setPixelFor...

cocos2d iphone-4 Updating Image Resource Files problem

hi, Here is my code... CCSprite *u = [CCSprite spriteWithFile:@"1_S.png" rect:CGRectMake(0, 0, 27, 27)]; u.position = ccp((45.7*i+45.7*(i+1))/2, 467); u.tag = i; [self addChild:u]; and in my resource folder i have 2 image files named 1_S.png and [email protected] .As i read the the doc ...

iPhone 4 image resolution and image size

Hi all, I am totally in confusion. Apple told that in iPhone 4 one can use high resolution image... than the standard one.So i use 2 image([email protected] and image.png)... [email protected] has 50*50 dimension and 72 resolution image.png has 25*25 dimension and 72 resolution than when i run the code UIImage *image = [ UIImage imageNamed:...

Game Objects setup in cocos2d + box2d

I am having a design issue, this may be due to the fact that i don't fully understand cocos2d and box2d yet. I want to create game objects that have a CCSprite(image data) and a b2Body(physics), Would i be right to make an encapsulating object that contains both? if i did this this would enable me to make changes to the CCSprite OR ...

Scrolling Background

I'm trying out new things for a simple game in Portrait mode, I want to add a seamless scrolling background to a game, the image is 512x512px. The Main scrolling I want to have is Vertically, but I want to be able to scroll sideways too within the bounds of the image size. How should I go about with this, I'm using cocos2d. David ...

How to restart a level in an iPhone game

I want to restart the current scene i am on. I thought of using replaceScene and replace it with itself. Is that ok to do ? Level2Scene *scene = [Level2Scene node]; [[CCDirector sharedDirector] replaceScene:scene]; Level2Scene is the current scene I am in. Thanks Abhinav ...

Cocos2d Animation Flickering

Hi, I have a sprite which i animate using CCAnimate. the animation is composed of 4 spritesheets that i swap when needed. everything works pretty good except for some flickering when swapping spritesheets. any ideas on what to do? ...

how to provide animation to image in iphone look like flower

hi all, I am making an application in iPhone , in that I want to give animation to my image like Growing from beginning to end and also waving in air, it seems to work like flower, growing from root and also waving in air from left to right smoothly. I don't know how to perform such kind of animation. If any one do have any idea or s...

Cocos2D - AtlasAnimation doesn't work when looping once

Hi, How do I control the speed & flow of an AtlasAnimation? I have the code below AtlasAnimation* animation = [AtlasAnimation animationWithName:@"anim" delay:0.1]; [animation addFrameWithRect:CGRectMake(0, 0, 87, 87)]; [animation addFrameWithRect:CGRectMake(87, 0, 87, 87)]; [animation addFrameWithRect:CGRectMake(174, 0, 87, 87)...

how to do undo on touch events

how to do undo on touch event... I draw a line using touchesBegan,touchesMoved and touchesEnded..... Now I want to do undo operation to get my previous state on iphone.... any one can help me how do undo operations on iphone? thanks in advance.... ...

iphone using cocos2d get EXC_BAD_ACCESS

I am making a simple game project involving the use of Cocos2d. Now as defined by Ray Wenderlich's example, i have completed the whole tutorial but added an extra bit of code myself to check total number of melons, when they reach 3, i replace screen with "You Win" screen to notify the user that he has won using [[CCDirector sharedDirect...

Landscape mode in chipmunk/cocos2D

hi, I'm trying to create a chipmunk space with a bouncing ball.(Example seen here) Currently my device is running in Landscape mode. So according to cocos2D everything is all right. When adding Sprites they orient to landscape mode. [director setDeviceOrientation:kCCDeviceOrientationLandscapeLeft]; The only problem is that the ...

Objective C/Xcode error: The file “Info.plist” couldn’t be opened because there is no such file.

Hi I hope this error doesn't sound stupid. However, I receive this error and I don't know how to fix it. What happen is that I deleted the whole Resources folder before and copied in a new Resources folder. Could anyone help me fix this? Thanks. ProcessInfoPlistFile /Users/tohchinsheng/Documents/cocos2d-output/Debug-iphonesimulator/U...

Couple of questions about Cocos2d and iPhone ??

1- is it possible to use interface builder to design the game background and then use code to add cocos2d objects? 2- Is it possible to use iphone UI objects as well as cocos2d objects, for example uibutton, uiScrollView, etc. 3- is it possible to useiphone default template, and cocos2d templates togather? for example my home screen is...

UIKit and Cocos2d in one application

hi, i've a huge problem.. I want to use both cocos2d and UIkit frameworks in one application, here is the scenario: user log in, via UIkit, then play a game written in cocos2d, and after that the actual uikit ordinary application starts. the problem is that, after starting cocos game, i'm unable to return to uikit view-based application....

Cocos2D - How to get a label's value

Hi, How can I get the value of Label? I'm able to set value using [label setString:[NSString stringWithFormat:@"%d", val]]; Trying to find the reverse of that, i.e grabbing the string value. Thanks, Tee ...

creating CCTMXLayer dynamically

Hello everyone, I try to create my own tile map dynamically such as some buildings created with the help of database. I try to use CCSprite on object layers. However, when i scroll the map, also CCSprites' move too. I don't want to move all of the Sprites whenever player scrolls the map. (For performance issues) Then, I decided to creat...

Best Framework for RPG/RTS Platform Dev?

Just starting off on iPhone development and I'm looking for some input as to the best platform/framework upon which to build at the moment. I've looked at various options a year or so ago such as cocos2d, unity, and others, however I'm looking for some more current input from those in the trenches. I am starting on an RTS Diablo-esque ...

IPhone-Cocos2d: How to make a CCLayer that reflects another CCLayer

how can i create a new layer, that represents another layer i already have on the screen, just in a different position&scale? Imagin it something like a minimap, that represents the current map the player is in, just that it is smaller, and appears on the edge of the screen and much smaller. ...