Cocos2d-x 3.x默认情况下采用的物理引擎是Chipmunk,如果我们要使用Box2D引擎,需要进行一些设置和调整,而且不同的开发平台下这些设置也有所不同。由于本书在此之前介绍的都是基于微软的Visual Studio 2012下开发的Win32平台,所以这一节我们介绍Visual Studio 2012下Box2D开发环境设置。
这些需要设置和调整的方面包括如下:
在解决方案中添加libBox2D库工程。
添加libBox2D库引用。
开启Box2D预编译开关。
1、在解决方案中添加libBox2D库
首先,打开解决方案,右键点击解决方案HelloBox2D,在右键菜单中选择,“添加”→ “现有项”,如图所示。
在弹出对话框中选择Box2D.vcxproj工程文件,具体的工程路径是“<工程目录>\cocos2d\external\Box2D\proj.win32\Box2D.vcxproj”。添加完成后,我们会看到解决方案中添加了libBox2D工程,如图所示。
2、添加libBox2D库引用
然后,我们在解决方案中右键点击工程HelloBox2D,在右键菜单中选择“属性”,弹出如图所示工程属性对话框,在属性对话框中选择“通用属性”→“框架和引用”,接着点击右边“添加新引用”按钮,在弹出对话框中选中“libBox2D”,最后点击“确定”按钮。
3、开启Box2D预编译开关
打开属性对话框中选择“配置属性”→“C/C++”→“预处理器”,接着在右边“预处理器”中找到CC_ENABLE_CHIPMUNK_INTEGRATION=1,把它修改为CC_ENABLE_BOX2D_INTEGRATION= 1。这样框架采用的物理引擎从Chipmunk改变为Box2D,如图所示。修改完后点击“确定”按钮。
开启Box2D预编译开关
《Cocos2d-x实战 C++卷》现已上线,各大商店均已开售:
京东:http://item.jd.com/11584534.html
当当:http://product.dangdang.com/23606265.html
互动出版网:http://product.china-pub.com/3770734
《Cocos2d-x实战 C++卷》源码及样章下载地址:
源码下载地址:http://51work6.com/forum.php?mod=viewthread&tid=1155&extra=page%3D1
样章下载地址:http://51work6.com/forum.php?mod=viewthread&tid=1157&extra=page%3D1
相关推荐
牛肉编程语言的 box2d包装器 -实际上liquidfun一个Box2D的叉合并到它! 先决条件 要初始化子模块,请运行git submodule update --init --recursive 视窗 Visual Studio 2019社区/专业(尽管可以使用其他版本构建,请...
Box2D-Lite Box2D-Lite是小型2D物理引擎。 它是为2006 GDC物理教程开发的。 这是较大的Box2D库的原始版本。 精简版更适合于学习游戏物理。 Box2D-Lite Box2D-Lite是小型2D物理引擎。 它是为2006 GDC物理教程开发的。...
With a selection including textbox, checkbox, line, shape, cross-section box, image, formatted text with mail merge, barcode (2D and 3D), chart, and other data visualization controls, they support a ...
支持物理 Box2D.XNA。 支持导入 Tiled 级别(JSON 导出格式)。 音乐和声音播放。 通过关卡中的属性对象自定义对象的属性。 演示游戏囚犯经典的 2D 平台游戏。 Visual Studio 2013 兼容性。重要的您需要安装 Visual...
With a selection including textbox, checkbox, line, shape, cross-section box, image, formatted text with mail merge, barcode (2D and 3D), chart, and other data visualization controls, they support a ...
With a selection including textbox, checkbox, line, shape, cross-section box, image, formatted text with mail merge, barcode (2D and 3D), chart, and other data visualization controls, they support a ...
With a selection including textbox, checkbox, line, shape, cross-section box, image, formatted text with mail merge, barcode (2D and 3D), chart, and other data visualization controls, they support a ...
With a selection including textbox, checkbox, line, shape, cross-section box, image, formatted text with mail merge, barcode (2D and 3D), chart, and other data visualization controls, they support a ...
With a selection including textbox, checkbox, line, shape, cross-section box, image, formatted text with mail merge, barcode (2D and 3D), chart, and other data visualization controls, they support a ...
With a selection including textbox, checkbox, line, shape, cross-section box, image, formatted text with mail merge, barcode (2D and 3D), chart, and other data visualization controls, they support a ...
Microsoft Visual Studio 6 for recompilation and development, although there should be no reason why it couldn't be compiled on Borland with a few changes. MinGW gcc however has no support for ...
Side by side installation for Visual Studio 2003 & 2005 - To ensure a smooth transition between Visual Studio 2003 and Visual Studio 2005, Version 5.0 offers separate installations for each ...
ASTRA工具箱ASTRA工具箱是用于2D和3D层析成像的高性能GPU基元的MATLAB和Python工具箱。... 我们需要Microsoft Visual Studio 2015可再发行组件包。 如果您的系统上尚未安装此文件,则它将作为vc_redist.x64.
在Qt Creator 的安装目录的qt 文件下的bin 文件夹下(我安装在了D 盘, 所以路径是D:\Qt\2009.04\qt\bin),可以找到所有的相关.dll 文件。在这里 找到mingwm10.dll 文件,将其复制到C:\WINDOWS\system 文件夹下,...
bootcfg /default 设置默认引导项。 bootcfg /add 向引导列表中添加 Windows 安装。 bootcfg /rebuild 重复全部 Windows 安装过程并允许用户选择要添加的内容。 注意:使用 bootcfg /rebuild 之前,应...
is-Engine:使用SFML库开发的游戏引擎,可以在Web(HTML 5-CSS 3),Android和PC上创建游戏
-ADD pl_Box2D, (Under modification/experimental) -ADD pl_Graphics32EXT, Extensions for Graphics32 (Win32, Win64, Linux32, Linux64, WinCE) -ADD pl_Cindy (Win32, Win64, Linux32, Linux64, WinCE) -...