cocos2d-x

Cocos2d-x Lua中网格动作

↘锁芯ラ 提交于 2019-11-29 10:17:22
GridAction它有两个主要的子类Grid3DAction和TiledGrid3DAction,TiledGrid3DAction系列的子类中会有瓦片效果,如下图所示是Waves3D特效(Grid3DAction子类),如后图所示是WavesTiles3D特效(TiledGrid3DAction子类),比较这两个效果我们会看到瓦片效果的特别之处是界面被分割成多个方格。 Waves3D特效 WavesTiles3D特效 网格动作都是采用3D效果给用户的体验是非常震撼和绚丽,但是也给内存和CPU造成了巨大的压力和负担,如果不启用Open GL的深度缓冲,3D效果就会失真,但是启用的话对于显示性能会造成负面影响。 更多内容请关注最新Cocos图书《 Cocos2d-x实战:Lua卷——Cocos2d-lua开发 》 本书交流讨论网站: http://www.cocoagame.net 欢迎加入Cocos2d-x技术讨论群: 257760386 更多精彩视频课程请关注智捷课堂Cocos课程: http://v.51work6.com 智捷课堂现推出Cocos会员,敬请关注: http://v.51work6.com/courseInfoRedirect.do?action=netDetialInfo&courseId=844465&categoryId=0 《Cocos2d-x实战

Cocos2d-x Lua中帧动画

折月煮酒 提交于 2019-11-29 10:17:13
帧动画就是按一定时间间隔、一定的顺序、一帧一帧地显示帧图片。我们的美工要为精灵的运动绘制每一帧图片,因此帧动画会由很多帧组成,按照一定的顺序切换这些图片就可以了。 在 Cocos2d -x Lua中播放帧动画涉及到两个类:Animation和 Animate,类图如图 所示, Animation是动画类,它保存有很多动画帧,Animate类是动作类它继承于ActionInterval类,属于间隔动作类,它的作用是将Animation定义的动画转换成为动作进行执行,这样我们就看到动画播放的效果了。 帧动画相关类图 更多内容请关注最新Cocos图书《 Cocos2d-x实战:Lua卷——Cocos2d-lua开发 》 本书交流讨论网站: http://www.cocoagame.net 欢迎加入Cocos2d-x技术讨论群: 257760386 更多精彩视频课程请关注智捷课堂Cocos课程: http://v.51work6.com 智捷课堂现推出Cocos会员,敬请关注: http://v.51work6.com/courseInfoRedirect.do?action=netDetialInfo&courseId=844465&categoryId=0 《Cocos2d-x实战 Lua卷》现已上线,各大商店均已开售: 京东: http://item.jd.com/11659697

《Cocos2d-x实战 工具卷》上线了

别说谁变了你拦得住时间么 提交于 2019-11-29 10:16:59
感谢大家一直以来的支持! 各大商店均开始销售: 京东:http://item.jd.com/11659696.html 当当:http://product.dangdang.com/23659809.html 《Cocos2d-x实战 工具卷》素材及样章下载地址: 源码下载地址: http://51work6.com/forum.php?mod=viewthread&tid=1200&extra=page%3D1 样章下载地址:http://pan.baidu.com/s/1dDpO84T 《Cocos2d-x实战 工具卷》系统介绍了Cocos2d-x等2D游戏引擎在游戏开发过程中常用工具的使用方法和技巧。书中内容涵盖了游戏开发和设计过程中的动态字体、纹理图集、音乐 与音效、粒子效果编辑、瓦片地图编辑及物理编辑等与游戏运行、特效和用户体验相关的制作和设计方法。全书分为六章,内容如下:第1章字体编辑器,介绍了游 戏中的动态字体设计、制作方法和过程,Glyph Designer和BMFont软件的使用方法,并通过案例介绍了字体设计的相关经验。第2章纹理图集,介绍了借助软件TexturePacker制作精 灵纹理图集的过程和经验技巧。第3章游戏中的声音,介绍了游戏的背景音乐和音效的制作方法、GarageBand和Cfxr软件的使用方法。第4章粒子编 辑器

实例介绍Cocos2d-x中Box2D物理引擎:HelloBox2D

