cocos2d

Cocos2d for this?

Hi everyone, I just finished my concept for an iphone app. I have a main program and in that program I want to start a game. MAIN PROGRAM (BUTTON 1 / BUTTON 2 / START GAME) | | Cocos2d Game Is this possible? To use cocos...

Car physics in Chipmunk

Has anyone had experience with implementing car physics in chipmunk? Here's an example in Box2d: http://www.emanueleferonato.com/2009/04/06/two-ways-to-make-box2d-cars/ I'd like to port that over to chipmunk. ...

move sprite on path in cocos2d

Hi I want to move a sprite on this path using cocos2d. http://www.freeimagehosting.net/uploads/8436ca404e.jpg (stackoverflow does not allow new users to post image!) Any help would me much appreciated! Thanks ...

how to save my name,score and levels played in cocos2d

In a game with 5 levels, how to save a name, highest score, levels(which currently he is). ...

Highlight Read-Along Text (in a storybook type app for iPhone)

I love this feature (well, my son loves it), and I would like to implement it in a kid's book app I am doing for iPhone, but I'm clueless where to begin. I'm using Cocos2d for all the animated sprite/transition stuff, but I'm not sure how to approach highlighting text as it is narrated. Example: "Jack and Jill, drank their fill, and w...

Cocos2D : How to detect that I moved a sprite in a specific zone ?

hi there, 2 things I'd like to do with cocos2D : 1) set a random board based on 6 png files (like a 6 tiles boardgame) 2) be able to move a sprite/pawn with my finger and detect on which tile the sprite/pawn was moved and trigger a specific action depending upon which tile is under my sprite/pawn... any code examples ??? cheers, Tibi...

Can we change dynamically the interval of "schedule" ?

Hello, I'm making a game on iPhone using cocos2d, and I have a question. In my init method I'm doing this : [self schedule:@selector(newMonster:) interval:1]; It create a new monster every second. But I'd like that the interval change over time. For example : The 10 first seconds of the game: a new monster appears every 1 seco...

Character Movement Animation

Hi Guys! I've read a lot around everywhere, but wasn't able to make a simple character movement animation. What I have is a PNG file and an associated PLIST file with all the frames for a "walking" animation of a character that I want to run when the user touches the screen. I want to loop that animation and also at the same time, move ...

How to let the CCSprite handles Touch event?

I created my OwnCCSprite, and it get the implemented CCStandardTouchDelegate protocol, and ccTouchesBegan event. But it seems not working. When I click the CCSprite, the ccTouchesBegan in the CCLayer is called, but the CCSprite's ccTouchesBegan can't called. How can I detect the CCSprite is being touched in CCLayer / OwnCCSprite? or I ne...

Memory leak problem. iPhone SDK

Hello, i've got a problem, i cannot solve it, just recieving error: Program received signal: “0”. The Debugger has exited due to signal 10 (SIGBUS).The Debugger has exited due to signal 10 (SIGBUS). Here is some method, if i comment it out, problem goes aways - (void)loadTexture { const int num_tex = 10; glGenTextures(num_...

Box2d + CoCos2d: Moving an Object automatically to simulate computer movement in a game

I am working on a hockey game and I am implementing Single Player mode. I am trying to move the "computer's" paddle in offense mode (move towards the ball). I am using CoCos2d and Box2d. I am moving the paddle using MouseJoints. The problem is the Paddle doesnt move at all! tick is called in init method [self schedule:@selector(tick:)...

Problem with migrating from Texture2D to CCTexture2D (Setting CCSprite texture)

My problem is that whenever I change the texture of a sprite, the new texture will retain the size of the original sprite's texture. I have this code: mySprite = [CCSprite spriteWithFile:@"mySprite.png"]]; ... // change current stage here CCTexture2D *newTexture=[[[CCTexture2D alloc]initWithImage:[UIImage imageNamed:[NSString strin...

how to calculate time interval between player move and AI move

Hii, I want to calculate time taken by the player for making his move. My player can pick his coin and make his move to a box(like in chess). If my player pick his coin early but make his move very lately, then how to calculate time between AI and player move ...

UItextfield text alignment issue in cocos2D iPhone

Hi All, Please take a look of the following screen shot. Here is my code, I am using cocos2D CGAffineTransform transform = CGAffineTransformMakeRotation(3.14159/2); _view = [[CCDirector sharedDirector]openGLView]; // Input the user name _nameField = [[UITextField alloc]initWithFrame:CGRectMake(130.0, 270.0, 200.0, 30.0)]; _name...

Xcode 3.2: Build & Analyze never finds any issues

I've used the Clang Static Analyzer from the command line before. I wanted to try Xcode's built-in version via Build & Analyze. I never get any negative results even though i specially prepared my code with very obvious issues Clang was always able to point out: // over-releasing an object: [label release]; [label release]; ...

Update Label Value in Cocos2d

hi friends I am making a game in cocos2d , In that while updating score the old score values get on the label and the new value get overwritten. I m using following code to display the score, LblScore = [CCLabel labelWithString:[NSString stringWithFormat:@"%d",score] dimensions:CGSizeMake(100, 300) alignment:UITextAlignmentCenter font...

How to delay my AI move

I am doing a game like chess. As soon my player move is completed(if he starts move from one place to another), my AI move is started (before my player reaching his destination ). Sometimes i find difficult which AI coin is moved now. how to delay it. ...

Dragging a Sprite (Cocos2D) while Chipmunk is simulating

Hello all! I have a simple project built with Cocos2D and Chipmunk. So far it's just a Ball (body, shape & sprite) bouncing on the Ground (a static line segment at the bottom of the screen). I implemented the ccTouchesBegan/Moved/Ended methods to drag the ball around. I've tried both: cpBodySlew(ballBody, touchPoint, 1.0/60.0f); and ...

iPhone app works hundreds of times, then crashes from memory error on startup, then never works until restart - why?

I have a Cocos2d/openGL iPhone game. It's a universal app and I'm dealing with an occasional but nasty error on the iPad. We are loading a lot of textures up front (3 2048x2048 textures). I'm working on reducing this up front load, but what worries me is I really don't understand the root cause of this crash that permanently breaks th...

Slider in cocos2d

how to add a slider on cocos2d layer i.e directly on gamescene.m?? ...