Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

09 creating windows phone game with cocos2d-xna

700 views

Published on

tory xu (microsoft) and xiaoming zhang

Published in: Technology
  • Login to see the comments

  • Be the first to like this

09 creating windows phone game with cocos2d-xna

  1. 1. Put People First 以人为本基于cocos2d-x for XNA的Windows Phone游戏开发全新 ・ 全易
  2. 2. 徐玉涛 Tory Xu技术平台合作经理开发工具与平台事业部微软(中国)有限公司toryxu@microsoft.com微博:@徐玉涛Tory Xu 欢迎
  3. 3. 以人为本 —— 联接消费者与开发者" 不同的设备,⼀一致的体验 统⼀一的开发平台
  4. 4. Windows Phone 全新 · 全易
  5. 5. 游戏开发者的 全新 · 全易 " 90% 市场机会全新 设备规格 工具体系全易 游戏框架
  6. 6. Cocos2d-x for XNA" Hello World C# with XNA 50% Windows Phone 7.5 工作量 http://download.cocos2d-x.org MIT License 开放下载 开源
  7. 7. 春”Phone” 开发者计划8个第三方开发者SDK版开放下载
  8. 8. 张小明"Cocos2d-x核心开发者xiaoming.zhang@cocos2d-x.org 走进 cocos2d-x for XNA
  9. 9. 主要内容"Ø Cocos2d-x for XNA与cocos2d-x的关系Ø Cocos2d-x for XNA提供哪些功能,怎么用Ø Cocos2d-x cocos2d-x for XNA
  10. 10. Cocos2d-x for XNA与cocos2d-x关系"class Engine: public API class API{ { public : virtual void string language; addChild(CCNode*)=0; string supportPlatforms; …}; };// language = “c++”// supportPlatforms = “iOS Android …” // language = “c#”class cocos2d-x: public Engine // supportPlatfroms = “windows{ phone7”public : class cocos2d-x_for_xna : public virtual void addChild(CCNode*); Engine}; { public : virtual void addChild(CCNode*); };
  11. 11. Cocos2d-x for XNA提供的功能"Ø 显示图片Ø 动画效果Ø 粒子效果Ø 显示文本Ø 添加菜单Ø 播放音乐音效…
  12. 12. 显示图片"// c++CCSprite *pSprite = CCSprite::spriteWithFile(“helloworld.png”);pSprite->setPosition(ccp(100, 100));addChild(pSprite);// c#CCSprite sprite = CCSprite.spriteWithFile(“helloworld”);sprite.position = new CCPoint(100, 100);addChild(sprite);
  13. 13. 动画效果"// c++CCMoveTo *moveTo = CCMoveTo::actionWithDuration(2, ccp(50, 50));pSprite->runAction(moveTo);// c#CCMoveTo moveTo = CCMoveTo.actionWithDuration(2, new CCPoint(50, 50));sprite.runAction(moveTo);
  14. 14. 粒子效果"// c++CCParticleSystem *particle = CCParticleFlower::node();particle->setTexture(pSprite->getTexture());particle->setPosition(ccp(100, 100));addChild(particle);// c#CCParticleSystem particle = new CCParticleFlower();particle.texture = sprite.texture;particle.position = new CCPoint(100, 100);addChild(particle);
  15. 15. 显示文本"// c++CCLabelTTF *pLabel = CCLabelTTF::labelWithString(“hello”, “Arial”, 20);pLabel->setPosition(ccp(100, 100));addChild(pLabel);// c#CCLabelTTF label = CCLabelTTF.labelWithString(“hello”, “Arial”, 20);label.position = new CCPoint(100, 100);addChild(label);
  16. 16. 添加菜单"// c++SimpleAudioEngine::sharedEngine()->playBackgroundMusic(“bg.mp3”);CCMenuItemLabel *pItemLabel = CCMenuItemLabel::itemWithLabel(“item”);SimpleAudioEngine::sharedEngine()->playEffect(“effect.ogg”);CCMenu *pMenu = CCMenu::menuWithItems(pItemLabel, NULL);pMenu->setPosition(ccp(100, 100));// c#addChild(pMenu);SimpleAudioEngine.sharedEngine().playBackgroundMusic(“bg”);SimpleAudioEngine.sharedEngine().playEffect(“effect”);// c#CCMenuItemLabel itemLabel = CCMenuItemLabel.itemWithLabel(“item”);CCMenu menu = CCMenu.menuWithItems(itemLabel);menu.position = new CCPoint(100, 100);addChild(menu);
  17. 17. 播放音效"// c++SimpleAudioEngine::sharedEngine()->playBackgroundMusic(“bg.mp3”);SimpleAudioEngine::sharedEngine()->playEffect(“effect.ogg”);// c#SimpleAudioEngine.sharedEngine().playBackgroundMusic(“bg”);SimpleAudioEngine.sharedEngine().playEffect(“effect”);
  18. 18. Cocos2d-x移植到cocos2d-x forXNA相同点:1.  接口相同2.  引擎框架相同3.  同样的社区支持不同点(语言差异):1.  内存管理2.  成员变量访问3.  资源访问4.  微软、诺基亚的大力支持
  19. 19. 徐玉涛toryxu@microsoft.com张小明xiaoming.zhang@cocos2d-x.org谢谢 Thanks

×