cocos2d

Loading Data Files on iPhone?

What is the best way to load static data files containing game level maps on the iPhone? I have seen some use XML files, but that seems like overkill in my situation as the data files merely determine the layout of the game's level, ie where obstructions will go. Also, what project directory should they be stored in? Thanks in advance...

IPhone and Cocos2d Sprites/Layers

I am using cocos2d-iphone to place Sprites onto a Layer to setup a game playfield. At certain points in the game, certain Sprites need to be removed based upon game conditions. What I would like to do is setup an array of Sprite pointers, but I have two questions: What's the best way to place Sprite pointers in an array? How does o...

Best way to display a game score on iPhone with cocos2d?

I am looking to persistently display a game score in an iPhone app using cocos2d. Going off the code that cocos2d shows the FPS the app is running at: -(void) showFPS { frames++; accumDt += dt; if ( accumDt > 0.1) { frameRate = frames/accumDt; frames = 0; accumDt = 0; } NSString *str = [NSString st...

How can I get a value from UITextField in UIAlertView ?

I have Used in cocos2d game engine. this is my code: -(void)timed1: (id)sender { UIAlertView *dialog = [[[UIAlertView alloc] init] retain]; [dialog setDelegate:self]; [dialog setTitle:@"Enter Time:"]; [dialog setMessage:@" "]; UITextField *nameField = [[UITextField alloc] initWithFrame:CGRectMake(20.0, 45.0, 245.0, 2...

How can get the value of text field by a alart view using cocos2D ?

I am trying to develop a application by using cocos2d. I can't getting value from textfield . How can get the value of text firld (in a alart view) by using COCOS2D ? -(void)timed1: (id)sender { UIAlertView* dialog = [[[UIAlertView alloc] init] retain]; [dialog setDelegate:self]; [dialog setTitle:@"Enter Time:"...

How can I create a count down Timer for cocos2d ?

Hello, I am developing a 2d iphone game by using cocos2d. I need a countdown timer. Plz tell me, How can I create a count down Timer in cocos2d ? ...

how can fixed maximum character of a text field in objective c + cocos2d ?

how can fixed maximum character of a text field in cocos2d ? ...

IPhone app terminating due to uncaught exception

HI, I am developing a iphone app by using cocos2d. Its shown this msg. 2009-01-26 16:17:40.603 Find The Nuts[449:20b] *** -[NSCFArray onTimer:]: unrecognized selector sent to instance 0x59be030 2009-01-26 16:17:40.605 Find The Nuts[449:20b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFA...

QuartzCore.framework problem

I am trying to use QuartzCore Framework but when adding this framework to my iPhone application, I am told that the files (e.g. CIColor.h and others) are missing but those missing files exist on my hard drive under /system/library/ In addition to the QuartzCore Frame work, I am using the following frameworks: cocos2d, cocoa.framework, o...

TextField with Keyboard in cocos2d !

hello, I am trying to develop a iphone app by using cocos2d. I create a alert view with a text field. when I touch the text field then comes the keyboard. But I want that when the alert is open, in the same time textfield will be selected and keyboard comes(without any touch). how can it posible ? sorry for my bad English. ...

how can I use animation in cocos2d ?

hello, I am trying to develop a Roulette game for iPhone. How can I animation (spin) the Roulette board? ...

fetching database from MySQL to SQLite

Hello, i am trying to complete an iphone app. And for this i need to fetch a database from MySQL to SQLite. for this case i did use some code like bellow- MCPConnection *theConnec; MCPResult *theRes; //initialize connection string vars NSString *dbURL = @"XXXXXX"; NSString *userName = @"XXXXXX"; NSString *pass = @"XXXXXX"; //open conne...

how can i get alert view action

UIAlertView* av = [UIAlertView new]; av.title = @"Dealer offer Insurence"; [av addButtonWithTitle:@"YES"]; [av addButtonWithTitle:@"NO"]; Which button user select how can i know ? If anyone have available solution then help me. I want to some work on these button action. I wait one response..... ...

how we can show UIViewController and UIView by using cocos2d?

Hi, i am trying to build an iphone app by using cocos2d. but i have used four types of classes like bellow- @interface MenuScene : Scene {} @end @interface FlipView : UIImageView { CGPoint startTouchPosition; NSString *dirString; UIImageView *firstPieceView; UIImageView *secondPieceView; } @end @interface HelloCont...

how can inherite two classes at same layer?

Hi, i am new at the area of iphone. i am trying to build an iphone app by using cocos2d. i have used this type of classe like bellow- @interface MenuScene : Scene {} @end @interface FlipView : UIImageView { CGPoint startTouchPosition; NSString *dirString; UIImageView *firstPieceView; UIImageView *secondPieceView; }...

how i can set an image to another fixed position by touch option?

Hello, i am trying to build an iphone app by using cocos2d. and i would like to set an image to another fixed position from a fixed position by using touch as my wish(speedy, or slowly). i have got some code but it does not work properly. so freinds it will more helpful to me if i get any solution. ...

"scheduledTimerWithTimeInterval:" problem in cocos2d ?

hello, I am trying to developed a iPhone app by using cocos2d. I using "scheduledTimerWithTimeInterval" for calling a method that called a fixed time interval. But now time interval increases in gradually. for this reason the time is slow in gradually. here is my code: - (void) methodTime: (id) sender{ NSTimer *rat =[NST...

UITableView with cocos2d

hello, i am a learner at the area of objective c. i am trying to build an iphone app. and here i have used cocos2d. now i would like to use UITableView for showing data from XML file. Now it is my question that , is it possible to use UITableView with cocos2d and is it also possible to retrive data from XML file. ...

remote database connection with my iphone application using cocos2d

MCPResult *theResult; MCPConnection *mySQLConnection; //initialize connection string vars NSString *dbURL = @"192.168.0.16"; NSString *userName = @""; NSString *pass = @""; int port = 3306; //open connection to database mySQLConnection = [[MCPConnection alloc] initToHost: dbURL withLogin:userName pass...

How do I change the color of a Cocos2d MenuItem?

[MenuItemFont setFontSize:20]; [MenuItemFont setFontName:@"Helvetica"]; //I'm trying to change the color of start (below item) MenuItem *start = [MenuItemFont itemFromString:@"Start Game" target:self selector:@selector(startGame:)]; MenuItem *help = [MenuItem...