廉价感情. 提交于 2019-11-29 10:16:23
我们通过一个实例介绍一下,在Cocos2d-x 3.x中使用Box2D物理引擎的开发过程,熟悉这些API的使用。这个实例运行后的场景如图所示,当场景启动后,玩家可以触摸点击屏幕,每次触摸时候,就会在触摸点生成一个新的精灵,精灵的运行自由落体运动。 HelloBox2D实例 使用Box2D引擎进行开发过程,如图12-15所示。下面我们就按照这个步骤介绍一下代码部分。首先看一下看HelloWorldScene.h文件,它的代码如下: [html] view plain copy #ifndef __HELLOWORLD_SCENE_H__ #define __HELLOWORLD_SCENE_H__ #include "cocos2d.h" #include "Box2D/Box2D.h" ① #define PTM_RATIO 32 ② class HelloWorld : public cocos2d::Layer { b2World* world; ③ public: static cocos2d::Scene* createScene(); virtual bool init(); virtual void update(float dt); ④ virtual bool onTouchBegan(cocos2d::Touch* touch, cocos2d::Event*

android studio emulator crashing after 3.0 update

夙愿已清 提交于 2019-11-29 10:08:27
I have been messing around with android studio and I ended up installing cocos2dx and using an arm cpu emulator to work with cocos2dx. I have recently seen a message prompting for an update for the android emulator service so I installed it and now my emulator crashes while trying to boot and gives this error in the logcat - this is the error it gave me 19:36 Emulator: ** 19:36 Emulator: ERROR:/buildbot/src/android/emu-3.0-release/external/qemu/fpu/softfloat.c:486:round_canonical: code should not be reached 19:36 Emulator: Warning: QObject::~QObject: Timers cannot be stopped from another

XCode 6.3.1 crashes while renaming project

有些话、适合烂在心里 提交于 2019-11-29 10:08:07
问题 I am using Xcode 6.3.1 for developing an iOS game using cocos2dx 2.2.6. I need to change the name of my iOS application. I used to do it by pressing return key after clicking the project in XCode. It would open a dialog box which confirms where you want to change the name in the project. Two days ago I updated Xcode and now when I press enter to change the name of the project it opens the dialog box and suddenly crashes. If any one can find me an alternate method to change the application

cocos2d subclassing sprite to handle touch?

元气小坏坏 提交于 2019-11-29 08:45:27
I'm new to the cocos2d(-x) world. I'd like to detect a touch to a sprite, and tutorials/examples seem to suggest using layer to detect touch and find the approapriate sprite with bounding box. Is subclassing sprite to allow touch detection generally a bad idea? it is better and much more clear to handle touches in one place. but i think, no one can bar you to do this Note: This answer might be outdated. I answered this at 2012. It is not a bad idea. Here is how I do it: header file: #include "cocos2d.h" using namespace cocos2d; class TouchableSprite : public cocos2d::CCSprite, public

android studio emulator crashing after 3.0 update

房东的猫 提交于 2019-11-29 07:56:10
I have been messing around with android studio and I ended up installing cocos2dx and using an arm cpu emulator to work with cocos2dx. I have recently seen a message prompting for an update for the android emulator service so I installed it and now my emulator crashes while trying to boot and gives this error in the logcat - this is the error it gave me 19:36 Emulator: ** 19:36 Emulator: ERROR:/buildbot/src/android/emu-3.0-release/external/qemu/fpu/softfloat.c:486:round_canonical: code should not be reached 19:36 Emulator: Warning: QObject::~QObject: Timers cannot be stopped from another

Cocos2d 有用的各种方法

不打扰是莪最后的温柔 提交于 2019-11-29 07:01:16
从网上收集一些有用的方法,总结一下以便以后复习查找。 内容简要: 1、改变游戏速度 2、 获取当前屏幕宽 高 3、创建一个 layer (无贴图) 4、 在cocos2d中设置横屏 5、 在cocos2d中设置竖屏 6、 在cocos2d中设置高清模式 AppDelegate.m 7、粒子系统用法 8、进度条 9、设置为2d 10、禁止自动锁屏 原文地址: http://blog.csdn.net/dingkun520wy/article/details/6999538 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ //1、改变游戏速度 [[CCScheduler sharedScheduler] setTimeScale:2.0f];//设置为正常的2倍 //2、获取当前屏幕宽 高 CGSize size =[[CCDirector sharedDirector]winSize]; //3、创建一个 layer

Cocos2dx memory management, how to use destructors and when to release objects?

孤街醉人 提交于 2019-11-29 06:06:43
I'm reading around the web and the documentation but to be honest, I don't get it. Since I'm new to cocos2d-x I would like to understand better how the objects are created/retained and what I'm supposed to do to release them (if required). The thing that confuses me is the usage of smart pointers that I don't know very well. Imagine that in my CCLayer (added to the CCScene) I add a CCSprite, so i do: this->sprite = CCSprite::create("mySprite.png"); this->addChild(sprite); then since I've used create() I'm supposed to release it somewhere? in the destructor of the CCLayer maybe? or I have