cocos2d-iphone

c and objective-c variables

Hi all, Let me see if I can articulate what I'm trying to do... I'll distill it to the core issue. I have an objective-c program and a c callback function. The context is I am using cocos2d and chipmunk physics with the iphone sdk. What I am trying to do is update "score" upon a collision between a bullet and a monster. Everything works...

Cocos2D - problem with moving CCSprites

I need make active background which consists of 2 CCSprites which moves successive. But at the same time between CCSprites appear a little interval. How fix it? Some init code: sprite1 = [sprites objectAtIndex:0]; [sprite2 setPosition:ccp(240.0,self.position.y)]; sprite2 = [sprites objectAtIndex:1]; [sprite2 setPosition...

Iphone and php application

I created php pages.. those php pages are registration form.with the fields.FirstName,LastName and CompanyName...If I fill the information in that form and hit submit the data will store it on the mysql database.And I created one page...that displays the data which I have added through register form...I have a button on this page which d...

How to set audio Gain using fraunhofer decoder on iphone

Hi, I am new to iphone and currently struck. Could anyone tell me as how to set the Gain of a audio buffer by using the fraunhofer decoder. Thanks in advance. ...

Is it possible to integrate Cocos2d iphone into an existing program that i'm coding?

i actually need a simple enlarging animation (a small card enlarging into a larger card, drag and drop into a bucket) at any point in time, there is only 1 animation. If Cocos2d integration is possible, i would actually want to add in more animations into my project. my project is currently a Nav-Tab Project. So i have my own custom c...

Can Core Animations supports a 20 frames per second enlargement from 32 x 32 px to 120 x 170 px?

my background.jpg has 52 32x32 mini poker cards.png and when user touch on 1 card, it will enlarge to 120x 170 px. At any point in time, there is only 1 card being chosen (i.e, being animated) with at most 19 entire cards overlapped (120x170 / 32x32). Should i use Core Animation or do i have to learn OpenGL or use a library such as coc...

How can I show UIAlertView on Cocos2d Layer in iPhone?

I have a layer in my game. At finishing of game I want to show user an UIAlertView for restarting or quitting the game. But it is not working. I am also given the delegate UIAlertViewDelegate to layer. Any Solutions? My Code follows, -(void)gameFinished{ [[UIApplication sharedApplication] setIdleTimerDisabled:NO]; [self unschedule:@s...

Problem with smoke bubble in cocos2d.

I am having a problem. When the smokeMoveBy action starts a small smoke bubble is spotted on the screen at other place then the moving path of the smoke. This is only happening when I am using scaleX and scaleY. The method smokeLoop is being called at each 1 seconds in the scheduler. Here self is a layer. Any solutions? My code follows...

How to move object using animation?

I am implementing game application.In which there is some mosquito(object).They moves randomly on the screen.but i want to move this object like real animation.can u advice me which animation i have to use.And should i have to use cocos2d or quartz core?Please give me advice. ...

How to call a scene from a UIviewController in Cocos -2d

I have problem when placing a UIViewcontroller over a menuScene. my UIviewcontroller(named "share") consists several button like submit,play again,main menu etc. But the problem is that as this UIviewcontroller class reside over menuScene sometimes clicking on UIViewController page execute menuScene menu like (startgame,help,credit etc...

Objective-C: 'GameLayer' may not respond to '-addChild:z'

I am new to Objective-C and iPhone development in general. I am using the Cocos2d-iphone library for a game engine in an attempt to develop a very simple game. I have been following a few tutorials to get the hang of things and am attempting to put together a very simple "level" where some balls bounce around the screen using the Chipmu...

Problem of screen not being refreshed in cocos2d layer, screen, navigation controller's view sequnce

I have a added a navigation controller's view in application's main window using, [window addSubview:[navController view]]; I have also one push notification, NSNotificationCenter *theNotificationCenter = [NSNotificationCenter defaultCenter]; [theNotificationCenter addObserver:self selector:@selector(showSelf:) name:@"showHomeMenu" o...

Smoothly drag a Sprite in cocos2d - iPhone

Hi All I have implemented a drag on a sprite object as follows.. -(BOOL)ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { UITouch * touch = [touches anyObject]; CGPoint location = [[Director sharedDirector] convertCoordinate: [touch locationInView:touch.view]]; [diskSprite setPosition:ccp(location.x , location.y )]; ret...

Problem animating a Parallax Layer in Cocos2d-iPhone

UPDATE: I'm a doofus. What's happening is obvious. The Animation first sets the layers position to it's current position. But I've told the layer to divide any setPosition coordinates by pRatio. So it's not going to CGPoint(0,0) but something like CGPoint(0.032, 0). I've fixed it like this: - (void) setPosition:(CGPoint)point { if(!...

How to set up loading page in iPhone game.

Hi everyone. I have some trouble with my game (using Cocos2D). I have an introduction, then it will go to the game afterward. The thing here is, on the simulator, it always appears at real-time when it switches scene Intro to GamePlay. But in the actual phone, I know it would be slower and take more time to switch. But before the player...

GLUI problem when using cocos2d OpenGL

Has anyone come across this problem when building with cocos2d (OpenGL library for iPhone 2D games)? "glui/GL/glui.h" file is not found gluOrtho2D was not declared GL_COLOR_BUFFER_BIT was not declared. There seems to be very little info on GLUI for iPhone on the web. I am new to OpenGL, so appreciate the help! I have included Open...

Change Sprite Anchorpoint without moving it?

Hello, I am trying to change my Sprite anchor point so that I can rotate over a 0.0f,0.0f anchorpoint. At first my object is rotation at the default anchor point (0.5f,0.5f). However later on I need it to rotate over a 0.0,0.0 AnchorPoint. The problem is I cannot change the anchor point and change the position accordingly, so it stays...

GetBodyCount() always returning 0 in Box2d?

Hi There, I am using the cocos2d-iphone + Box2d engine, I have a simple call in Box2d to create a body: b2Body *crateBody = world->CreateBody(&crateBodyDef); Then I am printing the newly incremented body count variable through: CCLOG(@"There are %0.0f bodies in the world.", world->GetBodyCount()); However, GetBodyCount() always re...

Does cocos2d framework work on iPad?

Does Cocos2d iPhone framework work on iPad? My guess would be yes, but wanted to check if someone has a definitive answer after porting iPhone project with cocos2d to iPad, or starting a new one. ...

"Beveled" Shapes with cocos2d

I would like to draw 2d shapes like this in an iPhone app: I asked a similar question here to see if I could do it easily with Quartz, but didn't get a solution. So I got to thinking that I might be able to leverage an exsiting 2d library out there, and then I thought of cocos2d. The goal is to draw these kinds of beveled shapes dyna...