CCTintTo、CCTintBy是将sprite的颜色调到你想设置的目标颜色;
CCScaleTo与CCScaleBy比较:
static CCScaleTo* CCScaleTo::create(float duration , float sx , float sy); /* * duration是动作执行持续时间,单位为秒; * sx是X方向的拉伸值(注意,是拉伸值!); * sy是Y方向的拉伸值; */
Static CCScaleBy* CCScaleBy::create(float duration , float sx , float sy); /* * duration是动作执行持续时间 * sx是X方向的拉伸倍数(注意,现在是倍数!); * sy是Y方向的拉伸倍数; */
CCJumpTo:把某一CCSprite跳到某一位置
CCJumpBy:把某一CCSprite跳起一段距离,它有一个方法reverse,它让对象按原路径返回;
CCCardinalSplineTo 为精灵规划路径
//创建精灵 Boss Boss =CCSprite::create("diji.png"); Boss->setPosition(ccp(320, 1000));//Boss坐标 this->addChild(Boss); //创建坐标组 并添加坐标 CCPointArray * bosspoints=CCPointArray::create(18); bosspoints->addControlPoint(ccp(250, 980)); bosspoints->addControlPoint(ccp(350, 800)); bosspoints->addControlPoint(ccp(450, 650)); bosspoints->addControlPoint(ccp(500, 500)); bosspoints->addControlPoint(ccp(450, 350)); bosspoints->addControlPoint(ccp(350, 200)); bosspoints->addControlPoint(ccp(250, 350)); bosspoints->addControlPoint(ccp(150, 500)); bosspoints->addControlPoint(ccp(50, 650)); bosspoints->addControlPoint(ccp(150, 800)); bosspoints->addControlPoint(ccp(250, 980)); bosspoints->addControlPoint(ccp(150, 980)); bosspoints->addControlPoint(ccp(50, 980)); bosspoints->addControlPoint(ccp(150, 980)); bosspoints->addControlPoint(ccp(250, 980)); bosspoints->addControlPoint(ccp(350, 980)); bosspoints->addControlPoint(ccp(450, 980)); bosspoints->addControlPoint(ccp(350, 980)); bosspoints->addControlPoint(ccp(250, 980)); //根据坐标组创建一个轨迹 三个参数是 移动一轮的时间,坐标组,浮张力(惯性) CCActionInterval * bosslineTo=CCCardinalSplineTo::create(18, bosspoints, 0); //让boss执行这个行动 CCRepeatForever是一直执行 Boss->runAction(CCRepeatForever::create(bosslineTo));