cocos2d-iphone

a signed resource has been added, modified, or deleted during installation of my adhoc

冷暖自知 提交于 2019-12-13 06:09:22
问题 I am really frustrated that making my adhoc app install to my device. I have got this problem in this app. I used a team provision file (i.e. with "*" as identifier) to build all my apps for adhoc. it works fine for all other apps. just this app, when i install, it pops up a message "a signed resource has been added modified or deleted" and getting the following message in the organizer console log. installd[53] : 0x303000 handle_install: Install of "/var/mobile/Media/PublicStaging/mygame.ipa

CCMoveTo not working, node/scene issue?

僤鯓⒐⒋嵵緔 提交于 2019-12-13 06:02:27
问题 I have a CCLayer class called SuccessLayer. It gets added to the scene when the level is complete, like so: SuccessLayer *successLayer = [SuccessLayer node]; [self addChild:successLayer]; In SuccessLayer, I want to have a rock fly by, I'm trying to achieve that with this: -(void)onEnter{ Asteroid *asteroid = [Asteroid spriteWithFile:@"rocks.png"]; asteroid.position = ccp(0, 500); [self addChild:asteroid]; CCMoveTo *move = [CCMoveTo actionWithDuration:2.0 position:ccp(1000, 0)]; [asteroid

Retrieving Class Object from NSArray and adding to self

家住魔仙堡 提交于 2019-12-13 05:40:45
问题 Hi im trying to retrieve an object of a specific class from an NSMutableArray, and then add it to self: eg: - (void) init{ _Objects = [[NSMutableArray alloc]init]; Psychicing *psy = [[Psychicing alloc]init]; [psy startPsychic]; [_Objects addObject: psy]; [psy release]; } This creates an object of class Psychicing, then runs the [psy startPsychic] method to create the internals of the class object. Then I add the psy object to _Objects NSMutableArray. -(void)startPsychic{ id psychicParticle =

How do you properly create a va_list dynamically at runtime for Cocos2D CCMenu menuWithItems?

一个人想着一个人 提交于 2019-12-13 05:23:34
问题 I'm having a hell of a time with the CCMenu class. To create a menu with this class it forces you to call a method called initWithItems, which takes a va_list. I need to generate this list at runtime, and I read that creating a C array and passing that can function just as va_list does under the covers, only it is failing. I have an NSArray of items I want in the va_list, and these items are a SUBCLASS of CCMenuItem, the class that menuWithItems is expecting in the va_list. If you hardcode

How to have a character moved around the screen?

[亡魂溺海] 提交于 2019-12-13 05:18:37
问题 I already have a joystick programmed (finally) and I was wondering how I would get a 'hero' to move about the screen based on where the joystick is? I am using Cocos2d and any help would be greatly appreciated! 回答1: The simplest way to do this is to subclass CCNode for your player object and then manipulate it as you would any other CCNode . To start with, you can change the player's position struct like so: player.position = ccp( player.position.x + [joystick xValue], player.position.y +

When to use CC_CONTENT_SCALE_FACTOR()?

这一生的挚爱 提交于 2019-12-13 04:44:24
问题 I am a bit confused on when to use CC_CONTENT_SCALE_FACTOR() in my app. I use Box2D for collision detection, and I make a b2Body of vertices. Now should I divide each point only by the PTM_Ratio or by the PTM_Ratio multiplied by CC_CONTENT_SCALE_FACTOR()? Should I be using CC_CONTENT_SCALE_FACTOR() anywhere in my app if I am not dealing with pixels? Should I only use CC_CONTENT_SCALE_FACTOR() for GLESDebugDraw like this? _debugDraw = new GLESDebugDraw( ptmRatio * CC_CONTENT_SCALE_FACTOR()); ?

Is Cocos2d-x a good development platform for games? [closed]

喜你入骨 提交于 2019-12-13 04:43:27
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I have just learnt Cocos2d, but i am not an expert on it. But a friend told me to learn Cocos2d-x. Should i prefer Cocos2d-x on

CCMenuItemSprite's alternative in Cocos2d v3

烂漫一生 提交于 2019-12-13 04:43:11
问题 In Cocos2d 2.0 I used below code to use single image for normal and selected image with colour change on selection. CCSprite *twitter_1 = [CCSprite spriteWithSpriteFrameName:FRAME_MM_TWR_1]; CCSprite *twitter_2 = [CCSprite spriteWithSpriteFrameName:FRAME_MM_TWR_2]; twitter_2.color = ccc3(128,128,128); CCMenuItemSprite *twitterBtn = [CCMenuItemSprite itemWithNormalSprite:twitter_1 selectedSprite:twitter_2 target:self selector:@selector(twitterBtnPress:) ]; In Cocos2d v3, I can use CCButton as

Understanding crash in Cocos2d iOS game

女生的网名这么多〃 提交于 2019-12-13 04:32:16
问题 I'm trying to understand a crash reported by my crash reporting service. The report is: Exception Type: EXC_BAD_ACCESS Code: KERN_INVALID_ADDRESS at 0x12341234 0 libobjc.A.dylib _cache_getImp + 3 2 libobjc.A.dylib class_respondsToSelector + 30 3 CoreFoundation objectIsKindOfClass + 36 4 CoreFoundation __handleUncaughtException + 68 5 libobjc.A.dylib _objc_terminate() + 128 6 libc++abi.dylib safe_handler_caller(void (*)()) + 78 7 libc++abi.dylib std::terminate() + 19 8 libc++abi.dylib __cxa

CCSprite is moved when using CCScaleTo or CCScaleBy

て烟熏妆下的殇ゞ 提交于 2019-12-13 04:26:38
问题 I almost have read everything about Anchor Point and scaling. I still have no idea what is going on with a sprites position when i scale it. The scenario is this: When i tap on screen, sprite's width will decrease about %50 and height will increase about same scale. Then it will get back to its normal scale. id scaleUpAction = [CCEaseInOut actionWithAction:[CCScaleTo actionWithDuration:.35 scaleX:0.5 scaleY:1.5] rate:1.0]; id scaleDownAction = [CCEaseInOut actionWithAction:[CCScaleTo