摘要: Write your questions or Suggestions here. 阅读全文
posted @ 2018-03-02 23:22 我要开发游戏 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 1.音效引入头文件#include "simpleAudioEngine.h"命名空间using namespace CocosDenshion; 1 //创建一个背景 2 Size winSize = Director::getInstance()->getWinSize(); 3 ... 阅读全文
posted @ 2016-01-02 12:50 我要开发游戏 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 1 //必须 要有float类型的参数 2 void MainScene::updateFrame(float dt) 3 { 4 if (spriteTest != NULL && spriteTest->getBoundingBox().intersectsRect(sprite->g... 阅读全文
posted @ 2016-01-01 20:00 我要开发游戏 阅读(633) 评论(0) 推荐(0) 编辑
摘要: 1 //创建一个精灵 2 Sprite *spriteTest = Sprite::create("1.png"); 3 spriteTest->setPosition(Point(100,100)); 4 this->addChild(spriteTest); 5 ... 阅读全文
posted @ 2016-01-01 15:51 我要开发游戏 阅读(379) 评论(0) 推荐(0) 编辑
摘要: 植物大战僵尸的植物摇摆效果 1 //帧动画 2 Animation *animation = Animation::create(); 3 4 Sprite *sprite = Sprite::create("1.png"); 5 sprite->setPositi... 阅读全文
posted @ 2015-12-21 22:40 我要开发游戏 阅读(280) 评论(0) 推荐(0) 编辑
摘要: 7.Bezier曲线需要ccBezierConfig结构体,设置2个控制点和一个结束点1 ccBezierConfig bc;2 bc.controlPoint_1 = Vec2(400,400);3 bc.controlPoint_2 = Vec2(800,200);4 bc.endPositio... 阅读全文
posted @ 2015-12-20 21:49 我要开发游戏 阅读(484) 评论(0) 推荐(0) 编辑
摘要: 1.精灵的runAction方法 1 spt = Sprite::create("pean.jpg"); 2 this->addChild(spt); 3 4 MenuItemFont *item = MenuItemFont::create("开始", [&](R... 阅读全文
posted @ 2015-12-20 15:31 我要开发游戏 阅读(211) 评论(0) 推荐(0) 编辑
摘要: 用处是减少对精灵的渲染次数,用法如下1 SpriteFrameCache::getInstance()->addSpriteFramesWithFile("person.plist");2 SpriteBatchNode *node = SpriteBatchNode::create... 阅读全文
posted @ 2015-12-20 13:07 我要开发游戏 阅读(674) 评论(0) 推荐(0) 编辑
摘要: 1.通过文件创建Sprite *bg = Sprite::create("backGround.jpg");2.通过图片的某个区域创建1 SpriteFrame *frame = SpriteFrame::create("pean.jpg", Rect(0, 0, 300, 300));2 ... 阅读全文
posted @ 2015-12-20 10:20 我要开发游戏 阅读(787) 评论(0) 推荐(0) 编辑
摘要: ---恢复内容开始---cocos2dx 3.0以后 Menu相关回调函数使用不同。现在列出当前版本可使用的方法。看见一个说的很仔细的博客,博客源地址http://blog.sina.com.cn/s/blog_6d193c030101h40e.html以按钮回调为例,第二个参数MenuItemFo... 阅读全文
posted @ 2015-12-19 18:32 我要开发游戏 阅读(276) 评论(0) 推荐(0) 编辑