cocos2d-x

Undefined symbols in Crypto++/iOS 64-bit project

醉酒当歌 提交于 2019-11-28 12:01:06
问题 I tried to build with github's prebuilt cryptopp but it doesn't work, too. it occur errors like below: Undefined symbols for architecture arm64: "CryptoPP::BufferedTransformation::ChannelFlush(std::string const&, bool, int, bool)", referenced from: vtable for CryptoPP::SimpleProxyFilter in MYCLASSBBB.o vtable for CryptoPP::Bufferless<CryptoPP::Filter> in MYCLASSBBB.o "CryptoPP::Filter::CopyRangeTo2(CryptoPP::BufferedTransformation&, unsigned long long&, unsigned long long, std::string const&,

Cocos2dx - Unable to set velocity = 0.0

你离开我真会死。 提交于 2019-11-28 11:35:04
问题 I'm making an pool game with cocos2dx. First, i setup the edgeBox with this parameters PhysicsMaterial(1.0f, 1.0f, 0.8f) And then these 2 balls PhysicsMaterial(1.0f, 1.0f, 0.5f) On the update function, i want slow down balls time by time without gravity (like making ground friction) by adding physicsBody->setLinearDamping(0.3); On the update function, i set the minimum velocity, if the velocity of each ball reaches lower than 15, reset velocity to 0,0 auto MV = 15; auto v1 = player1-

Game Engine Collison Bitmask… Why 0x01 etc?

牧云@^-^@ 提交于 2019-11-28 10:13:01
Coming across this situation both in Sprite Kit (iOS Development) and in Cocos2d-x (which I know was pretty much the inspiration for Sprite Kit, hence why they use a lot of the same tools), I finally decided to figure out why this happens: When using a physic engine, I create a sprite, and add a physicsBody to it. For the most part, I understand how to set the category, collision, and contact bitmasks, and how they work. The problem is the actual bitmask number: SpriteKit: static const uint32_t missileCategory = 0x1 << 0; sprite.physicsBody.categoryBitMask = missileCategory; Cocos2D-X: sprite-

Cocos2D-x game fresh off the Play Store can't even open

不想你离开。 提交于 2019-11-28 05:34:56
问题 I just finished my first cocos2d-x game. I've tested it on my GNexus 4.1 and other lower devices, including tablets. However, when bought and downloaded to a Nexus 7, it won't even open. It's running 4.2, could that be the issue? Any help would be appreciated. crash report: java.lang.ExceptionInInitializerError at java.lang.Class.newInstanceImpl(Native Method) at java.lang.Class.newInstance(Class.java:1319) at android.app.Instrumentation.newActivity(Instrumentation.java:1054) at android.app

Run Callback On Main Thread

蓝咒 提交于 2019-11-27 23:22:50
问题 I have some code that interacts with the Android Facebook SDK, Asynchronously. Unfortunately this means when it returns it is in a background thread. Cocos-2dx prefers me to interact with it in the Main Thread, especially when doing things like telling the Director to switch scenes (As it involves Open GL) Is there any way to get some code to run on the Main thread ? 回答1: As long as you have a Context, you can do something like this: Handler mainHandler = new Handler(context.getMainLooper());

C++ understanding cocos2d-x use of function pointers

