cocos2d-iphone

Multiple animations and textures with Cocos2d - How to remove texture from memory?

I am writing an application where you push different buttons and a character gets animated. The thing is that I have many images, so I need to use one texture for each animation. Therefore I need to release sprite sheet and frame cash, but it does not seem to be working. Memory gets allocated more and more until the app crashes. Here is ...

cocos2d game reset problem

I have a cocos2d game, and after I exit the game and start it again, it starts at the exact same point it was before closing.why this is happening??and not only this, my game is landscapemode but when i start it again from simulator it comes in potrait mode,not it landscapemode like first time. Is there any way to prevent this? Anyone ...

Is there someone who is using cocos2d 0.99.5 beta3?

Definitely, I'm a newbie on 'cocos2d for iOS', and in trouble with importing the "CCTouchDispatcher.h". Cocos2d for iphone version 0.99.4 or below, I've seen CCTouchDispatcher class successful, but does not occur importing. Importing works, but I cannot use CCTouchDispatcher. Warning shows just "may not respond to..", and there's no even...

Pathfinding / Deciding on direction

Hi everyone, i'm making a simple iPhone game using cocos2d-iphone. I have an array of fiends, the "fiendSet" which has to navigate around a field full of obstacles. I spent the last three nights trying to get my A* pathfinding to work. I found the actual A* implementation here on stackoverflow and it works brilliantly. However, once i tr...

schedule - how many ticks ago?

Is there a way to have a reference to schedule and find out how many times it has already ticked by using the schedule object itself? [self schedule:@selector(a:) interval:1.0]; ...

Limiting number of simultaneous sounds in CocosDenshion/Cocos2D

Hi, I'm building a game which will play a handfull of sounds all the time (rockets, rocket impacts etc). After a mere moment this turns into a real mess and i figured i need to limit the number of sounds. Problem is i don't want to decrease the number of channels of something because then one type of sound could "hog" the channels and ot...

cocos2d progress bar...

HI all, i am developing a puzzle game in iPhone using cocos2d.I need a progress bar (like uiprogress bar) to show the game progress time.But i can't find any good example... can anyone tell me the way??? ...

Cocos 2d body & its fixtures

Hi there, Well I try to implement the run action to move a specific sprite towards the specific destination, I can achieve that using the below code snippet. [spriteA runAction:[CCSequence actions:[CCMoveTo actionWithDuration:0.2 position:realDest],[CCCallFuncN actionWithTarget:self selector:@selector(spriteMoveFinished:)],nil]]; But ...

how to pop navigation controller to root in COCOS2D?

i have a FirstViewController that i have attach Cocos2d on it, when i try to pop thisview back to the rootviewcontroller how can i do it? i try to send message from CCLayer to FirstViewController to pop to root but not work here is the code in Firstviewcontroller (void)poptoRootview { NSLog(@"poptoRootview"); [self.navigationControll...

Question about my logic for Rhythm game/Iphone Cocos2d

Ok I am a complete newbie at game design and have a question. Ive been working on a rhythm game for the iphone for the past few months now. The game runs well and is getting closer to being finished, however, being my first major project I feel like the underlying way I am doing it is very flawed. We are shooting for 60 fps and it run...

cocos2d hide/show sprites with animation

Hi, i am spending a lot for my time for a simple things i think.I want to hide and show a sprite in scene. myS = [CCSprite spriteWithFile:@"Background_Pause_pad.png"]; [myS setPosition:ccp(384,470)]; myS.opacity = 0; [self addChild:myS z:1]; and when i need to appear it.. [myS runAction:[CCFadeIn actionWithDuration:1]...

Multithreading the pathfinding in a tower defense game

Hi, I'm making a tower defense game and I'm stuck at the multithreading of the pathfinding. If i don't make the pathfinding an NSInvocationOperation then there is an increasing pause in the rendering the more fiends and towers i have. However i cannot solve the "locking" issue. I get frequent crashes about enumerating my fiend NSMutable...

Is there a better way write this objective-c code?

Hi, this code creates a random transition when I change scenes. There are eleven transitions. Because they are static, I think I cannot use NSClassFromString. I also need to pass the scene (s) object. Right now the switch seems redundant. Is there a way to rewrite this to make it more efficient? -(void) newScene { CCScene *s = [CCScene ...

Failed to swap renderbuffer in iphone app

Hi all Im having a problem with an iphone app that im working on.im using objective c and cocos2d. The frame rate just drops drastically. I have tested for leaks and allocations etc using instruments and all looks good on that front. I am not using any particles or sound at the moment so its not anything like that. its just animated spri...

cocos2d animate

I try create animation in my application written on cocos2d. I make it on this tutorial http://getsetgames.com/tag/ccanimation/ All work fine. But I write all code in my Engine class. Also I have class for object which I would like animate. And I have special class for create object. Now I try next File which must have animation sprite...

Level Editors for Cocos2d iPhone Application

The point of this post it to list all the level editors for the iPhone applications. 1) LevelSVG (NOT FREE) ...

How to resume iPhone app after a Phone Call

Hi there, I am creating an iPhone app in which I am providing a call feature with the help of which a user can call place a call on a specified number. I am able achieve the above feature via open URL. Now after completion of the call I want to resume the execution of app automatically. Although a user can make a fast app switch in iOS...

How do you integrate cocoslive into a cocos2d game?

Hello, I have searched online for how to do this but I don't understand. The only thing that I find is people telling each other to look at the example that came with cocos2d. What example is that? Where is it located? All I can find are class files. And I do not know how to link UIKit and Cocos2d together which makes it even harde...

How to make Cocod2d 0.99.4 game universal(iOS4+iOS3.2+iOS<3.2) in iPhone SDK 4.1. I am stucked.

when i create a cocos2d projecyt, XCode menu item "Project\Upgrade Current Target for iPad" becomes disable. Any solution please? EDITED: I am using SDK 4.1 and cocos2d 0.99.4 for iPhone. When I create iOS native application i get options to select target device (iPhone/iPad). But with cocos2d, there is no option. Though iphone apps ...