转载请注明出处:http://blog.csdn.net/xingxiliang/article/details/18557631
更新:出品了box2d编辑工具PhysicsEditor的视频(一起做一个实战级别的游戏,需要MAC操作系统)http://blog.csdn.net/s_xing/article/details/21331459
更新:出品了box2d物理引擎视频http://blog.csdn.net/s_xing/article/details/20836727
更新:终于出进阶篇了http://blog.csdn.net/s_xing/article/details/20165097请大家关注
更新:上传了高清avi视频到百度网盘,http://pan.baidu.com/s/1ELk78
更新:上传到了优酷
http://v.youku.com/v_show/id_XNjY0MjEzNzI0.html 第1课
http://v.youku.com/v_show/id_XNjY0MjMzMzYw.html 第2课
http://v.youku.com/v_show/id_XNjY0MjU1OTcy.html 第3课
http://v.youku.com/v_show/id_XNjY0MzQxMDE2.html 第4课
http://v.youku.com/v_show/id_XNjY1MTI3NjYw.html 第5课
http://v.youku.com/v_show/id_XNjY1MTI5ODQw.html 第6课
cocos2d-x 是热门的二维游戏引擎,可以开发win32,iphone,android游戏。我们将一步一步的带着大家完成一款自己的游戏。定位是入门教程,高手勿喷。网上对于这款入门程序有很多教程,但是都是写的,感觉没有视频教程来的直接。
前提:
请大家安装win7,vs2010 或vs2012,因为最新的cocos2dx的版本在winxp上编译不成功。
下载链接:http://pan.baidu.com/s/1ELk78
录制格式是swf格式,PC上可以使用QQ影音播放,android手机上请安装flash player播放。
此次发布三课,大体内容:
第一课:
1. 下载安装包
2. 创建工程 create_project.py python
3. 打开win32工程,编译
第二课:
1. 介绍了主要的几个类:导演,场景,图层,精灵
2. 创建精灵,
[cpp]
view plain
copy
<EMBED id=ZeroClipboardMovie_1 height=18 name=ZeroClipboardMovie_1 type=application/x-shockwave-flash align=middle pluginspage=http://www.macromedia.com/go/getflashplayer width=18 src=http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf wmode="transparent" flashvars="id=1&width=18&height=18" allowfullscreen="false" allowscriptaccess="always" bgcolor="#ffffff" quality="best" menu="false" loop="false">
- CCSize screenSize = CCDirector::sharedDirector()->getVisibleSize();
- CCSprite* player = CCSprite::create("Player.png");
- player->setPosition(ccp(0 + 20, screenSize.height / 2));
- this->addChild(player);
3. 修改图层的背景颜色
[cpp]
view plain
copy
<EMBED id=ZeroClipboardMovie_2 height=18 name=ZeroClipboardMovie_2 type=application/x-shockwave-flash align=middle pluginspage=http://www.macromedia.com/go/getflashplayer width=18 src=http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf wmode="transparent" flashvars="id=2&width=18&height=18" allowfullscreen="false" allowscriptaccess="always" bgcolor="#ffffff" quality="best" menu="false" loop="false">
- CCLayerColor::initWithColor(ccc4(0, 255, 0, 255))
第三课:
1. 菜单的使用
[cpp]
view plain
copy
<EMBED id=ZeroClipboardMovie_3 height=18 name=ZeroClipboardMovie_3 type=application/x-shockwave-flash align=middle pluginspage=http://www.macromedia.com/go/getflashplayer width=18 src=http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf wmode="transparent" flashvars="id=3&width=18&height=18" allowfullscreen="false" allowscriptaccess="always" bgcolor="#ffffff" quality="best" menu="false" loop="false">
- // 菜单的使用
- CCMenuItemImage* item = CCMenuItemImage::create("button2.png",
- "button2.png",
- "button2.png",
- this,
- menu_selector(HelloWorld::responseFunc));
- item->setPosition(ccp(30, 30));
- CCMenu* menu = CCMenu::create(item, NULL);
- this->addChild(menu);
2. 精灵执行动作
[cpp]
view plain
copy
<EMBED id=ZeroClipboardMovie_4 height=18 name=ZeroClipboardMovie_4 type=application/x-shockwave-flash align=middle pluginspage=http://www.macromedia.com/go/getflashplayer width=18 src=http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf wmode="transparent" flashvars="id=4&width=18&height=18" allowfullscreen="false" allowscriptaccess="always" bgcolor="#ffffff" quality="best" menu="false" loop="false">
- CCMoveTo* move = CCMoveTo::create(2, ccp(0, y));
- CCCallFuncN* disappear = CCCallFuncN::create(this, callfuncN_selector(HelloWorld::myDefine));
- CCSequence* actions = CCSequence::create(move, disappear, NULL);
- mytarget->runAction(actions);
3. 怎样开启定时器。
[cpp]
view plain
copy
<EMBED id=ZeroClipboardMovie_5 height=18 name=ZeroClipboardMovie_5 type=application/x-shockwave-flash align=middle pluginspage=http://www.macromedia.com/go/getflashplayer width=18 src=http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf wmode="transparent" flashvars="id=5&width=18&height=18" allowfullscreen="false" allowscriptaccess="always" bgcolor="#ffffff" quality="best" menu="false" loop="false">
- this->schedule(schedule_selector(HelloWorld::gameLogic), 2);
转载请注明出处:http://blog.csdn.net/xingxiliang/article/details/18557631