◇◆丶佛笑我妖孽 提交于 2019-11-27 21:26:04
问题 I am experimenting around with extending cocos2d-x CCMenuItem components and came across something I have not seen before in C++. It would be helpful if someone would elaborate on what is going on with their function pointer declarations The base class for most cocos2d-x objects is CCObject which has the following definition class CC_DLL CCObject : public CCCopying { public: // Code omitted }; // The part in which I have a question about typedef void (CCObject::*SEL_SCHEDULE)(float); typedef

Cocos2d-x(Win32 Android Ios)

浪尽此生 提交于 2019-11-27 20:27:16
创建windows平台项目 一、 搭建windows开发环境 官网上显示cocos2d-x支持win7、winxp、vista系统但我只在win7上用过以下说明均是在win7系统上的编译器使用vs2010。 1、 安装vs2010 2、 安装Visual Assist X可选 3、 执行build-win32.bat编译cocos2d-x 4、 运行cocos2d-x根目录下的install-templates-msvc.bat将cocos2d-x模板加入vs模板库。 5、将.\Debug.win32目录下的所有dll文件拷贝至Windows\system32\ (iconv.dll libcocos2d.dll libcocosDenshion.dll libcuri.dll libEGL.dll libgles_cm.dll libxml.dll pthreadVCE2.dll zlib1.dll )6、 双击cocos2d-win32.vc2010.sln进入vs编译环境 二、 新建win32项目 1、在“解决方案”上单击右键选择“添加”-〉“新建项目”。 2、选择“左侧Cocos2d-x模板”在右侧列表中选择“Cocos2d-win32 Application”输入项目名称“Cocos2dDemo”点“确定”。3、在弹出的对话框中点击“下一步”。 4

Cocos2d-x 3.x 全平台(Android,iOS)新手开发配置教程攻略

大城市里の小女人 提交于 2019-11-27 20:26:40
自己写的博客: http://blog.sina.com.cn/s/blog_732d16630101g445.html 以前只做过网页游戏(《古今东西》, www.ooplay.net ),游戏也曾经开发过Android的手机版本,但自己写的引擎,当然也不能跨平台。所谓“工欲善其事,必先利其器”,使用成熟的引擎当然要锐利得多,所以果断投入了Cocos2d-x的阵营。我捣鼓了几天,才把平台上的东西配置好,现在买的书和网上的攻略大都是介绍2.x的,对于布置3.0开发平台的内容几乎都是网上的,但都是这里一点,那里一点。 所以我把自己的捣鼓经历记录下来,希望对大家有所帮助。因为这篇文章是面对新手的。所以有些地方会啰嗦一些。请勿见怪。因为本人也是新手,如果教程中有错误,欢迎指正。如果在配置开发平台时还遇到问题,请在评论中留言,我会尽力解答。 我使用的环境是自己的PC(Win7)+HTC G18。还有从朋友那里借来的MacBook Air+Mini iPad。 一、通用准备工作 1、安装Cocos2d-x3.1。 在Cocos的主页上: http://cocos2d-x.org/ 这个不用解释了。下载后解压缩就行。 2、安装Eclipse与AndroidSDK。 这个在Mac上或是PC上开发都是可以通用的。 Eclipse在官网: http://www.eclipse.org/

Android OBB/ZIP loading (cocos2dx)

耗尽温柔 提交于 2019-11-27 16:55:11
问题 I have a problem dealing with the APK expansions. On Java side, I could set up everything I supposed to set, but it seems I can't modify the code properly on c++ side. Inside the CCFileUtilsAndroid::getFileData function: if (fullPath[0] != '/') { CCLOG("GETTING FILE RELATIVE DATA: %s", fullPath.c_str()); pData = CCFileUtils::sharedFileUtils()->getFileDataFromZip("/storage/sdcard0/Android/obb/com.example.package/main.1.com.example_package.obb", fullPath.c_str(), pSize); } But the pData var is

Cocos2d-x3.0模版容器详解之二:cocos2d::Map<K,V>

人走茶凉 提交于 2019-11-27 16:45:20
1.概述 版本: v3.0 beta 语言: C++ 定义在 “COCOS2DX_ROOT/cocos/base” 路径下的 " CCMap.h " 的头文件中。 ? 1 2 template < class K, class V> class CC_DLL Map; cocos2d::Map<K,V> 是一个内部使用了 std::unordered_map 的关联容器模版。 std::unordered_map 是一个存储了由key-value键值对组合成构成的关联性容器,允许基于键对单个元素进行快速检索。 在 unordered_map 中,key value 一般用来标识唯一的一个元素,而 mapped value 是一个对象,其内容关联到对于的 key value。 在内部,unordered_map 的元素并不依赖于 key 或者 mapped 值来使用任何的特定方式排序,而是取决于它们的哈希值,以便通过他们的key值快速访问单个元素(使用平均时间复杂度)。 在 Cocos2d-x v3.0 beta 之前,存在另一个顺序性容器 cocos2d::CCDictionary ,这将会被弃用。 我们很细致地设计了 cocos2d::Map<K,V> 容器作为 cocos2d::CCDictionary 的替代品,所以请使用 cocos2d::Map 代替 cocos2d: