Cocos2dx-2.1.0-wp8-2.0-alpha WP8 app crash when playing spritesheet


#1

Hey guys,
I’m a fresh new game developer with cocos2d-x. I have a strange problem. When I trying to play my spritesheet animation in my WP8 app, my app crash without displaying any error codes or messages. I have no idea why it crashes like this. Here is my code:

CCSpriteFrameCache* frameCache = CCSpriteFrameCache::sharedSpriteFrameCache(); frameCache->addSpriteFramesWithFile("Running.plist"); CCSpriteBatchNode* spritesheet = CCSpriteBatchNode::create("Running.png"); this->addChild(spritesheet); CCArray* runningFrame = new CCArray(10); for(int i = 1;i < 10; i++) { CCString* frameImageName = CCString::createWithFormat("Running000%d.png",i); CCSpriteFrame* frame = CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName(frameImageName->getCString()); runningFrame->addObject(frame); } CCSprite* ninja = CCSprite::createWithSpriteFrameName("Running0001.png"); ninja->setPosition(ccp(100,100)); ninja->setAnchorPoint(ccp(0.5,0.5)); CCAnimation* animation = CCAnimation::createWithSpriteFrames(runningFrame,0.3f); ninja->runAction(CCRepeatForever::create(CCAnimate::create(animation))); spritesheet->addChild(ninja);

Thanks for the help :slight_smile:


#2

I am running into the same issue. I think it is a bug in the wp8 code because it works fine in XCode.


#3

Mandy Lowry wrote:

I am running into the same issue. I think it is a bug in the wp8 code because it works fine in XCode.

Well maybe you’re right. But the stable version of cocos2d-x (cocos2dx-0.13.0) works well on windows phone 8. So I think I have no other choice, I have to use the stable version.


#4

It crashes without any errors because asserts are not working on native WP8 apps. See http://bit.ly/11tA5zl.
Add this to your main, it will at least crash properly then and you can investigate from the call stack:

#ifndef NDEBUG
signal(SIGABRT,
{
__debugbreak();
});
#endif

They are defined in


#5

Siim Kallas wrote:

It crashes without any errors because asserts are not working on native WP8 apps. See http://bit.ly/11tA5zl.
Add this to your main, it will at least crash properly then and you can investigate from the call stack:
>
#ifndef NDEBUG
signal(SIGABRT,
{
__debugbreak();
});
#endif
>
>
They are defined in

I think I’ve found the original explanation of your reply: :slight_smile:


#6

Xavier Arias wrote:

Siim Kallas wrote:
> It crashes without any errors because asserts are not working on native WP8 apps. See http://bit.ly/11tA5zl.
> Add this to your main, it will at least crash properly then and you can investigate from the call stack:
>
> #ifndef NDEBUG
> signal(SIGABRT,
> {
> __debugbreak();
> });
> #endif
>
>
> They are defined in
>
I think I’ve found the original explanation of your reply: :slight_smile:
http://blogs.msdn.com/b/andypennell/archive/2013/06/17/native-code-on-windows-phone-8-the-assert-problem.aspx

That’s the same link I provided.


#7

Didn’t see that tiny link! haha

Do you want me to remove the reply?


#8

Xavier Arias wrote:

Didn’t see that tiny link! haha
>
Do you want me to remove the reply?

No need, the more people see the link, the better :slight_smile:


#9

Thanks you guys :). I appreciate your help :). Let me try