当前位置:网站首页>Cocos2d-x项目总结中的一些遇到的问题
Cocos2d-x项目总结中的一些遇到的问题
2022-07-05 19:52:00 【全栈程序员站长】
大家好,又见面了,我是全栈君,今天给大家准备了Idea注册码。
这几天在用Cocos2D-X尝试着做一个小游戏,当然不是创新,仅仅是单纯的模仿,就是为了将自己这段时间学到的技术应用于实践中。
在这个过程中。遇到了一些问题,在此特做一些总结,以免以后遇到类似的问题。
与诸君共享,希望可以在诸君以后的开发中起到一点帮助,哪怕仅仅是一点点,也就不负初衷了。
1.进入场景后没有出现预期控件移动的效果
错误原因:没有调用父类的onEnter()方法
2.SimpleAudioEngine找不到
错误原因:没有导入#include “SimpleAudioEngine.h”头文件
没有引用using namespace CocosDenshion;命名空间
3.调用
CCDirector::sharedDirector()->replaceScene(GameAbout::scene());
切换场景后,新场景显式黑屏
错误原因:没使用CREATE_FUNC(GameAbout);宏创建新的场景
4.用VS2012编译后的project。再用VS2010执行时报出例如以下错误:
fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏
解决方法例如以下:
项目\属性\配置属性\清单工具\输入和输出\嵌入清单:原来是“是”,改成“否”。
5.CCSpriteBatchNode only support CCSprite
错误原因:将非CCSprite对象加入到了CCSpriteBatchNode对象上
6.预期出现标题移动的效果。实际出现背景移动的效果
错误原因:标题和背景的tag反复
7.精灵不能响应触摸事件
错误原因:未注冊触摸事件代理
CCDirector->sharedDirector()->getTouchDispatcher()->addTargetedDelegate(this, 0, true);
8.注冊触摸事件后不能正确推断触摸点的位置
错误原因:未将触摸点坐标转化为CCNode的相对坐标
convertTouchToNodeSpaceAR(touch)
9.触摸移动时,未调用ccTouchMoved方法
错误原因:ccTouchBegan方法返回值为false
10.创建动画后无动画效果
错误原因:未调用下面方法
animation->setDelayPerUnit(0.2f); // 设置两帧间的时间间隔
animation->setRestoreOriginalFrame(true); // 是否从原始帧開始播放
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/117730.html原文链接:https://javaforall.cn
边栏推荐
- UWB ultra wideband positioning technology, real-time centimeter level high-precision positioning application, ultra wideband transmission technology
- Is it safe to open a mobile stock account? Is it reliable?
- Tasks in GStreamer
- Using repositoryprovider to simplify the value passing of parent-child components
- IBM has laid off 40 + year-old employees in a large area. Mastering these ten search skills will improve your work efficiency ten times
- [AI framework basic technology] automatic derivation mechanism (autograd)
- Postman core function analysis - parameterization and test report
- Recommended collection, my Tencent Android interview experience sharing
- C#应用程序界面开发基础——窗体控制(5)——分组类控件
- [C language] string function and Simulation Implementation strlen & strcpy & strcat & StrCmp
猜你喜欢

Zhongang Mining: analysis of the current market supply situation of the global fluorite industry in 2022

Fundamentals of deep learning convolutional neural network (CNN)

图嵌入Graph embedding学习笔记

司空见惯 - 英雄扫雷鼠

不愧是大佬,字节大牛耗时八个月又一力作

Millimeter wave radar human body sensor, intelligent perception of static presence, human presence detection application

S7-200smart uses V90 Modbus communication control library to control the specific methods and steps of V90 servo

leetcode刷题:二叉树11(平衡二叉树)

Parler de threadlocal insecurerandom

测试外包公司怎么样?
随机推荐
通配符选择器
集合
手机股票开户安全吗?靠不靠谱啊?
Multi branch structure
期货如何网上开户?安不安全?
Where is the operation of new bonds? Is it safer and more reliable to open an account
测试的核心价值到底是什么?
浮动元素与父级、兄弟盒子的关系
Build your own website (16)
测试外包公司怎么样?
SecureRandom那些事|真伪随机数
leetcode刷题:二叉树18(最大二叉树)
Necessary skills for interview in large factories, 2022android will not die, I will not fall
如何安全快速地从 Centos迁移到openEuler
How to safely and quickly migrate from CentOS to openeuler
Microwave radar induction module technology, real-time intelligent detection of human existence, static micro motion and static perception
Is the education of caiqiantang reliable and safe?
图嵌入Graph embedding学习笔记
C application interface development foundation - form control (5) - grouping control
软件测试是干什么的?学习有啥要求?